Skip to content

Commit

Permalink
Display Python variables
Browse files Browse the repository at this point in the history
  • Loading branch information
langmm committed Jan 22, 2024
1 parent 6c5014f commit a5bfde6
Show file tree
Hide file tree
Showing 3 changed files with 545 additions and 5 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ cmake_minimum_required(VERSION 3.16)
set(YGGDRASIL_REQUIRE_SKBUILD ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ygg_options.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/SearchTools.cmake)

# if (CMAKE_BUILD_TYPE STREQUAL "Debug")
# if (RAPIDJSON_CHECK_PYREFS)
# # if (CMAKE_BUILD_TYPE STREQUAL "Debug")
# set (${PYTHON_PREFIX}_FIND_ABI "ON" "ANY" "ANY")
# endif()
find_package(Python COMPONENTS Interpreter Development.Module NumPy REQUIRED)
find_package(
${PYTHON_PREFIX} COMPONENTS
Interpreter Development.Module NumPy REQUIRED)
message(STATUS "${PYTHON_PREFIX}_VERSION = ${${PYTHON_PREFIX}_VERSION}")
if (${PYTHON_PREFIX}_VERSION VERSION_LESS "3.8.0")
message(FATAL_ERROR "Only Python 3.8+ is supported.")
endif()
Expand All @@ -16,9 +21,10 @@ if (PYTHON_PREFIX STREQUAL "Python")
else()
Python3_add_library(rapidjson MODULE rapidjson.cpp)
endif()
dump_cmake_variables(REGEX "^Python*" VERBOSE)

target_include_directories(rapidjson PUBLIC ${RAPIDJSON_INCLUDE_DIRS})
target_link_libraries(rapidjson PUBLIC Python::NumPy)
target_link_libraries(rapidjson PUBLIC ${PYTHON_PREFIX}::NumPy)

message(STATUS "${PYTHON_PREFIX}_INCLUDE_DIRS = ${${PYTHON_PREFIX}_INCLUDE_DIRS}")
target_include_directories(rapidjson PUBLIC "${PYTHON_PREFIX}_INCLUDE_DIRS")
Expand Down
Loading

0 comments on commit a5bfde6

Please sign in to comment.