Skip to content

Commit

Permalink
cmake: change defaults again; attempt to fix CI issues
Browse files Browse the repository at this point in the history
  • Loading branch information
program-- committed Sep 7, 2023
1 parent aaedb5c commit 90f4994
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ include(GitUpdateSubmodules)
# Options =====================================================================
include(CMakeDependentOption)

option(NGEN_WITH_MPI "Build with MPI support" ON)
option(NGEN_WITH_MPI "Build with MPI support" OFF)
option(NGEN_WITH_NETCDF "Build with NetCDF support" ON)
option(NGEN_WITH_SQLITE "Build with SQLite3 support" ON)
option(NGEN_WITH_UDUNITS "Build with UDUNITS2 support" ON)
option(NGEN_WITH_BMI_FORTRAN "Build with Fortran BMI support" ON)
option(NGEN_WITH_BMI_C "Build with C BMI support" ON)
option(NGEN_WITH_PYTHON "Build with embedded Python support" ON)
option(NGEN_WITH_BMI_FORTRAN "Build with Fortran BMI support" OFF)
option(NGEN_WITH_BMI_C "Build with C BMI support" OFF)
option(NGEN_WITH_PYTHON "Build with embedded Python support" OFF)
option(NGEN_WITH_TESTS "Build with unit tests" ON)
option(NGEN_QUIET "Silence output" OFF)

Expand All @@ -69,6 +69,8 @@ deprecated_option(OLD PACKAGE_TESTS NEW NGEN_WITH_TESTS)
# Define project version and use via generated config header
project(ngen VERSION 0.1.0)

configure_file("${NGEN_INC_DIR}/NGenConfig.h.in" "${NGEN_INC_DIR}/NGenConfig.h")

add_executable(ngen "${NGEN_SRC_DIR}/NGen.cpp")

# Dependencies ================================================================
Expand Down Expand Up @@ -232,7 +234,6 @@ add_subdirectory(${TEST_BMI_CPP_DIR} ${TEST_BMI_CPP_DIR}/cmake_build) # FIXME: W
# -----------------------------------------------------------------------------
# Project Targets
# -----------------------------------------------------------------------------
configure_file(include/NGenConfig.h.in include/NGenConfig.h)
add_dependencies(ngen testbmicppmodel)
target_include_directories(ngen PUBLIC "${NGEN_INC_DIR}")

Expand Down
4 changes: 2 additions & 2 deletions src/core/mediator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ include(${PROJECT_SOURCE_DIR}/cmake/dynamic_sourced_library.cmake)
dynamic_sourced_cxx_library(core_mediator "${CMAKE_CURRENT_SOURCE_DIR}")

add_library(NGen::core_mediator ALIAS core_mediator)

if(NGEN_WITH_UDUNITS)
add_dependencies(core_mediator libudunits2)
target_link_libraries(core_mediator PUBLIC libudunits2)
target_link_libraries(core_mediator PUBLIC libudunits2)
endif()

find_package(Threads REQUIRED)
Expand Down
4 changes: 3 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function(ngen_add_test TESTNAME)

if(NGEN_TEST_CREATE)
add_executable(${TESTNAME} ${NGEN_TEST_OBJECTS})
target_link_libraries(${TESTNAME} gtest gtest_main ${NGEN_TEST_LIBRARIES})
target_link_libraries(${TESTNAME} PUBLIC gtest gtest_main ${NGEN_TEST_LIBRARIES})
set_target_properties(${TESTNAME} PROPERTIES FOLDER test)
gtest_discover_tests(
${TESTNAME}
Expand Down Expand Up @@ -177,6 +177,7 @@ ngen_add_test(
realizations/catchments/Bmi_C_Adapter_Test.cpp
realizations/catchments/Bmi_C_Formulation_Test.cpp
LIBRARIES
gmock
NGen::core
NGen::realizations_catchment
NGen::core_mediator
Expand Down Expand Up @@ -326,6 +327,7 @@ ngen_add_test(
utils/mdframe_netcdf_Test.cpp
utils/mdframe_csv_Test.cpp
LIBRARIES
gmock
NGen::core
NGen::core_nexus
NGen::core_mediator
Expand Down

0 comments on commit 90f4994

Please sign in to comment.