-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
91 lines (74 loc) · 2.33 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
cmake_minimum_required(VERSION 2.8)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(ConfigSafeGuards)
project(Example)
enable_language(CXX)
set (PROJECT_VERSION_MAJOR 0)
set (PROJECT_VERSION_MINOR 0)
set (PROJECT_VERSION_PATCH 0)
option(ENABLE_TESTS "Enable test suite" ON)
option(ENABLE_BLAS "Use BLAS backend for linear algebra" ON)
option(ENABLE_MPI "Enable MPI parallelization" OFF)
option(ENABLE_OPENMP "Enable OpenMP parallelization" OFF)
option(ENABLE_CODE_COVERAGE "Compile with code coverage turned on" OFF)
include(ConfigProjectVersion)
include(ConfigSafeGuards)
include(UseGlobalBuildTree)
include(ConfigCompilerFlags)
#set (NETCDF_CXX YES)
#set(Boost_USE_MULTITHREADED OFF)
#find_package(Python REQUIRED)
#find_package(Eigen3)
#find_package(Boost REQUIRED serialization)
#find_package(HDF5 COMPONENTS CXX)
#find_package(NetCDF)
if (ENABLE_MPI)
find_package(MPI)
if (MPI_FOUND)
#find_package(Boost REQUIRED mpi)
set(HAVE_MPI TRUE)
include_directories(${MPI_INCLUDE_PATH})
endif()
endif ()
if (ENABLE_OPENMP)
find_package(OpenMP)
if (OPENMP_FOUND)
set(HAVE_OPENMP TRUE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
endif ()
if (ENABLE_BLAS)
if (BLAS_TYPE)
find_package(BLAS COMPONENTS "${BLAS_TYPE}")
else()
find_package(BLAS)
endif()
endif ()
#add_definitions(-DTHIS_IS_CMAKE_BUILD)
add_subdirectory(src)
if (ENABLE_TESTS)
set (PROJECT_REPOSITORY "https://git.example.com/example")
include(ConfigTesting)
add_subdirectory(test)
endif()
include(ConfigGitRevision)
configure_file (
${PROJECT_SOURCE_DIR}/config.h.in
${PROJECT_BINARY_DIR}/config.h
)
#find_package(Doxygen)
#find_package(Sphinx)
#if (DOXYGEN_FOUND OR SPHINX_FOUND)
# add_subdirectory(Documentation EXCLUDE_FROM_ALL)
#endif()
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "")
set(CPACK_PACKAGE_VENDOR "")
set(CPACK_PACKAGE_CONTACT "")
set(CPACK_PACKAGE_EXECUTABLES "" "Description")
set(CPACK_PACKAGE_URL "http://example.com")
set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/INSTALL.rst)
set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_SOURCE_DIR}/README.rst)
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/COPYING)
set(CPACK_GENERATOR TGZ DEB RPM)
include(ConfigPackaging)
# vim:ft=cmake