Skip to content

Commit

Permalink
Use swig_add_library for cmake >= 3.8.
Browse files Browse the repository at this point in the history
swig_add_module is deprecated.

Closes #11.
  • Loading branch information
jmr committed Jun 5, 2018
1 parent cdd342f commit de322f7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ include_directories(${PYTHON_INCLUDE_PATH})
set(CMAKE_SWIG_FLAGS "")
set_property(SOURCE s2.i PROPERTY SWIG_FLAGS "-module" "pywraps2")
set_property(SOURCE s2.i PROPERTY CPLUSPLUS ON)
swig_add_module(pywraps2 python s2.i)

if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
swig_add_module(pywraps2 python s2.i)
else()
swig_add_library(pywraps2 LANGUAGE python SOURCES s2.i)
endif()

swig_link_libraries(pywraps2 ${PYTHON_LIBRARIES} s2)
enable_testing()
add_test(NAME pywraps2_test COMMAND
Expand Down

0 comments on commit de322f7

Please sign in to comment.