Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve successive config mismatched NGenConfig.h #682

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ endif()
# -----------------------------------------------------------------------------
# Project Targets
# -----------------------------------------------------------------------------

# Contains NGenConfig.h
add_library(ngen_config_header INTERFACE)
add_library(NGen::config_header ALIAS ngen_config_header)
target_include_directories(ngen_config_header INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/include")

target_include_directories(ngen PUBLIC "${NGEN_INC_DIR}")

add_subdirectory("src/core")
Expand All @@ -200,6 +206,7 @@ add_subdirectory("src/utilities/logging")

target_link_libraries(ngen
PUBLIC
NGen::config_header
NGen::core
NGen::core_catchment
NGen::core_nexus
Expand Down Expand Up @@ -347,4 +354,4 @@ ngen_dependent_multiline_message(NGEN_WITH_PYTHON
" pybind11 Include: ${pybind11_INCLUDE_DIR}")
message(STATUS "---------------------------------------------------------------------")

configure_file("${NGEN_INC_DIR}/NGenConfig.h.in" "${NGEN_INC_DIR}/NGenConfig.h")
configure_file("${NGEN_INC_DIR}/NGenConfig.h.in" "${CMAKE_CURRENT_BINARY_DIR}/include/NGenConfig.h")
7 changes: 5 additions & 2 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ if (NGEN_WITH_PYTHON)
${PROJECT_SOURCE_DIR}/include/utilities
${PROJECT_SOURCE_DIR}/extern/pybind11/include
)
configure_file(${PROJECT_SOURCE_DIR}/src/core/NGen_Python_Build_Versions.in NGen_Python_Build_Versions.cpp)
target_sources(core PRIVATE NGen_Python_Build_Versions.cpp)
configure_file(
${PROJECT_SOURCE_DIR}/src/core/NGen_Python_Build_Versions.in
${CMAKE_CURRENT_BINARY_DIR}/src/core/NGen_Python_Build_Versions.cpp
)
target_sources(core PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src/core/NGen_Python_Build_Versions.cpp)
target_link_libraries(core PUBLIC
Boost::boost # Headers-only Boost
pybind11::embed
Expand Down
Loading