-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
59 lines (43 loc) · 1.9 KB
/
CMakeLists.txt
File metadata and controls
59 lines (43 loc) · 1.9 KB
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
cmake_minimum_required(VERSION 3.21)
project(
carma
VERSION 4.0.0
LANGUAGES Fortran CXX C
)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${PROJECT_SOURCE_DIR}/cmake")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)
message ( STATUS "CMake build configuration for carma(${CMAKE_BUILD_TYPE}) ${PROJECT_VERSION}" )
################################################################################
# Project wide setup options
option(CARMA_ENABLE_MEMCHECK "Enable memory checking in tests" OFF)
option(CARMA_ENABLE_NETCDF "Enable NetCDF support" ON)
set(CARMA_MOD_DIR "${PROJECT_BINARY_DIR}/include" CACHE PATH "Directory to find Fortran module files during build")
set(CARMA_INSTALL_MOD_DIR "${INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}" CACHE PATH "Directory to install Fortran module files")
set(CARMA_INSTALL_INCLUDE_DIR "${INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}" CACHE PATH "Directory to install CARMA include files")
# Set up include and lib directories
set(CARMA_LIB_DIR "${PROJECT_BINARY_DIR}/lib")
include(GNUInstallDirs)
set(INSTALL_PREFIX "carma-${PROJECT_VERSION}")
################################################################################
# Dependencies
include(cmake/dependencies.cmake)
################################################################################
# CAMRA targets
add_subdirectory(source)
################################################################################
# Packaging
# Only include pacakaging if we are the top-level project
if(PROJECT_IS_TOP_LEVEL)
add_subdirectory(packaging)
endif()
################################################################################
# Tests
if(PROJECT_IS_TOP_LEVEL)
enable_testing()
add_subdirectory(tests)
endif()