forked from NOAA-EMC/NCEPLIBS-w3nco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
32 lines (24 loc) · 850 Bytes
/
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
cmake_minimum_required(VERSION 3.15)
file(STRINGS "VERSION" pVersion)
project(
w3nco
VERSION ${pVersion}
LANGUAGES C Fortran)
include(GNUInstallDirs)
option(ENABLE_TESTS "Build pfunit tests?" OFF)
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()
if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Intel|GNU|Clang|AppleClang)$")
message(WARNING "Compiler not officially supported: ${CMAKE_C_COMPILER_ID}")
endif()
add_subdirectory(src)
if(ENABLE_TESTS)
find_package(PFUNIT REQUIRED)
enable_testing()
add_subdirectory(tests)
endif()