Commit aaa9dcc7 authored by Patrik Huber's avatar Patrik Huber

Added eos-config, -config-version and -targets CMake scripts so that the...

Added eos-config, -config-version and -targets CMake scripts so that the library can be included by other CMake projects
parent 8cfb4b8b
...@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 2.8.7) ...@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 2.8.7)
set(eos_VERSION_MAJOR 0) set(eos_VERSION_MAJOR 0)
set(eos_VERSION_MINOR 1) set(eos_VERSION_MINOR 1)
set(eos_VERSION_PATCH 0) set(eos_VERSION_PATCH 0)
set(eos_VERSION ${eos_VERSION_MAJOR}.${eos_VERSION_MINOR}.${eos_VERSION_PATCH})
# g++ needs a compiler flag to enable C++11 support # g++ needs a compiler flag to enable C++11 support
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
...@@ -71,9 +72,15 @@ add_library(eos ${SOURCES} ${HEADERS}) ...@@ -71,9 +72,15 @@ add_library(eos ${SOURCES} ${HEADERS})
target_link_libraries(eos ${OpenCV_LIBS} ${Boost_LIBRARIES}) target_link_libraries(eos ${OpenCV_LIBS} ${Boost_LIBRARIES})
# The install target: # The install target:
install(TARGETS eos DESTINATION lib) install(TARGETS eos DESTINATION ${CMAKE_INSTALL_PREFIX}/lib EXPORT eos-targets)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include) install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/share/ DESTINATION share) install(DIRECTORY ${CMAKE_SOURCE_DIR}/share/ DESTINATION ${CMAKE_INSTALL_PREFIX}/share)
# Export the target:
install(EXPORT eos-targets DESTINATION ${CMAKE_INSTALL_PREFIX}/) # creates eos-targets.cmake
install(FILES eos-config.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/)
configure_file(eos-config-version.cmake.in "${PROJECT_BINARY_DIR}/eos-config-version.cmake" @ONLY)
install(FILES "${PROJECT_BINARY_DIR}/eos-config-version.cmake" DESTINATION ${CMAKE_INSTALL_PREFIX}/)
if(BUILD_EXAMPLES) if(BUILD_EXAMPLES)
add_subdirectory(examples) add_subdirectory(examples)
......
set(PACKAGE_VERSION "@eos_VERSION@")
# Check whether the requested PACKAGE_FIND_VERSION is compatible:
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
# CMake config file for the eos library
# -------------------------------------
# It defines the following variables:
# eos_INCLUDE_DIRS - the eos include directory
# and the target 'eos' to link against.
# Get the absolute path of this file:
get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(eos_INCLUDE_DIRS "${SELF_DIR}/include")
# Defines our library target and its dependencies:
include(${SELF_DIR}/eos-targets.cmake)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment