File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1
1
include (GNUInstallDirs )
2
-
3
2
add_subdirectory (private )
4
3
5
4
set (CPP_TERMINAL_PUBLIC_HEADERS
Original file line number Diff line number Diff line change 1
1
set (THREADS_PREFER_PTHREAD_FLAG TRUE )
2
- find_package (Threads )
2
+ find_package (Threads REQUIRED MODULE )
3
3
4
4
# configure version information
5
5
configure_file (version .cpp.in version .cpp )
Original file line number Diff line number Diff line change @@ -8,15 +8,20 @@ target_compile_options(
8
8
)
9
9
add_library (Warnings::Examples ALIAS ExamplesWarnings )
10
10
11
+ find_package (Threads MODULE REQUIRED )
12
+
11
13
# Create an example
12
14
function (cppterminal_example )
13
- cmake_parse_arguments (ARG "WIN32" "SOURCE" "" ${ARGN} )
15
+ cmake_parse_arguments (ARG "WIN32" "SOURCE" "LIBRARIES " ${ARGN} )
14
16
if (ARG_WIN32 )
15
17
add_executable ("${ARG_SOURCE} " WIN32 "${ARG_SOURCE} .cpp" )
16
18
else ()
17
19
add_executable ("${ARG_SOURCE} " "${ARG_SOURCE} .cpp" )
18
20
endif ()
19
21
target_link_libraries ("${ARG_SOURCE} " PRIVATE cpp-terminal::cpp-terminal Warnings::Warnings Warnings::Examples )
22
+ if (DEFINED ARG_LIBRARIES )
23
+ target_link_libraries ("${ARG_SOURCE} " PRIVATE "${ARG_LIBRARIES} " )
24
+ endif ()
20
25
if (CPPTERMINAL_ENABLE_INSTALL )
21
26
install (TARGETS "${ARG_SOURCE} " RUNTIME DESTINATION bin/examples )
22
27
endif ()
@@ -27,7 +32,7 @@ cppterminal_example(SOURCE cin_cooked)
27
32
cppterminal_example (SOURCE cin_raw )
28
33
cppterminal_example (SOURCE colors )
29
34
cppterminal_example (SOURCE cout )
30
- cppterminal_example (SOURCE events )
35
+ cppterminal_example (SOURCE events LIBRARIES Threads::Threads )
31
36
cppterminal_example (SOURCE keys )
32
37
cppterminal_example (SOURCE kilo )
33
38
cppterminal_example (SOURCE menu )
You can’t perform that action at this time.
0 commit comments