-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
64 lines (51 loc) · 2.09 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
cmake_minimum_required(VERSION 3.10)
# Disable Building in Debug as HD5
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
IF(isMultiConfig)
set(CMAKE_CONFIGURATION_TYPES "Release" CACHE STRING "" FORCE)
MESSAGE("Multi-Config Generator found, please ensure you are building with a realease configuration")
ELSE()
if(NOT CMAKE_BUILD_TYPE)
message("Defaulting to release build.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "" FORCE)
ENDIF()
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY HELPSTRING "Choose the type of build")
# set the valid options for cmake-gui drop-down list
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Release")
ENDIF()
if(NOT DEFINED CPPDATAPIPELINEREF)
SET(CPPDATAPIPELINEREF "tags/v0.2.7")
endif()
# set the project name
project(cppSimpleModel
VERSION 0.2.4
DESCRIPTION "C++ Simple Model for the FAIR Data Pipeline"
HOMEPAGE_URL "https://github.com/FAIRDataPipeline/cppSimpleModel"
LANGUAGES CXX C
)
# Option to prevent FetchContent, and force usage of pre-installed library
option(
FDPAPI_NO_FETCHCONTENT
"If set, compilation will fail unless a pre-installed FDPAPI library is found"
OFF
)
set( CPPSIMPLEMODEL cppSimpleModel )
# Set Output Directories to avoid issues on multi release compilers
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif()
# Include External Project and GNUInstallDirs - For Installing Libries
INCLUDE( ExternalProject )
INCLUDE( GNUInstallDirs )
# Set C++ Standard to 17
SET( CMAKE_CXX_STANDARD 17 )
SET( CMAKE_CXX_STANDARD_REQUIRED ON )
# Set Include and Header Variables
SET( CPPSIMPLEMODEL_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include )
SET( CPPSIMPLEMODEL_HEADER ${FDPAPI_INCLUDE_DIRS}/simpleModel.hxx )
# Add the src dirctory compiling it's CMakeLists.txt
ADD_SUBDIRECTORY( src )