Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ project(pluginplay VERSION "${pluginplay_version}" LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)

include(get_cmaize)
include(nwx_find_package)

# Work out full paths to the project's include/source dirs
set(project_inc_dir "${CMAKE_CURRENT_LIST_DIR}/include/${PROJECT_NAME}")
Expand Down Expand Up @@ -70,10 +71,32 @@ set(pluginplay_depends utilities parallelzone libfort Boost::boost RocksDB)
# targets separately instead of a CMaize target
include(nwx_pybind11)
if("${BUILD_PYBIND11_PYBINDINGS}")
nwx_find_package(
Python3
# NOTE: Right now only the first component is added to find_dependency()
# so Development is listed first since it provides Python3::Python
COMPONENTS Development Interpreter
REQUIRED
TARGETS
python Python3::Python
)

nwx_find_pybind11()
nwx_find_package(
pybind11
# pybind11 won't be found if it is built in the above nwx_find_pybind11().
# QUIET helps hide the error that would be output and even though
# pybind11 is REQUIRED, we will ignore the error here for now.
QUIET
# REQUIRED
TARGETS
pybind11_headers pybind11::headers
pybind11_embed pybind11::embed
)

list(
APPEND pluginplay_depends
pybind11::headers pybind11::embed Python::Python
pybind11_headers pybind11_embed python
)
endif()

Expand Down
Loading