added AARE_INSTALL_PYTHONEXT option to install python in make install, which also installs the python files in the aare folder

This commit is contained in:
maliakal_d 2024-11-28 15:18:13 +01:00
parent 0df8e4bb7d
commit 31b834c3fd
2 changed files with 9 additions and 1 deletions

View File

@ -39,6 +39,7 @@ option(AARE_IN_GITHUB_ACTIONS "Running in Github Actions" OFF)
option(AARE_DOCS "Build documentation" OFF)
option(AARE_VERBOSE "Verbose output" OFF)
option(AARE_CUSTOM_ASSERT "Use custom assert" OFF)
option(AARE_INSTALL_PYTHONEXT "Install the python extension in the install tree under CMAKE_INSTALL_PREFIX/aare/" OFF)
# Configure which of the dependencies to use FetchContent for

View File

@ -49,4 +49,11 @@ set_target_properties(_aare PROPERTIES
configure_file(examples/play.py ${CMAKE_BINARY_DIR}/play.py)
install(TARGETS _aare DESTINATION aare)
if(AARE_INSTALL_PYTHONEXT)
install(TARGETS _aare
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/aare
)
install(FILES ${PYTHON_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/aare)
endif()