-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
40 lines (32 loc) · 1.37 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
PROJECT(pdriver)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# set C++11 standard
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
find_package(MPI REQUIRED)
include_directories(${MPI_INCLUDE_PATH})
# --------------------------------------------------------------------------- #
# force GNU linker to inlude all shared libraries
if (NOT APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-as-needed")
else ()
set(CMAKE_MACOSX_RPATH ON)
endif ()
message(${CMAKE_SOURCE_DIR})
set(p4est_home ${CMAKE_SOURCE_DIR}/3PL/p4est CACHE PATH "p4est home directory location")
set(p4est_dir ${CMAKE_SOURCE_DIR}/3PL/p4est/local CACHE PATH "p4est install directory location")
# ======================================= #
# Library header files to be included
include_directories(${p4est_dir}/include
${p4est_home}/example/multi)
# Libraries to be linked
find_library(p4est_lb NAMES p4est PATHS ${p4est_dir}/lib)
find_library(sc_lb NAMES sc PATHS ${p4est_dir}/lib)
# ======================================= #
# ======================================= #
# Source directories for this project
add_subdirectory(solver)
add_subdirectory(src)
# ======================================= #