aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-06-28 18:47:15 +0200
committerHampusM <hampus@hampusmat.com>2022-06-28 18:47:15 +0200
commitdaf39f75d764449f18cd480b6d3c645b8372b0a5 (patch)
tree6df1f2aa27be238817b3ba11f66c1e1688a82193
parent281803e8328af03af384bd505009acf9b51b2536 (diff)
build: move function target_link_libraries_system to own file
-rw-r--r--cmake/linking.cmake10
-rw-r--r--src/CMakeLists.txt12
2 files changed, 12 insertions, 10 deletions
diff --git a/cmake/linking.cmake b/cmake/linking.cmake
new file mode 100644
index 0000000..0de81d8
--- /dev/null
+++ b/cmake/linking.cmake
@@ -0,0 +1,10 @@
+function(target_link_libraries_system target)
+ set(libs ${ARGN})
+
+ foreach(lib ${libs})
+ get_target_property(lib_include_dirs ${lib} INTERFACE_INCLUDE_DIRECTORIES)
+ target_include_directories(${target} SYSTEM PRIVATE ${lib_include_dirs})
+ target_link_libraries(${target} ${lib})
+ endforeach(lib)
+endfunction(target_link_libraries_system)
+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2e767ef..a29cc35 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,13 +1,3 @@
-function(target_link_libraries_system target)
- set(libs ${ARGN})
-
- foreach(lib ${libs})
- get_target_property(lib_include_dirs ${lib} INTERFACE_INCLUDE_DIRECTORIES)
- target_include_directories(${target} SYSTEM PRIVATE ${lib_include_dirs})
- target_link_libraries(${target} ${lib})
- endforeach(lib)
-endfunction(target_link_libraries_system)
-
file(GLOB SOURCES
bootstrap.cpp
util/color.cpp
@@ -64,6 +54,8 @@ target_include_directories(${PROJECT_NAME} PRIVATE .)
target_link_libraries(${PROJECT_NAME} dw)
+include(${CMAKE_SOURCE_DIR}/cmake/linking.cmake)
+
target_link_libraries_system(
${PROJECT_NAME}
fmt::fmt