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 11include (GNUInstallDirs)
2-
32add_subdirectory (private )
43
54set (CPP_TERMINAL_PUBLIC_HEADERS
Original file line number Diff line number Diff line change 11set (THREADS_PREFER_PTHREAD_FLAG TRUE )
2- find_package (Threads)
2+ find_package (Threads REQUIRED MODULE )
33
44# configure version information
55configure_file (version .cpp.in version .cpp)
Original file line number Diff line number Diff line change @@ -8,15 +8,20 @@ target_compile_options(
88)
99add_library (Warnings::Examples ALIAS ExamplesWarnings)
1010
11+ find_package (Threads MODULE REQUIRED)
12+
1113# Create an example
1214function (cppterminal_example)
13- cmake_parse_arguments (ARG "WIN32" "SOURCE" "" ${ARGN} )
15+ cmake_parse_arguments (ARG "WIN32" "SOURCE" "LIBRARIES " ${ARGN} )
1416 if (ARG_WIN32)
1517 add_executable ("${ARG_SOURCE} " WIN32 "${ARG_SOURCE} .cpp" )
1618 else ()
1719 add_executable ("${ARG_SOURCE} " "${ARG_SOURCE} .cpp" )
1820 endif ()
1921 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 ()
2025 if (CPPTERMINAL_ENABLE_INSTALL)
2126 install (TARGETS "${ARG_SOURCE} " RUNTIME DESTINATION bin/examples)
2227 endif ()
@@ -27,7 +32,7 @@ cppterminal_example(SOURCE cin_cooked)
2732cppterminal_example(SOURCE cin_raw)
2833cppterminal_example(SOURCE colors)
2934cppterminal_example(SOURCE cout)
30- cppterminal_example(SOURCE events)
35+ cppterminal_example(SOURCE events LIBRARIES Threads::Threads )
3136cppterminal_example(SOURCE keys)
3237cppterminal_example(SOURCE kilo)
3338cppterminal_example(SOURCE menu)
You can’t perform that action at this time.
0 commit comments