Skip to content

Commit

Permalink
Merge pull request #66 from pariterre/dev
Browse files Browse the repository at this point in the history
Added the capability to use swig4.0
  • Loading branch information
pariterre authored Jul 19, 2019
2 parents 475e994 + 15b07e6 commit 0bb3890
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions binding/python3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,16 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.py
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py
DESTINATION ${Python3_SITELIB}/${PROJECT_NAME})

# For some reason, I could not install the library directly into subfolder
# Some day this should be fixed...
# Check if swig has its version 3 or 4, to choose the right place to put the library
if(${SWIG_VERSION} MATCHES "^3(\.[0-9]*)*$")
set(PYTHON_INSTALL_DESTINATION ${Python3_SITELIB})
elseif(${SWIG_VERSION} MATCHES "^4(\.[0-9]*)*$")
set(PYTHON_INSTALL_DESTINATION ${Python3_SITELIB}/${PROJECT_NAME})
else()
message( FATAL_ERROR "Swig must be version 3 or 4" )
endif()

# Install the library
INSTALL(TARGETS _${PROJECT_NAME}
DESTINATION ${Python3_SITELIB})
DESTINATION ${PYTHON_INSTALL_DESTINATION})

0 comments on commit 0bb3890

Please sign in to comment.