diff --git a/CMakeLists.txt b/CMakeLists.txt index d80d149..d9c47b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.18) +cmake_minimum_required(VERSION 3.22) project(campo VERSION 0.3.11 @@ -19,8 +19,10 @@ set(${PROJECT_NAME}_ORGANISATION_NAME "Computational Geography group, Dept. of P set(${PROJECT_NAME}_COPYRIGHT "2020 - ${DEV_CURRENT_YEAR}, ${${PROJECT_NAME}_ORGANISATION_NAME}") +find_package(Python 3.8 + REQUIRED COMPONENTS Interpreter +) -find_package (Python3 COMPONENTS Interpreter NumPy) include(FetchContent) enable_testing() @@ -46,8 +48,8 @@ message(STATUS "Campo configuration summary:") message(STATUS " Version: " ${${PROJECT_NAME}_VERSION}) message(STATUS " Installation directory: " ${CAMPO_INSTALL_DIR} ) message(STATUS " Build configuration:") -message(STATUS " Python interpreter: " ${Python3_EXECUTABLE}) -message(STATUS " Python version: " ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}.${Python3_VERSION_PATCH}) -message(STATUS " Site-packages: " ${Python3_SITELIB}) +message(STATUS " Python interpreter: " ${Python_EXECUTABLE}) +message(STATUS " Python version: " ${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}.${Python_VERSION_PATCH}) +message(STATUS " Site-packages: " ${Python_SITELIB}) message(STATUS " Build wheel : " ${CAMPO_BUILD_WHEEL} ) message(STATUS "-------------------------------------------------") diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 899402a..0c6c21e 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -18,7 +18,7 @@ install( if(CAMPO_BUILD_WHEEL) - install(CODE "execute_process(COMMAND ${Python3_EXECUTABLE} setup.py sdist bdist_wheel + install(CODE "execute_process(COMMAND ${Python_EXECUTABLE} setup.py sdist bdist_wheel WORKING_DIRECTORY ${CAMPO_INSTALL_DIR})") endif() diff --git a/source/test/CMakeLists.txt b/source/test/CMakeLists.txt index b0493dd..efc9d17 100644 --- a/source/test/CMakeLists.txt +++ b/source/test/CMakeLists.txt @@ -22,7 +22,7 @@ add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/unit_tests.py DEPENDS ${SOURCES} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Copying sources..." + COMMENT "Copying test sources..." COMMAND ${CMAKE_COMMAND} -E copy ${SOURCES} ${CMAKE_CURRENT_BINARY_DIR} ) @@ -31,7 +31,7 @@ add_test( NAME campo_unit_tests COMMAND - ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/unit_tests.py + ${Python_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/unit_tests.py )