Add slsReceiver and slsDetector targets to the export set (used by donwstream project)

set TARGETS_EXPORT_NAME if the project is built directly.
This commit is contained in:
Samuel Debionne
2018-09-07 10:55:03 +02:00
parent ef3e01b9bd
commit e13ecc8625
3 changed files with 14 additions and 3 deletions

View File

@ -2,6 +2,12 @@ cmake_minimum_required(VERSION 2.8)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
set (CALIBRATE OFF)
# Check if project is being used directly or via add_subdirectory
set(SLS_MASTER_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(SLS_MASTER_PROJECT ON)
endif()
option (USE_HDF5 "HDF5 File format" OFF)
option (USE_TEXTCLIENT "Text Client" OFF)
option (USE_RECEIVER "Receiver" OFF)
@ -46,6 +52,10 @@ if (USE_GUI)
endif()
endif (USE_GUI)
if (SLS_MASTER_PROJECT)
# Set targets export name (otherwise set by upstream project)
set(TARGETS_EXPORT_NAME "slsdetector-targets")
endif (SLS_MASTER_PROJECT)
if (CALIBRATE)
if (DEFINED ENV{ROOTSYS})