forked from robotology/ycm-cmake-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
YCMConfig.cmake.in
103 lines (88 loc) · 3.68 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
91
92
93
94
95
96
97
98
99
100
101
102
103
#=============================================================================
# Copyright 2013-2014 Istituto Italiano di Tecnologia (IIT)
# Authors: Daniele E. Domenichelli <[email protected]>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of YCM, substitute the full
# License text for the above reference.)
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@")
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
option(YCM_USE_CMAKE_PROPOSED "Use modules including unmerged CMake patches" OFF)
mark_as_advanced(YCM_USE_CMAKE_PROPOSED)
if(YCM_USE_CMAKE_PROPOSED)
list(APPEND YCM_MODULE_PATH "${YCM_MODULE_DIR}/cmake-proposed/Modules")
endif()
option(YCM_USE_CMAKE_NEXT "Use modules from unreleased CMake" ON)
mark_as_advanced(YCM_USE_CMAKE_NEXT)
if(YCM_USE_CMAKE_NEXT)
list(APPEND YCM_MODULE_PATH "${YCM_MODULE_DIR}/cmake-next/Modules")
endif()
foreach(_version 3.11
3.10
3.9
3.8
3.7
3.6)
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})
option(YCM_USE_CMAKE_${_VERSION} "Use modules from CMake ${_version}" ON)
mark_as_advanced(YCM_USE_CMAKE_${_VERSION})
if(YCM_USE_CMAKE_${_VERSION})
list(APPEND YCM_MODULE_PATH "${YCM_MODULE_DIR}/cmake-${_version}/Modules")
endif()
endif()
endforeach()
if(EXISTS "${YCM_MODULE_DIR}/3rdparty")
option(YCM_USE_3RDPARTY "Use YCM 3rd party modules" ON)
mark_as_advanced(YCM_USE_3RDPARTY)
if(YCM_USE_3RDPARTY)
list(APPEND YCM_MODULE_PATH "${YCM_MODULE_DIR}/3rdparty")
endif()
endif()
set(YCM_NO_DEPRECATED 1)
if(EXISTS "${YCM_MODULE_DIR}/deprecated")
option(YCM_USE_DEPRECATED "Use YCM deprecated modules" ON)
mark_as_advanced(YCM_USE_DEPRECATED)
if(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_MODULE_DIR} (found version \"${YCM_VERSION}\")")
endif()