forked from plstcharles/litiv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlitiv-config.cmake.in
128 lines (121 loc) · 5.98 KB
/
litiv-config.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# This file is part of the LITIV framework; visit the original repository at
# https://github.com/plstcharles/litiv for more information.
#
# Copyright 2016 Pierre-Luc St-Charles; pierre-luc.st-charles<at>polymtl.ca
#
# 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.
#
# ---------------------------------------------------------------------------
#
# LITIV Framework CMake Configuration File
# (this file is generated automatically, any modification will be lost)
#
# To use in an external project, add these lines to your 'CMakeLists.txt' file:
#
# find_package(litiv REQUIRED)
# include_directories(${LITIV_EXT_INCLUDE_DIRS}) # not needed if external headers can already be located by the toolchain
# target_link_libraries(<YOUR_TARGET_NAME> litiv_world) # ...or a more specific submodule/target of the framework, as needed
#
# ...and set 'litiv_DIR' during configuration to the LITIV build output or installation directory. If one or more required external
# dependency cannot be found, the 'find_package(litiv ...)' call will fail, and print some information on the missing component.
#
# This file will define the following variables (starred variables are marked as advanced):
# * LITIV_RUNTIME_DIRS : Directory(ies) where executables and DLLs are located; typically not needed by CMake projects
# * LITIV_INCLUDE_DIRS : Directory(ies) where headers are located; typically not needed by CMake projects
# * LITIV_LIBRARY_DIRS : Directory(ies) where libraries are located; typically not needed by CMake projects
# * LITIV_MODULES_DIRS : Directory(ies) where cmake modules are located; automatically added to CMAKE_MODULE_PATH
# * LITIV_CONFIG_DIRS : Directory(ies) where config/model files; typically not needed by CMake projects
# LITIV_EXT_INCLUDE_DIRS : Directories where headers for external dependencies are located
# * LITIV_COMPONENTS : List of all built framework components which can be used externally
# * LITIV_VERSION : Dot-separated version number of this LITIV build ("@LITIV_VERSION@")
# * LITIV_VERSION_MAJOR : Major version part of LITIV_VERSION (@LITIV_VERSION_MAJOR@)
# * LITIV_VERSION_MINOR : Minor version part of LITIV_VERSION (@LITIV_VERSION_MINOR@)
# * LITIV_VERSION_PATCH : Patch version part of LITIV_VERSION (@LITIV_VERSION_PATCH@)
# * LITIV_VERSION_SHA1 : Git SHA1 of the HEAD commit of this LITIV build
# * LITIV_SHARED : Defines whether the LITIV framework modules are built as shared libraries or not
# * LITIV_INSTALLED : Defines whether this script is located alongside the install or build directory
#
# ---------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
set(LITIV_VERSION "@LITIV_VERSION@")
set(LITIV_VERSION_MAJOR @LITIV_VERSION_MAJOR@)
set(LITIV_VERSION_MINOR @LITIV_VERSION_MINOR@)
set(LITIV_VERSION_PATCH @LITIV_VERSION_PATCH@)
set(LITIV_VERSION_SHA1 "@GIT_SHA1@")
set(LITIV_SHARED @BUILD_SHARED_LIBS@)
set(LITIV_INSTALLED @CURRENT_CONFIG_INSTALL@)
@PACKAGE_INIT@
if(LITIV_INSTALLED)
set_and_check(LITIV_RUNTIME_DIRS "@PACKAGE_RUNTIME_INSTALL_DIR@")
set_and_check(LITIV_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(LITIV_LIBRARY_DIRS "@PACKAGE_LIBRARY_INSTALL_DIR@")
set_and_check(LITIV_MODULES_DIRS "@PACKAGE_MODULES_INSTALL_DIR@")
#set_and_check(LITIV_CONFIG_DIRS "@PACKAGE_CONFIG_INSTALL_DIR@")
else()
set(LITIV_RUNTIME_DIRS "@LITIV_BUILD_RUNTIME_DIR@")
set(LITIV_INCLUDE_DIRS "@LITIV_BUILD_INCLUDE_DIRS@")
set(LITIV_LIBRARY_DIRS "@LITIV_BUILD_LIBRARY_DIR@")
set(LITIV_MODULES_DIRS "@LITIV_BUILD_MODULES_DIR@")
#set(LITIV_CONFIG_DIRS "@LITIV_BUILD_CONFIG_DIR@")
endif()
list(APPEND CMAKE_MODULE_PATH "${LITIV_MODULES_DIRS}")
set(LITIV_COMPONENTS "@LITIV_COMPONENTS@")
include(CMakeFindDependencyMacro)
set(LITIV_EXT_INCLUDE_DIRS "")
message(STATUS "LITIV Framework searching for OpenCV >=3.0 dependency...")
find_dependency(OpenCV 3.0)
if(@USE_GLSL@)
message(STATUS "LITIV Framework searching for OpenGL dependencies...")
find_dependency(OpenGL)
list(APPEND LITIV_EXT_INCLUDE_DIRS "${OpenGL_INCLUDE_DIRS}")
find_dependency(GLEW)
list(APPEND LITIV_EXT_INCLUDE_DIRS "${GLEW_INCLUDE_DIRS}")
find_dependency(GLM)
list(APPEND LITIV_EXT_INCLUDE_DIRS "${GLM_INCLUDE_DIRS}")
if(@USE_GLFW@)
find_dependency(GLFW)
list(APPEND LITIV_EXT_INCLUDE_DIRS "${GLFW_INCLUDE_DIR}")
elseif(@USE_FREEGLUT@)
find_dependency(FREEGLUT)
list(APPEND LITIV_EXT_INCLUDE_DIRS "${FREEGLUT_INCLUDE_DIR}")
endif()
endif()
if(@USE_OPENGM@)
message(STATUS "LITIV Framework searching for OpenGM dependency with external lib...")
find_package(OpenGM REQUIRED COMPONENTS ext) # not using find_dependency due to component here
endif()
if(WIN32)
if(@USE_KINECTSDK@)
message(STATUS "LITIV Framework searching for KinectSDK2 dependency...")
find_dependency(KinectSDK2)
list(APPEND LITIV_EXT_INCLUDE_DIRS "${KinectSDK2_INCLUDE_DIRS}")
endif()
endif()
include("${CMAKE_CURRENT_LIST_DIR}/litiv-targets.cmake")
if(LITIV_INSTALLED)
check_required_components(litiv)
endif()
mark_as_advanced(
LITIV_RUNTIME_DIRS
LITIV_INCLUDE_DIRS
LITIV_LIBRARY_DIRS
LITIV_MODULES_DIRS
#LITIV_CONFIG_DIRS
LITIV_COMPONENTS
LITIV_VERSION
LITIV_VERSION_MAJOR
LITIV_VERSION_MINOR
LITIV_VERSION_PATCH
LITIV_VERSION_SHA1
LITIV_SHARED
LITIV_INSTALLED
)