Skip to content

Commit

Permalink
cmake: configure NGenConfig.h into build directory and add interface …
Browse files Browse the repository at this point in the history
…target
  • Loading branch information
program-- committed Nov 27, 2023
1 parent 51d4dbd commit b131a72
Showing 1 changed file with 8 additions and 1 deletion.
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")

0 comments on commit b131a72

Please sign in to comment.