summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt23
1 files changed, 10 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 76eb685..3cb6aeb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,18 +5,15 @@ project(fracture)
include_directories(src ~/.local/include)
link_directories(~/.local/lib)
-file(GLOB SOURCES lib/*.c)
-add_executable(fracture src/fracture.c ${SOURCES})
-add_executable(big_anal_process src/big_anal_process.c ${SOURCES})
-add_executable(anal_process src/anal_process.c ${SOURCES})
-add_executable(cen_anal_process src/cen_anal_process.c ${SOURCES})
-add_executable(long_anal_process src/long_anal_process.c ${SOURCES})
-add_executable(corr_test src/corr_test.c ${SOURCES})
+file(GLOB LIB_SOURCES lib/*.c)
-target_link_libraries(fracture gsl c cblas lapack dl pthread cholmod amd colamd suitesparseconfig camd ccolamd rt metis m jst tcmalloc profiler)
-target_link_libraries(big_anal_process gsl c cblas lapack dl pthread cholmod amd colamd suitesparseconfig camd ccolamd rt metis m jst tcmalloc profiler)
-target_link_libraries(cen_anal_process gsl c cblas lapack dl pthread cholmod amd colamd suitesparseconfig camd ccolamd rt metis m jst tcmalloc profiler)
-target_link_libraries(long_anal_process gsl c cblas lapack dl pthread cholmod amd colamd suitesparseconfig camd ccolamd rt metis m jst tcmalloc profiler)
-target_link_libraries(corr_test gsl c cblas lapack dl pthread cholmod amd colamd suitesparseconfig camd ccolamd rt metis m jst tcmalloc profiler)
-target_link_libraries(anal_process gsl c cblas lapack dl pthread cholmod amd colamd suitesparseconfig camd ccolamd rt metis m jst tcmalloc profiler)
+add_library(fracture_stuff ${LIB_SOURCES})
+
+file(GLOB EXE_SOURCES src/*.c)
+
+foreach( src_file ${EXE_SOURCES} )
+ string( REGEX REPLACE ".*/src/(.*)\.c" "\\1" exe_name ${src_file} )
+ add_executable( ${exe_name} ${src_file} )
+ target_link_libraries(${exe_name} fracture_stuff gsl c cblas lapack dl pthread cholmod amd colamd suitesparseconfig camd ccolamd rt metis m jst tcmalloc profiler)
+endforeach( src_file ${EXE_SOURCES} )