summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
1 files changed, 8 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e924e98..6746aa9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,20 +1,14 @@
-cmake_minimum_required(VERSION 3.5)
-project(fracture)
+cmake_minimum_required(VERSION 3.9)
-include_directories(src ~/.local/include /usr/include/suitesparse)
-link_directories(~/.local/lib)
+set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall")
+set(CMAKE_CXX_FLAGS_RELEASE "-O3 -flto")
-file(GLOB LIB_SOURCES lib/*.c)
+set (CMAKE_CXX_STANDARD 17)
+set (CMAKE_C_STANDARD 11)
-add_library(fracture_stuff ${LIB_SOURCES})
+include(GNUInstallDirs)
-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 fftw3 m jst)
- install(TARGETS ${exe_name} DESTINATION bin)
-endforeach( src_file ${EXE_SOURCES} )
+add_subdirectory(lib)
+add_subdirectory(src)