]> Creatis software - cpPlugins.git/blobdiff - appli/bash/CMakeLists.txt
...
[cpPlugins.git] / appli / bash / CMakeLists.txt
index 2eac91c619a234c6b0ef930a7fa68414961f3be1..6d2c288096c6769c91ed663ab8ec854560992ba5 100644 (file)
@@ -1,16 +1,27 @@
-SET(
-  bash_SOURCES
-  cpPlugins_HostCreator
+## ============================
+## == Configure source files ==
+## ============================
+
+FILE(
+  GLOB all_SOURCE_CXX_FILES RELATIVE
+  "${CMAKE_CURRENT_SOURCE_DIR}"
+  "${CMAKE_CURRENT_SOURCE_DIR}/*.cxx"
   )
 
-FOREACH(program ${bash_SOURCES})
-  ADD_EXECUTABLE(${program} ${program}.cxx)
+## ==========================
+## == Compile source files ==
+## ==========================
+
+FOREACH(source ${all_SOURCE_CXX_FILES})
+  GET_FILENAME_COMPONENT(name ${source} NAME_WE)
+  ADD_EXECUTABLE(${name} ${source})
   INSTALL(
-    TARGETS ${program}
+    TARGETS ${name}
     RUNTIME DESTINATION bin
     LIBRARY DESTINATION lib
     ARCHIVE DESTINATION lib/static
     )
-ENDFOREACH(program)
+  SET(${name}_APP ${name} CACHE INTERNAL "bash program ${name}")
+ENDFOREACH(source)
 
 ## eof - $RCSfile$