From a665a2e0a4651784e2e81eb99a5f414e6a37c384 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Tue, 16 May 2017 11:49:11 +0200 Subject: 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. --- include/ouroboros/wrap/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3