Skip to content

Commit 7bc8941

Browse files
committed
Simplify examples/CMakeLists.txt file
1 parent e8c93ce commit 7bc8941

1 file changed

Lines changed: 9 additions & 19 deletions

File tree

examples/CMakeLists.txt

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,14 @@
2727
# DEALINGS IN THE SOFTWARE.
2828
################################################################################
2929

30-
add_executable(complete complete.cpp)
31-
32-
target_link_libraries(complete cli::cli)
33-
34-
if (NOT WIN32)
35-
add_executable(asyncsession asyncsession.cpp)
36-
37-
target_link_libraries(asyncsession cli::cli)
30+
set(SOURCES complete filesession simplelocalsession pluginmanager)
31+
if(NOT WIN32)
32+
list(APPEND SOURCES asyncsession)
33+
else()
34+
message("asyncsession not built as it's not supported on Windows")
3835
endif()
3936

40-
add_executable(filesession filesession.cpp)
41-
42-
target_link_libraries(filesession cli::cli)
43-
44-
add_executable(simplelocalsession simplelocalsession.cpp)
45-
46-
target_link_libraries(simplelocalsession cli::cli)
47-
48-
add_executable(pluginmanager pluginmanager.cpp)
49-
50-
target_link_libraries(pluginmanager cli::cli)
37+
foreach(example ${SOURCES})
38+
add_executable(${example} ${example}.cpp)
39+
target_link_libraries(${example} PRIVATE cli::cli)
40+
endforeach(example)

0 commit comments

Comments
 (0)