Skip to content

Commit

Permalink
Modernize CMakeLists.txt ECFLOW-1923
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosbento authored Nov 17, 2023
2 parents 86ed2e2 + 7ed7573 commit f2dea78
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 8 deletions.
12 changes: 7 additions & 5 deletions ACore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
# nor does it submit to any jurisdiction.
#

configure_file(ecflow_version.h.in ${CMAKE_BINARY_DIR}/generated/ecflow_version.h)
configure_file(ecflow_source_build_dir.h.in ${CMAKE_BINARY_DIR}/generated/ecflow_source_build_dir.h)
configure_file(src/ecflow_version.h.in ${CMAKE_BINARY_DIR}/generated/src/ecflow_version.h)
configure_file(src/ecflow_source_build_dir.h.in ${CMAKE_BINARY_DIR}/generated/src/ecflow_source_build_dir.h)

set(srcs
# Headers
${CMAKE_BINARY_DIR}/generated/ecflow_version.h
${CMAKE_BINARY_DIR}/generated/ecflow_source_build_dir.h
${CMAKE_BINARY_DIR}/generated/src/ecflow_version.h
${CMAKE_BINARY_DIR}/generated/src/ecflow_source_build_dir.h
src/AssertTimer.hpp
src/Cal.hpp
src/Calendar.hpp
Expand Down Expand Up @@ -101,7 +101,7 @@ ecbuild_add_library(
${srcs}
PUBLIC_INCLUDES
src
${CMAKE_BINARY_DIR}/generated
${CMAKE_BINARY_DIR}/generated/src
PUBLIC_LIBS
cereal::cereal # this needs to be public as it appears in public header files used downstream
$<$<VERSION_LESS:${Boost_VERSION},1.69.0>:Boost::system>
Expand Down Expand Up @@ -151,6 +151,8 @@ set(test_srcs
ecbuild_add_test(
TARGET
u_acore
LABELS
unit nightly
SOURCES
${test_srcs}
LIBS
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions ANattr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ set(test_srcs
ecbuild_add_test(
TARGET
u_anattr
LABELS
unit nightly
SOURCES
${test_srcs}
LIBS
Expand Down
12 changes: 12 additions & 0 deletions ANode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ set(test_srcs
ecbuild_add_test(
TARGET
u_anode
LABELS
unit nightly
SOURCES
${test_srcs}
LIBS
Expand Down Expand Up @@ -256,6 +258,8 @@ set(test_srcs
ecbuild_add_test(
TARGET
u_aparser
LABELS
unit nightly
SOURCES
${test_srcs}
INCLUDES
Expand All @@ -279,6 +283,8 @@ if (ENABLE_ALL_TESTS)
ecbuild_add_test(
TARGET
u_anode_stest
LABELS
unit nightly
SOURCES
${test_srcs}
LIBS
Expand All @@ -304,6 +310,8 @@ if (ENABLE_ALL_TESTS)
ecbuild_add_test(
TARGET
perf_aparser
LABELS
performance nightly
SOURCES
${test_srcs}
LIBS
Expand All @@ -329,6 +337,8 @@ if (ENABLE_ALL_TESTS)
ecbuild_add_test(
TARGET
perf_aparser_timer
LABELS
performance nightly
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/test/data/single_defs/mega.def
SOURCES
Expand All @@ -350,6 +360,8 @@ if (ENABLE_ALL_TESTS)
ecbuild_add_test(
TARGET
perf_aparser_only
LABELS
performance
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/test/data/single_defs/mega.def
SOURCES
Expand Down
4 changes: 4 additions & 0 deletions Base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ set(test_srcs
ecbuild_add_test(
TARGET
u_base
LABELS
unit nightly
SOURCES
${test_srcs}
INCLUDES
Expand All @@ -194,6 +196,8 @@ if (ENABLE_ALL_TESTS)
ecbuild_add_test(
TARGET
perf_job_gen
LABELS
performance
SOURCES
${test_srcs}
LIBS
Expand Down
4 changes: 4 additions & 0 deletions CSim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ set(test_srcs
ecbuild_add_test(
TARGET
c_csim
LABELS
integration nightly
SOURCES
${test_srcs}
LIBS
Expand All @@ -73,6 +75,8 @@ if (ENABLE_ALL_TESTS)
ecbuild_add_test(
TARGET
c_csim_single
LABELS
integration nightly
SOURCES
test/TestSingleSimulator.cpp
test/TestUtil.cpp
Expand Down
6 changes: 6 additions & 0 deletions Client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ endif()
ecbuild_add_test(
TARGET
s_client
LABELS
integration nightly
SOURCES
${test_srcs}
INCLUDES
Expand All @@ -151,6 +153,8 @@ if (ENABLE_ALL_TESTS AND ENABLE_SERVER)
ecbuild_add_test(
TARGET
perf_test_large_defs
LABELS
performance
SOURCES
# Headers
test/SCPort.hpp
Expand All @@ -177,6 +181,8 @@ if (ENABLE_ALL_TESTS AND ENABLE_SERVER)
ecbuild_add_test(
TARGET
m_test_migration
LABELS
migration
SOURCES
# Headers
test/SCPort.hpp
Expand Down
5 changes: 4 additions & 1 deletion Http/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ if (ENABLE_HTTP AND ENABLE_SERVER)
)

ecbuild_add_test(
TARGET s_http
TARGET
s_http
LABELS
integration nightly
SOURCES
${test_srcs}
INCLUDES
Expand Down
4 changes: 4 additions & 0 deletions Pyext/python2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ foreach( test ${u_tests} )
ecbuild_add_test(
TARGET
py2_${test}
LABELS
python nightly
TYPE PYTHON
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/../test/${test}.py
Expand All @@ -72,6 +74,8 @@ if ( ENABLE_ALL_TESTS AND ENABLE_SERVER)
ecbuild_add_test(
TARGET
py2_${test}
LABELS
python nightly
TYPE PYTHON
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/../test/${test}.py
Expand Down
4 changes: 4 additions & 0 deletions Pyext/python3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ foreach( test ${u_tests} )
ecbuild_add_test(
TARGET
py3_${test}
LABELS
python nightly
TYPE PYTHON
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/../test/${test}.py
Expand All @@ -83,6 +85,8 @@ if ( ENABLE_ALL_TESTS AND ENABLE_SERVER)
ecbuild_add_test(
TARGET
py3_${test}
LABELS
python nightly
TYPE PYTHON
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/../test/py_${test}.py
Expand Down
2 changes: 2 additions & 0 deletions Server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ SET_TARGET_PROPERTIES(ecflow_server
ecbuild_add_test(
TARGET
u_server
LABELS
unit nightly
INCLUDES
src
SOURCES
Expand Down
6 changes: 6 additions & 0 deletions Test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ if (ENABLE_ALL_TESTS)
ecbuild_add_test(
TARGET
s_test
LABELS
integration nightly
SOURCES
${test_srcs}
LIBS
Expand All @@ -89,6 +91,8 @@ if (ENABLE_ALL_TESTS)
ecbuild_add_test(
TARGET
s_test_zombies
LABELS
integration nightly
SOURCES
TestZombies.cpp
LIBS
Expand All @@ -103,6 +107,8 @@ if (ENABLE_ALL_TESTS)
ecbuild_add_test(
TARGET
s_singletest
LABELS
integration nightly
SOURCES
TestSingle.cpp
LIBS
Expand Down
8 changes: 6 additions & 2 deletions Udp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,12 @@ list(APPEND ${TEST_TARGET}_srcs
)

ecbuild_add_test(
TARGET ${TEST_TARGET}
SOURCES ${${TEST_TARGET}_srcs}
TARGET
${TEST_TARGET}
LABELS
integration nightly
SOURCES
${${TEST_TARGET}_srcs}
LIBS
${LIB_TARGET}
libclient
Expand Down

0 comments on commit f2dea78

Please sign in to comment.