-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
60 lines (43 loc) · 1.82 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
# ------------------------------------------------------------------------- #
# Application for the obsForge system #
# ------------------------------------------------------------------------- #
# Check for minimim cmake requirement
cmake_minimum_required( VERSION 3.20 FATAL_ERROR )
find_package(ecbuild 3.5 REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild)
project(obsForge VERSION 1.0.0 LANGUAGES C CXX Fortran )
# include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include(GNUInstallDirs)
enable_testing()
# Build type.
if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$")
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE
"Release"
CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif()
# Find dependencies.
find_package(Python3 REQUIRED COMPONENTS Interpreter)
# Include ecbuild_bundle macro
include( ecbuild_bundle )
# Enable MPI
set( ENABLE_MPI ON CACHE BOOL "Compile with MPI" )
#add_subdirectory( mains )
# Install utility scripts.
#add_subdirectory(ush)
# Include tools.
add_subdirectory(tools)
# Include testing.
add_subdirectory(test)
## Tests
ecbuild_add_test( TARGET ${PROJECT_NAME}_coding_norms
TYPE SCRIPT
COMMAND ${PROJECT_NAME}_py_lint.sh
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/sorc/spoc/dump/mapping ${CMAKE_CURRENT_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
set_tests_properties( ${PROJECT_NAME}_coding_norms PROPERTIES TIMEOUT 90 )
## Package Config
ecbuild_install_project( NAME ${PROJECT_NAME} )
ecbuild_print_summary()