forked from demianmnave/CML1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
61 lines (50 loc) · 1.83 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
#
# Copyright Barco N.V. All Rights Reserved.
#
message(STATUS "\n-- || Processing cml - starting")
cmake_minimum_required( VERSION 3.14 )
project( cml VERSION 1.0.3 )
########################################################################
# cml header only library
########################################################################
add_library(cml INTERFACE)
add_library(cml::cml ALIAS cml )
target_include_directories(cml SYSTEM INTERFACE # TODO_MADAU: is SYSTEM needed
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
)
########################################################################
# Installation
########################################################################
include(GNUInstallDirs) # provides CMAKE_INSTALL_{INCLUDE|LIB|BIN}DIR variables
include(CMakePackageConfigHelpers) # provides write_basic_package_version_file()
#### Copy header files ####
install(DIRECTORY cml
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.h"
)
### cmake files ###
# Create cmlConfigVersion.cmake
set( version_config "${CMAKE_CURRENT_BINARY_DIR}/cmlConfigVersion.cmake" )
write_basic_package_version_file( "${version_config}"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion )
# Create cmlTargets.cmake
install( TARGETS cml
EXPORT cmlConfigTargets
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cml )
export( TARGETS cml NAMESPACE cml:: FILE cmlTargets.cmake )
# Install files
if( WIN32 AND NOT CYGWIN)
set( CONFIG_LOC CMake )
else( )
set( CONFIG_LOC "${CMAKE_INSTALL_LIBDIR}/cmake/cml" )
endif( )
install( EXPORT cmlConfigTargets
FILE cmlTargets.cmake
NAMESPACE cml::
DESTINATION ${CONFIG_LOC} )
install (
FILES CMake/cmlConfig.cmake "${version_config}"
DESTINATION ${CONFIG_LOC})
message(STATUS "|| Processing project cml - finished\n")