summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-05-16 11:49:11 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2017-05-16 11:49:11 +0200
commita665a2e0a4651784e2e81eb99a5f414e6a37c384 (patch)
tree8b753a2a13592a918a5292240a1a1900a5d1b30c
parent0fc0f3701ef4f504e71eadcc92a93faf1dd33bf4 (diff)
downloadouroboros-a665a2e0a4651784e2e81eb99a5f414e6a37c384.tar.gz
ouroboros-a665a2e0a4651784e2e81eb99a5f414e6a37c384.zip
build: Fix deprecation warning
This fixes a deprecation warning for CMake 3.8 and higher. swig_add_module has been deprecated in favor of swig_add_library.
-rw-r--r--include/ouroboros/wrap/CMakeLists.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/ouroboros/wrap/CMakeLists.txt b/include/ouroboros/wrap/CMakeLists.txt
index 6150fb17..405f7157 100644
--- a/include/ouroboros/wrap/CMakeLists.txt
+++ b/include/ouroboros/wrap/CMakeLists.txt
@@ -19,7 +19,17 @@ else ()
# Python assumes C99 since Python 3.6
test_and_set_c_compiler_flag_global(-std=c99)
- swig_add_module(ouroboros python ouroboros.i)
+ # CMake > 3.8 deprecates swig_add_module
+ if (CMAKE_MAKOR_VERSION VERSION_LESS 3 AND
+ CMAKE_MINOR_VERSION VERSION_LESS 8)
+ swig_add_module(ouroboros python ouroboros.i)
+ else ()
+ swig_add_library(ouroboros
+ LANGUAGE python
+ SOURCES ouroboros.i
+ TYPE MODULE)
+ endif()
+
swig_link_libraries(ouroboros ${PYTHON_LIBRARIES} ouroboros)
# Installation directives