From baa9f86407d880a08a19697bb817e88310aa5ec8 Mon Sep 17 00:00:00 2001 From: Jakob Petsovits Date: Wed, 15 Jul 2015 21:36:54 -0400 Subject: [PATCH] CMake build: specify examples sources manually instead of globbing. This is necessary because the client_test example spans multiple files, so creating an executable for each one separately doesn't make so much sense anymore. --- examples/CMakeLists.txt | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 1955766e2..ba7595f33 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -21,9 +21,22 @@ find_package(Boost REQUIRED COMPONENTS system) include_directories(${LibtorrentRasterbar_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) add_definitions(${LibtorrentRasterbar_DEFINITIONS}) -FILE(GLOB examples RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.cpp") -foreach(s ${examples}) - get_filename_component (sn ${s} NAME_WE) - add_executable(${sn} ${s}) - target_link_libraries(${sn} ${LibtorrentRasterbar_LIBRARIES} ${Boost_LIBRARIES}) -endforeach(s) +set(single_file_examples + simple_client + stats_counters + dump_torrent + make_torrent + connection_tester + upnp_test) + +foreach(example ${single_file_examples}) + add_executable(${example} "${example}.cpp") + target_link_libraries(${example} ${LibtorrentRasterbar_LIBRARIES} ${Boost_LIBRARIES}) +endforeach(example) + +add_executable(client_test + client_test.cpp + print.cpp + torrent_view.cpp + session_view.cpp) +target_link_libraries(client_test ${LibtorrentRasterbar_LIBRARIES} ${Boost_LIBRARIES})