forked from bmwcarit/capu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·93 lines (81 loc) · 3.57 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#
# Copyright (C) 2012 BMW Car IT GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
#set default install prefix to stay backward compatible with version 0.13.0
IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET (CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/deliverable/${TARGET_OS}_${TARGET_ARCH}/${CMAKE_BUILD_TYPE} CACHE STRING "Default CAPU CMake install prefix" FORCE)
ENDIF()
SET(ACMEPLUGIN_LINUX_TESTCOVERAGE_TESTCOMMAND LD_LIBRARY_PATH=../DynamicTestLibrary && ${CMAKE_CTEST_COMMAND};--target test -V CACHE STRING "")
SET(CMAKE_MODULE_PATH
${CMAKE_INSTALL_PREFIX}/lib/cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules
${CMAKE_CURRENT_SOURCE_DIR}/cmake/acme2
)
FIND_PACKAGE(ACME2)
# custom setup for integrating gtest & gmock
set(gtest_force_shared_crt true CACHE BOOL "Must be enabled for linking our unit tests" FORCE)
IF(Capu_BUILD_TESTS AND NOT TARGET gmock)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/external/gmock)
ENDIF()
ACME2_PROJECT(
#==========================================================================
# project metadata
#==========================================================================
NAME Capu
VERSION_MAJOR 0
VERSION_MINOR 16
VERSION_PATCH 0
DESCRIPTION "Collections and Platform Utils"
EMAIL "[email protected]"
COMPANY "BMW Car IT GmbH"
#==========================================================================
# documentation files, will be installed and packaged
#==========================================================================
FILES_DOCUMENTATION README.md
LICENSE.txt
#==========================================================================
# project content
#==========================================================================
CONTENT ./Capu
./DynamicTestLibrary
./Capu_Test
)
#==============================================================================
# generate and install PkgConfig file
#==============================================================================
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/Capu.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/Capu.pc"
@ONLY
)
INSTALL(
FILES ${CMAKE_CURRENT_BINARY_DIR}/Capu.pc
DESTINATION ${PROJECT_INSTALL_STATIC_LIB}/pkgconfig
)
ACME_INFO("G Capu.pc")
#==============================================================================
# generate and install CMake Find Module file
#==============================================================================
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/FindCapu.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/FindCapu.cmake"
@ONLY
)
INSTALL(
FILES ${CMAKE_CURRENT_BINARY_DIR}/FindCapu.cmake
DESTINATION ${PROJECT_INSTALL_STATIC_LIB}/cmake
)
ACME_INFO("G FindCapu.cmake")