Skip to content

Commit

Permalink
Update Pybind11 configuration in CMakeLists.txt
Browse files Browse the repository at this point in the history
Adjusted the CMAKE_PREFIX_PATH to include parent directory of Pybind11 installation for correct directory resolution. Changed the find_package command to use the CONFIG mode, ensuring proper configuration file lookup.
  • Loading branch information
inakleinbottle committed Oct 31, 2024
1 parent f365a08 commit dffe154
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ if(NOT DEFINED pybind11_ROOT)
if (_python_pybind11_dir_found EQUAL 0)
message(STATUS "Adding Pybind11 cmake dir ${_python_pybind11_dir}")
set(pybind11_ROOT "${_python_pybind11_dir}" CACHE INTERNAL "")
list(APPEND CMAKE_PREFIX_PATH "${_python_pybind11_dir}")
list(APPEND CMAKE_PREFIX_PATH "${_python_pybind11_dir}/..")
else()
message(FATAL_ERROR "Could not add pybind11 dir: ${_python_pybind11_dir_found} && ${_python_pybind11_dir}")
endif ()
Expand Down Expand Up @@ -385,7 +385,7 @@ endif ()
# INTERFACE_COMPILE_OPTIONS "${_omp_flags}")
#endif()

find_package(pybind11 REQUIRED)
find_package(pybind11 CONFIG REQUIRED)
find_package(cereal REQUIRED)
find_package(PCGRandom REQUIRED)
#find_package(Libalgebra_lite REQUIRED)
Expand Down

0 comments on commit dffe154

Please sign in to comment.