Skip to content

Commit bd1f290

Browse files
authored
Simplify dependency includes (#540)
- reduce cmake boilerplate for 3rdparty includes - compact third-party link statements for modules
1 parent 9540525 commit bd1f290

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ message( STATUS "PPC step: First configures" )
2929
include(cmake/configure.cmake)
3030
include(cmake/modes.cmake)
3131
include(cmake/sanitizers.cmake)
32-
include(cmake/json.cmake)
33-
include(cmake/libenvpp.cmake)
34-
include(cmake/stb.cmake)
32+
foreach(dep json libenvpp stb)
33+
include(cmake/${dep}.cmake)
34+
endforeach()
3535

3636
################# Parallel programming technologies #################
3737

3838
message( STATUS "PPC step: Setup parallel programming technologies" )
39-
include(cmake/mpi.cmake)
40-
include(cmake/openmp.cmake)
41-
include(cmake/onetbb.cmake)
39+
foreach(dep mpi openmp onetbb)
40+
include(cmake/${dep}.cmake)
41+
endforeach()
4242

4343
######################### External projects #########################
4444

modules/CMakeLists.txt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,18 @@ target_include_directories(
2727
${exec_func_lib} PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty
2828
${CMAKE_SOURCE_DIR}/modules ${CMAKE_SOURCE_DIR}/tasks)
2929

30-
ppc_link_envpp(${exec_func_lib})
31-
ppc_link_json(${exec_func_lib})
32-
ppc_link_gtest(${exec_func_lib})
33-
ppc_link_threads(${exec_func_lib})
34-
ppc_link_openmp(${exec_func_lib})
35-
ppc_link_tbb(${exec_func_lib})
36-
ppc_link_mpi(${exec_func_lib})
37-
ppc_link_stb(${exec_func_lib})
30+
foreach(
31+
link
32+
envpp
33+
json
34+
gtest
35+
threads
36+
openmp
37+
tbb
38+
mpi
39+
stb)
40+
cmake_language(CALL "ppc_link_${link}" ${exec_func_lib})
41+
endforeach()
3842

3943
add_executable(${exec_func_tests} ${FUNC_TESTS_SOURCE_FILES})
4044

0 commit comments

Comments
 (0)