From 7853c716b7494205b1662bb73271f2bba461216f Mon Sep 17 00:00:00 2001 From: Greg Foss Date: Tue, 28 Jan 2020 13:40:34 -0500 Subject: [PATCH] Automating the addition of new exe files --- breadcrumbs/CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/breadcrumbs/CMakeLists.txt b/breadcrumbs/CMakeLists.txt index d21bf8c..a0eb54b 100644 --- a/breadcrumbs/CMakeLists.txt +++ b/breadcrumbs/CMakeLists.txt @@ -44,8 +44,14 @@ file(GLOB_RECURSE ALGOS CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/algos/*.cpp") file(GLOB_RECURSE COMMS CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/comms/*.cpp") file(GLOB_RECURSE CONFIG CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/config/*.cpp") file(GLOB_RECURSE LOG CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/logging/*.cpp") -message("Source files: ${ALGOS}") + +file(GLOB EXECS CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/main/*.cpp") # Adding executables -add_executable(Breadcrumbs "${CMAKE_SOURCE_DIR}/main/Breadcrumbs.cpp" ${ALGOS} ${COMMS} ${CONFIG} ${LOG}) -add_executable(VirtualOutputProcessor "${CMAKE_SOURCE_DIR}/main/VirtualOutputProcessor.cpp" ${ALGOS} ${COMMS} ${CONFIG} ${LOG}) +# This is fine for now, but we may want to switch to a more manual versio so we can +# configure which files are included in which exe's +foreach(X IN LISTS EXECS) + get_filename_component(N ${X} NAME_WE) + message(STATUS "Generating Executable: ${N}.exe Main File: ${X}"}) + add_executable(${N} ${X} ${ALGOS} ${COMMS} ${CONFIG} ${LOG}) +endforeach()