Skip to content

Commit

Permalink
Switched to find_package Python
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverSchmitz committed Mar 7, 2024
1 parent 879f7d3 commit 3970e6b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.18)
cmake_minimum_required(VERSION 3.22)

project(campo
VERSION 0.3.11
Expand All @@ -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()
Expand All @@ -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 "-------------------------------------------------")
2 changes: 1 addition & 1 deletion source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions source/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)

Expand All @@ -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
)


Expand Down

0 comments on commit 3970e6b

Please sign in to comment.