source: pacpussensors/trunk/Vislab/lib3dv-1.2.0/CMakeLists.txt@ 137

Last change on this file since 137 was 136, checked in by ldecherf, 8 years ago

Doc

File size: 2.4 KB
Line 
1cmake_minimum_required(VERSION 2.8)
2
3project(lib3dv)
4
5set(PACKAGE_NAME "lib3dv")
6set(PACKAGE_VERSION_MAJOR 1)
7set(PACKAGE_VERSION_MINOR 2)
8set(PACKAGE_VERSION_PATCH 0)
9
10set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
11
12# install locations definition
13
14if(NOT INCLUDE_INSTALL_DIR)
15 set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/${PACKAGE_NAME})
16endif()
17
18if(NOT LIBRARY_INSTALL_DIR)
19 set(LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib)
20endif()
21
22if(NOT BINARY_INSTALL_DIR)
23 set(BINARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin)
24endif()
25
26if(NOT DOCUMENTATION_INSTALL_DIR)
27 if(WIN32)
28 set(DOCUMENTATION_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/doc)
29 else()
30 set(DOCUMENTATION_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/doc/${PACKAGE_NAME})
31 endif()
32endif()
33
34if(NOT MODULES_INSTALL_DIR)
35 if(WIN32)
36 set(MODULES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/cmake)
37 else()
38 set(MODULES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/${PACKAGE_NAME})
39 endif()
40endif()
41
42# Make relative paths absolute (needed later on)
43foreach(p LIBRARY BINARY INCLUDE MODULES)
44 set(var ${p}_INSTALL_DIR)
45 if(NOT IS_ABSOLUTE "${${var}}")
46 set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
47 endif()
48endforeach()
49
50add_subdirectory(doc)
51add_subdirectory(lib3dv)
52
53# Export the package for use from the build-tree
54# (this registers the build-tree with a global CMake-registry)
55export(PACKAGE Lib3DV)
56
57# Create the Lib3DVConfig.cmake and Lib3DVConfigVersion files
58file(RELATIVE_PATH REL_INCLUDE_DIR "${MODULES_INSTALL_DIR}" "${INCLUDE_INSTALL_DIR}")
59# ... for the build tree
60set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")
61configure_file(cmake/Lib3DVConfig.cmake.in "${PROJECT_BINARY_DIR}/Lib3DVConfig.cmake" @ONLY)
62# ... for the install tree
63set(CONF_INCLUDE_DIRS "\${LIB3DV_CMAKE_DIR}/${REL_INCLUDE_DIR}/..")
64configure_file(cmake/Lib3DVConfig.cmake.in "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Lib3DVConfig.cmake" @ONLY)
65# ... for both
66configure_file(cmake/Lib3DVConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/Lib3DVConfigVersion.cmake" @ONLY)
67
68# Install the Lib3DVConfig.cmake and Lib3DVConfigVersion.cmake
69install(FILES "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Lib3DVConfig.cmake" "${PROJECT_BINARY_DIR}/Lib3DVConfigVersion.cmake" DESTINATION "${MODULES_INSTALL_DIR}" COMPONENT dev)
70
71# Install the export set for use with the install-tree
72install(EXPORT Lib3DVTargets DESTINATION "${MODULES_INSTALL_DIR}" COMPONENT dev)
73
74
Note: See TracBrowser for help on using the repository browser.