summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2017-06-07 14:58:29 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2017-06-07 14:58:29 -0400
commit8044c18f84b6d8e60e89637bccc9ee5771f43624 (patch)
tree2bd70148e55160b4b52ea95acf2948aac9d540ea
parent0226188f6a3149ba28b4df004bb904b21d9477be (diff)
downloadfuse_networks-8044c18f84b6d8e60e89637bccc9ee5771f43624.tar.gz
fuse_networks-8044c18f84b6d8e60e89637bccc9ee5771f43624.tar.bz2
fuse_networks-8044c18f84b6d8e60e89637bccc9ee5771f43624.zip
make the cmake file more sensible
-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} )