Skip to content

Add FIND_PACKAGE feature #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,7 @@ IF ( BUILD_CPACK )

ENDIF ( BUILD_CPACK )

# Create a cmake file for importing the project easily with cmake

CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/config.cmake.in" "${PROJECT_BINARY_DIR}/Find${PROJECT_NAME}.cmake" @ONLY)
INSTALL(FILES "${PROJECT_BINARY_DIR}/Find${PROJECT_NAME}.cmake" DESTINATION lib/cmake/ )
72 changes: 72 additions & 0 deletions config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
###############################################################################
# License
###############################################################################

# This file is part of the OpenKinect Project. http://www.openkinect.org
#
# Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
# for details.
#
# This code is licensed to you under the terms of the Apache License, version
# 2.0, or, at your option, the terms of the GNU General Public License,
# version 2.0. See the APACHE20 and GPL2 files for the text of the licenses,
# or the following URLs:
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.gnu.org/licenses/gpl-2.0.txt
#
# If you redistribute this file in source form, modified or unmodified, you
# may:
# 1) Leave this header intact and distribute it under the same terms,
# accompanying it with the APACHE20 and GPL20 files, or
# 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or
# 3) Delete the GPL v2 clause and accompany it with the APACHE20 file
# In all cases you must keep the copyright notice intact and include a copy
# of the CONTRIB file.
#
# Binary distributions must follow the binary distribution requirements of
# either License.

# =========================================================================
# @PROJECT_NAME@ CMake configuration file
#
# ** File generated automatically, do not modify **
#
# Usage from an external project:
# In your CMakeLists.txt, add these lines:
#
# FIND_PACKAGE(@PROJECT_NAME@ REQUIRED )
# TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${@PROJECT_NAME@_LIBS})
#
# This file will define the following variables:
# - @PROJECT_NAME@_FOUND : Indicates if the library has been found.
# - @PROJECT_NAME@_sync_FOUND : Indicates if the library has been found.
# - @PROJECT_NAME@_LIBS : The list of libraries to links against.
# - @PROJECT_NAME@_sync_LIBS : The list of libraries to links against.
# - @PROJECT_NAME@_LIB_DIR : The directory where lib files are.
# Calling LINK_DIRECTORIES with this path is NOT needed.
# - @PROJECT_NAME@_VERSION : The version of @PROJECT_NAME@. Example: "1.2.3"
# - @PROJECT_NAME@_VERSION_MAJOR : Major version part of @PROJECT_NAME@_VERSION. Example: "1"
# - @PROJECT_NAME@_VERSION_MINOR : Minor version part of @PROJECT_NAME@_VERSION. Example: "2"
# - @PROJECT_NAME@_VERSION_PATCH : Patch version part of @PROJECT_NAME@_VERSION. Example: "3"
#
# =========================================================================
INCLUDE_DIRECTORIES(@CMAKE_INSTALL_PREFIX@/@PROJECT_INCLUDE_INSTALL_DIR@)
LINK_DIRECTORIES("@CMAKE_INSTALL_PREFIX@/@PROJECT_LIBRARY_INSTALL_DIR@")
SET(@PROJECT_NAME@_LIB_DIR "@CMAKE_INSTALL_PREFIX@/@PROJECT_LIBRARY_INSTALL_DIR")
SET(@PROJECT_NAME@_FOUND ON)
SET(@PROJECT_NAME@_sync_FOUND @BUILD_C_SYNC@)

SET (@PROJECT_NAME@_LIBS "")
FOREACH(__LIB freenect)
SET(@PROJECT_NAME@_LIBS ${@PROJECT_NAME@_LIBS} ${__LIB})
ENDFOREACH(__LIB)

SET (@PROJECT_NAME@_sync_LIBS "")
FOREACH(__LIB freenect_sync)
SET(@PROJECT_NAME@_sync_LIBS ${@PROJECT_NAME@_LIBS} ${__LIB})
ENDFOREACH(__LIB)

SET(@PROJECT_NAME@_VERSION @PROJECT_VER@)
SET(@PROJECT_NAME@_VERSION_MAJOR @PROJECT_VER_MAJOR@)
SET(@PROJECT_NAME@_VERSION_MINOR @PROJECT_VER_MINOR@)
SET(@PROJECT_NAME@_VERSION_PATCH @PROJECT_VER_PATCH@)