Skip to content
Snippets Groups Projects
Commit 31c56241 authored by Evgeny Kashirin's avatar Evgeny Kashirin
Browse files

Refactor CMakeList.txt, version 1.2

parent 5043548c
No related branches found
Tags 1.2
No related merge requests found
......@@ -2,7 +2,9 @@
cmake_minimum_required(VERSION 2.4 FATAL_ERROR)
project(DataTree)
# Might not working on lxpool or lxplus.
set(PROJECT_VERSION 1.2)
include(GenerateExportHeader)
# You need to tell CMake where to find the ROOT installation. This can be done in a number of ways:
......@@ -43,8 +45,6 @@ file(GLOB HEADERS src/*.h)
list(REMOVE_ITEM HEADERS_DICT DataTreeEventLinkDef.h)
# message("${HEADERS}")
set(DICT_FILE_NAME G__${PROJECT_NAME})
set(PCM_FILE_NAME lib${PROJECT_NAME})
......@@ -66,8 +66,8 @@ target_link_libraries(DataTree ${ROOT_LIBRARIES})
if (${CMAKE_MAJOR_VERSION} GREATER 2)
generate_export_header(DataTree)
set_property(TARGET DataTree PROPERTY VERSION 1)
set_property(TARGET DataTree PROPERTY SOVERSION 1)
set_property(TARGET DataTree PROPERTY VERSION ${PROJECT_VERSION})
set_property(TARGET DataTree PROPERTY SOVERSION ${PROJECT_VERSION})
set_property(TARGET DataTree PROPERTY INTERFACE_DataTree_MAJOR_VERSION 1)
set_property(TARGET DataTree APPEND PROPERTY COMPATIBLE_INTERFACE_STRING INTERFACE_DataTree_MAJOR_VERSION)
......@@ -99,19 +99,27 @@ install(
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/DataTree/DataTreeConfigVersion.cmake"
VERSION 1.0
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
)
export(EXPORT DataTreeTargets
FILE "${CMAKE_CURRENT_BINARY_DIR}/DataTree/DataTreeTargets.cmake")
configure_file(cmake/DataTreeConfig.cmake
"${CMAKE_CURRENT_BINARY_DIR}/DataTree/DataTreeConfig.cmake"
COPYONLY
)
set(ConfigPackageLocation lib/cmake/DataTree)
set(DataTree_INCLUDE_DIR "include")
set(DataTree_LIBRARY_DIR "lib")
configure_package_config_file(
DataTreeConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/DataTree/DataTreeConfig.cmake
INSTALL_DESTINATION ${ConfigPackageLocation}
PATH_VARS DataTree_INCLUDE_DIR DataTree_LIBRARY_DIR
# [NO_SET_AND_CHECK_MACRO]
# [NO_CHECK_REQUIRED_COMPONENTS_MACRO]
# [INSTALL_PREFIX <path>]
)
install(EXPORT DataTreeTargets
FILE
DataTreeTargets.cmake
......@@ -120,8 +128,8 @@ install(EXPORT DataTreeTargets
)
install(FILES
cmake/DataTreeConfig.cmake
"${CMAKE_CURRENT_BINARY_DIR}/DataTree/DataTreeConfigVersion.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/DataTree/DataTreeConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/DataTree/DataTreeConfigVersion.cmake"
DESTINATION
${ConfigPackageLocation}
COMPONENT
......
include("${CMAKE_CURRENT_LIST_DIR}/DataTreeTargets.cmake")
message ("-- Found DataTree...")
@PACKAGE_INIT@
set (_thisdir ${CMAKE_CURRENT_LIST_DIR})
message ("-- Found DataTree...")
get_filename_component(DataTree_INCLUDE_DIR "${_thisdir}/../../../include" ABSOLUTE)
set(DataTree_INCLUDE_DIR "@PACKAGE_DataTree_INCLUDE_DIR@")
message ("DataTree_INCLUDE_DIR = ${DataTree_INCLUDE_DIR}")
get_filename_component(DataTree_LIBRARY_DIR "${_thisdir}/../../../lib" ABSOLUTE)
set(DataTree_LIBRARY_DIR "@PACKAGE_DataTree_LIBRARY_DIR@")
message ("DataTree_LIBRARY_DIR = ${DataTree_LIBRARY_DIR}")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment