From 07906baa42470bad14d2c40f57967691f6118969 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Thu, 1 Nov 2018 12:33:37 -0400 Subject: revamped and simplied fracture code with c++ --- CMakeLists.txt | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'CMakeLists.txt') 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) -- cgit v1.2.3-54-g00ecf