forked from robotology/ycm-cmake-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
YCMConfig.cmake.in
90 lines (72 loc) · 2.97 KB
/
YCMConfig.cmake.in
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
# SPDX-FileCopyrightText: 2012-2021 Istituto Italiano di Tecnologia (IIT)
# SPDX-License-Identifier: BSD-3-Clause
set(YCM_VERSION @YCM_VERSION@)
set(YCM_VERSION_MAJOR @YCM_VERSION_MAJOR@)
set(YCM_VERSION_MINOR @YCM_VERSION_MINOR@)
set(YCM_VERSION_PATCH @YCM_VERSION_PATCH@)
set(YCM_VERSION_REVISION @YCM_VERSION_REVISION@)
set(YCM_VERSION_DATE @YCM_VERSION_DATE@)
set(YCM_VERSION_DATE_REVISION @YCM_VERSION_DATE_REVISION@)
set(YCM_VERSION_API @YCM_VERSION_API@)
set(YCM_VERSION_SHORT @YCM_VERSION_SHORT@)
set(YCM_VERSION_SOURCE @YCM_VERSION_SOURCE@)
set(YCM_VERSION_DIRTY @YCM_VERSION_DIRTY@)
@PACKAGE_INIT@
set_and_check(YCM_MODULE_DIR "@PACKAGE_YCM_MODULE_DIR@")
unset(YCM_MODULE_PATH)
list(APPEND YCM_MODULE_PATH "${YCM_MODULE_DIR}/modules")
list(APPEND YCM_MODULE_PATH "${YCM_MODULE_DIR}/find-modules")
list(APPEND YCM_MODULE_PATH "${YCM_MODULE_DIR}/build-modules")
list(APPEND YCM_MODULE_PATH "${YCM_MODULE_DIR}/style-modules")
# "Newer modules should be found earlier in case of files with the same name,
# therefore the order is
# - proposed
# - next
# - old releases (newer releases first)
# - 3rd party
# - deprecated
# Use modules from CMake (default ON)
if(NOT DEFINED YCM_USE_CMAKE OR YCM_USE_CMAKE)
# Use modules including unmerged CMake patches (default OFF)
if(YCM_USE_CMAKE_PROPOSED)
list(APPEND YCM_MODULE_PATH "${YCM_MODULE_DIR}/cmake-proposed/Modules")
endif()
# Use modules from unreleased CMake (default ON)
if(NOT DEFINED YCM_USE_CMAKE_NEXT OR YCM_USE_CMAKE_NEXT)
list(APPEND YCM_MODULE_PATH "${YCM_MODULE_DIR}/cmake-next/Modules")
endif()
# Use modules from specific CMake versions (default ON)
foreach(_version 3.15
3.14
3.13)
if(EXISTS "${YCM_MODULE_DIR}/cmake-${_version}"
AND CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS ${_version}
AND CMAKE_VERSION VERSION_LESS ${_version})
string(REPLACE "." "_" _VERSION ${_version})
if(NOT DEFINED YCM_USE_CMAKE_${_VERSION} OR YCM_USE_CMAKE_${_VERSION})
list(APPEND YCM_MODULE_PATH "${YCM_MODULE_DIR}/cmake-${_version}/Modules")
endif()
endif()
endforeach()
endif()
# Use YCM 3rd party modules (default ON)
if(EXISTS "${YCM_MODULE_DIR}/3rdparty")
if(NOT DEFINED YCM_USE_3RDPARTY OR YCM_USE_3RDPARTY)
list(APPEND YCM_MODULE_PATH "${YCM_MODULE_DIR}/3rdparty")
endif()
endif()
# Use YCM deprecated modules (default ON)
if(EXISTS "${YCM_MODULE_DIR}/deprecated")
if(NOT DEFINED YCM_USE_DEPRECATED OR YCM_USE_DEPRECATED)
list(APPEND YCM_MODULE_PATH "${YCM_MODULE_DIR}/deprecated")
set(YCM_NO_DEPRECATED 0)
endif()
endif()
list(APPEND CMAKE_MODULE_PATH "${YCM_MODULE_PATH}")
if(COMMAND set_package_properties)
set_package_properties(YCM PROPERTIES DESCRIPTION "A collection of CMake modules and utilities for YARP and friends"
URL "https://github.com/robotology/ycm")
endif()
if(NOT YCM_FIND_QUIETLY)
message(STATUS "Found YCM: ${YCM_DIR} (found version \"${YCM_VERSION}\")")
endif()