-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (35 loc) · 1.58 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# The name of our project is "SW4". CMakeLists files in this project can
# refer to the root source directory of the project as ${SW4_SOURCE_DIR} and
# to the root binary directory of the project as ${SW4_BINARY_DIR}.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(VQRS)
# Check validity of different flags
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(-O0 COMPILER_SUPPORTS_OPT0_FLAG)
CHECK_CXX_COMPILER_FLAG(-O3 COMPILER_SUPPORTS_OPT3_FLAG)
CHECK_CXX_COMPILER_FLAG(-g COMPILER_SUPPORTS_DEBUG_FLAG)
# Define debug vs release compiler flags
IF(COMPILER_SUPPORTS_OPT0_FLAG)
SET(DEBUG_FLAGS "${DEBUG_FLAGS} -O0")
ENDIF(COMPILER_SUPPORTS_OPT0_FLAG)
IF(COMPILER_SUPPORTS_OPT3_FLAG)
SET(RELEASE_FLAGS "${RELEASE_FLAGS} -O3")
SET(RELWITHDEBINFO_FLAGS "${RELWITHDEBINFO_FLAGS} -O3")
ENDIF(COMPILER_SUPPORTS_OPT3_FLAG)
IF(COMPILER_SUPPORTS_DEBUG_FLAG)
SET(DEBUG_FLAGS "${DEBUG_FLAGS} -g")
SET(RELWITHDEBINFO_FLAGS "${RELWITHDEBINFO_FLAGS} -g")
ENDIF(COMPILER_SUPPORTS_DEBUG_FLAG)
SET(CMAKE_CXX_FLAGS_DEBUG ${DEBUG_FLAGS})
SET(CMAKE_CXX_FLAGS_RELEASE ${RELEASE_FLAGS})
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO ${RELWITHDEBINFO_FLAGS})
# Define source files
SET(VQRS_SRC_C_FILES Equations.cpp RateState.cpp Solver.cpp Spline.cpp main.cpp
Equations.h RateState.h Solver.h Spline.h)
FIND_LIBRARY(CVODE_LIB sundials_cvode)
FIND_LIBRARY(CVODE_NVEC_LIB sundials_nvecserial)
FIND_LIBRARY(GSL_LIB gsl)
FIND_PATH(CVODE_INC "cvode/cvode.h")
INCLUDE_DIRECTORIES(${CVODE_INC})
ADD_EXECUTABLE(vqrs ${VQRS_SRC_C_FILES})
TARGET_LINK_LIBRARIES(vqrs ${CVODE_LIB} ${CVODE_NVEC_LIB} ${GSL_LIB})