forked from robotology/icub-firmware-shared
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
98 lines (69 loc) · 4.1 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
94
95
96
97
98
# Copyright: (C) 2014 iCub Facility, Istituto Italiano di Tecnologia
# Authors: Daniele E. Domenichelli <[email protected]>
# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
cmake_minimum_required(VERSION 2.8.9)
project(icub_firmware_shared NONE)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
set(icub_firmware_shared_MAJOR_VERSION 4)
set(icub_firmware_shared_MINOR_VERSION 0)
set(icub_firmware_shared_PATCH_VERSION 5)
set(icub_firmware_shared_VERSION ${icub_firmware_shared_MAJOR_VERSION}.${icub_firmware_shared_MINOR_VERSION}.${icub_firmware_shared_PATCH_VERSION})
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
include(FeatureSummary)
set(icub_firmware_shared_CMAKE_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/icub_firmware_shared)
set(icub_firmware_shared_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/icub-firmware-shared)
option(WITH_CANPROTOCOLLIB "Enable canProtocolLib" ON)
add_feature_info(canProtocolLib WITH_CANPROTOCOLLIB "Can Protocol Library.")
option(WITH_EMBOBJ "Enable embobj" ON)
add_feature_info(embobj WITH_EMBOBJ "EmbObj Library.")
add_subdirectory(can)
add_subdirectory(eth)
feature_summary(WHAT ENABLED_FEATURES
DISABLED_FEATURES)
get_property(targets GLOBAL PROPERTY icub_firmware_shared_TARGETS)
set(path_vars)
foreach(target ${targets})
list(APPEND path_vars icub_firmware_shared_${target}_INCLUDE_DIR)
endforeach()
# icub_firmware_shared-config-version.cmake (build tree and installed) (use AnyNewerVersion or ExactVersion or SameMajorVersion)
write_basic_package_version_file(${CMAKE_BINARY_DIR}/icub_firmware_shared-config-version.cmake
VERSION ${icub_firmware_shared_VERSION}
COMPATIBILITY ExactVersion)
install(FILES ${CMAKE_BINARY_DIR}/icub_firmware_shared-config-version.cmake
DESTINATION ${icub_firmware_shared_CMAKE_DESTINATION})
# icub_firmware_shared-config.cmake (build tree)
foreach(target ${targets})
get_property(icub_firmware_shared_${target}_INCLUDE_DIR GLOBAL PROPERTY icub_firmware_shared_${target}_BUILD_INCLUDE_DIR)
get_filename_component(icub_firmware_shared_${target}_INCLUDE_DIR "${icub_firmware_shared_${target}_INCLUDE_DIR}" ABSOLUTE)
endforeach()
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/icub_firmware_shared-config.cmake.in
${CMAKE_BINARY_DIR}/icub_firmware_shared-config.cmake
INSTALL_DESTINATION ${CMAKE_BINARY_DIR}
PATH_VARS ${path_vars})
# icub_firmware_shared-config.cmake (installed)
foreach(target ${targets})
get_property(icub_firmware_shared_${target}_INCLUDE_DIR GLOBAL PROPERTY icub_firmware_shared_${target}_INSTALL_INCLUDE_DIR)
get_filename_component(icub_firmware_shared_${target}_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${icub_firmware_shared_${target}_INCLUDE_DIR}" ABSOLUTE)
endforeach()
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/icub_firmware_shared-config.cmake.in
${CMAKE_BINARY_DIR}/icub_firmware_shared-config.cmake.install
INSTALL_DESTINATION ${icub_firmware_shared_CMAKE_DESTINATION}
PATH_VARS ${path_vars})
install(FILES ${CMAKE_BINARY_DIR}/icub_firmware_shared-config.cmake.install
DESTINATION ${icub_firmware_shared_CMAKE_DESTINATION}
RENAME icub_firmware_shared-config.cmake)
# # icub_firmware_shared-targets.cmake (build tree)
# get_property(_targets GLOBAL PROPERTY icub_firmware_shared_TARGETS)
# export(TARGETS ${_targets} ${manager_extra_libs}
# NAMESPACE ICUB_fw::
# FILE ${CMAKE_BINARY_DIR}/icub_firmware_shared-targets.cmake)
# # icub_firmware_shared-targets.cmake (installed)
# install(EXPORT ICUB_fw
# NAMESPACE ICUB_fw::
# DESTINATION ${icub_firmware_shared_CMAKE_DESTINATION}
# FILE icub_firmware_shared-targets.cmake)
include(AddUninstallTarget)
set_property (CACHE CMAKE_INSTALL_PREFIX PROPERTY TYPE INTERNAL)
set_property (CACHE WITH_CANPROTOCOLLIB PROPERTY TYPE INTERNAL)
set_property (CACHE WITH_EMBOBJ PROPERTY TYPE INTERNAL)