-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
59 lines (49 loc) · 2.21 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
cmake_minimum_required (VERSION 2.8)
#-----------------------------------------------------------#
# Force MPI compilers
#-----------------------------------------------------------#
include(CMakeForceCompiler)
CMAKE_FORCE_CXX_COMPILER(mpicxx "MPI C++ Compiler")
CMAKE_FORCE_C_COMPILER(mpicc "MPI C Compiler")
include(CheckIncludeFileCXX)
#-----------------------------------------------------------#
# Starting project definition
#-----------------------------------------------------------#
project(OMNISCIO)
#-----------------------------------------------------------#
# EXTERNAL_ROOT is a variable set once and for all to
# indicate where are all the required libraries. By default
# CMake will look for libraries in this directory.
#-----------------------------------------------------------#
set(EXTERNAL_ROOT ~/local)
#-----------------------------------------------------------#
add_definitions (-g -Wall -rdynamic)
add_definitions (-Wextra -pedantic -Wno-long-long) # for development only
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
#-----------------------------------------------------------#
#-----------------------------------------------------------#
# Set the location of CMake Modules
#-----------------------------------------------------------#
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
"${OMNISCIO_SOURCE_DIR}/cmake/Modules/")
check_include_file_cxx(cxxabi.h HAVE_CXXABI)
if(HAVE_CXXABI)
add_definitions (-DHAVE_CXXABI)
endif(HAVE_CXXABI)
set(DEP_LIBRARIES dl)
#-----------------------------------------------------------#
include_directories(${OMNISCIO_SOURCE_DIR})
include_directories(${OMNISCIO_SOURCE_DIR}/include)
include_directories(${OMNISCIO_SOURCE_DIR}/src)
#-----------------------------------------------------------#
# Set subdirectories for the compilation process
#-----------------------------------------------------------#
add_subdirectory (lib)
add_subdirectory (test)
add_subdirectory (bin)
#-----------------------------------------------------------#
# Set the install files and directories
#-----------------------------------------------------------#
install(FILES "include/omniscio.h" DESTINATION include)
install(FILES "lib/libomniscio.a" DESTINATION lib)