From 31b834c3fd36765ddeb0f1f7f6b416a66e8df0f6 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Thu, 28 Nov 2024 15:18:13 +0100 Subject: [PATCH 1/3] added AARE_INSTALL_PYTHONEXT option to install python in make install, which also installs the python files in the aare folder --- CMakeLists.txt | 1 + python/CMakeLists.txt | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee878dd..f67d655 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index ab746dd..c5d9d10 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -49,4 +49,11 @@ set_target_properties(_aare PROPERTIES configure_file(examples/play.py ${CMAKE_BINARY_DIR}/play.py) -install(TARGETS _aare DESTINATION aare) \ No newline at end of file +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() \ No newline at end of file From fdce2f69b9d9643e2c7bc326061de5ea0d313b32 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 29 Nov 2024 11:07:05 +0100 Subject: [PATCH 2/3] python 3.10 required in cmake --- python/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index c5d9d10..98d794f 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,5 +1,5 @@ -find_package (Python 3.10 COMPONENTS Interpreter Development) +find_package (Python 3.10 COMPONENTS Interpreter Development REQUIRED) # Download or find pybind11 depending on configuration if(AARE_FETCH_PYBIND11) From 2e4a491d7aee32cd70c1c00f166c5426ae60e246 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 29 Nov 2024 14:38:32 +0100 Subject: [PATCH 3/3] CMAKE_INSTALL_PREFIX not needed to specify destination folder and removed --- python/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 98d794f..89ad5e7 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -52,8 +52,8 @@ configure_file(examples/play.py ${CMAKE_BINARY_DIR}/play.py) if(AARE_INSTALL_PYTHONEXT) install(TARGETS _aare EXPORT "${TARGETS_EXPORT_NAME}" - LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/aare + LIBRARY DESTINATION aare ) - install(FILES ${PYTHON_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/aare) + install(FILES ${PYTHON_FILES} DESTINATION aare) endif() \ No newline at end of file