CMakeLists.txt 1.28 KB
Newer Older
niklas.baumgarten's avatar
niklas.baumgarten committed
1
cmake_minimum_required(VERSION 3.5.1)
niklas.baumgarten's avatar
niklas.baumgarten committed
2
project(MLMC)
niklas.baumgarten's avatar
niklas.baumgarten committed
3

niklas.baumgarten's avatar
niklas.baumgarten committed
4
set(SPACE_DIM 2 CACHE STRING "SPACE_DIM")
5
set(USE_SPACETIME OFF CACHE STRING "USE_SPACETIME")
niklas.baumgarten's avatar
niklas.baumgarten committed
6
set(COMPILER_OPTIMIZE -O3 CACHE STRING "COMPILER_OPTIMIZE")
niklas.baumgarten's avatar
niklas.baumgarten committed
7
8
9
10
set(NO_DEPRECATED OFF CACHE STRING "NO_DEPRECATED")
set(AFFINE_LINEAR_TRAFO ON CACHE STRING "AFFINE_LINEAR_TRAFO")
set(BUILD_TESTS OFF CACHE STRING "BUILD_TESTS")
set(BUILD_MLMC_TESTS ON CACHE STRING "BUILD_MLMC_TESTS")
niklas.baumgarten's avatar
niklas.baumgarten committed
11
#---------------------------------------------------------------------------------------#
niklas.baumgarten's avatar
niklas.baumgarten committed
12

niklas.baumgarten's avatar
niklas.baumgarten committed
13
14
# include M++
include(mpp/CMakeLists.txt)
niklas.baumgarten's avatar
niklas.baumgarten committed
15

niklas.baumgarten's avatar
niklas.baumgarten committed
16
17
18
19
# Manage folder structure build folder
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/py)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/vtk)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/vtu)
niklas.baumgarten's avatar
niklas.baumgarten committed
20

niklas.baumgarten's avatar
niklas.baumgarten committed
21
# Link libraries
niklas.baumgarten's avatar
niklas.baumgarten committed
22
#find_package(FFTW3 REQUIRED)   (Can't be found but still seems to link in)
niklas.baumgarten's avatar
niklas.baumgarten committed
23
link_directories(${PROJECT_SOURCE_DIR}/sprng5/lib)
niklas.baumgarten's avatar
niklas.baumgarten committed
24

niklas.baumgarten's avatar
niklas.baumgarten committed
25
26
27
28
# Include directories
include_directories(${PROJECT_SOURCE_DIR}/sprng5/include)
include_directories(${PROJECT_SOURCE_DIR}/mlmc/src)

niklas.baumgarten's avatar
niklas.baumgarten committed
29
# Subdirectories
niklas.baumgarten's avatar
niklas.baumgarten committed
30
add_subdirectory(mlmc/src)
niklas.baumgarten's avatar
niklas.baumgarten committed
31

niklas.baumgarten's avatar
niklas.baumgarten committed
32
# Executables
niklas.baumgarten's avatar
niklas.baumgarten committed
33
add_executable(MLMC-M++ mlmc/src/Main.cpp)
niklas.baumgarten's avatar
niklas.baumgarten committed
34
35

# Linking
niklas.baumgarten's avatar
niklas.baumgarten committed
36
target_link_libraries(MLMC-M++ MONTECARLO)
niklas.baumgarten's avatar
niklas.baumgarten committed
37
38
39

# Tests
if (BUILD_MLMC_TESTS)
niklas.baumgarten's avatar
niklas.baumgarten committed
40
    include_directories(mlmc/tests/)
niklas.baumgarten's avatar
niklas.baumgarten committed
41
    add_subdirectory(mlmc/tests/)
niklas.baumgarten's avatar
niklas.baumgarten committed
42
endif ()
niklas.baumgarten's avatar
niklas.baumgarten committed
43
44
45
46
47