Commit 0c65a058 authored by Stezowski Olivier's avatar Stezowski Olivier
Browse files

Merge branch 'preprod' into 'master'

Preprod

See merge request IPNL_GAMMA/narval_emulator!60
parents a1667455 d6adb5e7
#------------------------------------------------------------------------------
# CMake top file for agapro. Depending on the flag AGAPRO_BUILDING_MODE, it switchs to
# 0 - building one library per actor
# 1 - building one library per sub-directory i.e, commom, consumers, filters, producers
# 2 - building one library general agapro library
# =============================================================================
# +++++++++++++++++++++++++ CMake TOP file for agapro ++++++++++++++++++++++++
#
# In order to adapt the project to major changes in the building system,
# all sub-modules have a build directory divided in sub-directories called TX,
# in which there is the CmakeLists.txt used to build.
# The building tree is selected through AGAPRO_BUILDING_TYPE [default = 1].
#
# In cases > 0, individual libraries per actors are buiding BUT they contain only the C interface for NARVAL/DCOD
# Depending on the flag, it switchs to building type :
# 0 - first cmake file of the project since the demonstrator @ LNL
# 1 - modern cmake implementation -> introduce targets to manage dependencies
#
#------------------------------------------------------------------------------
# Check cmake version is compatible
#
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
#
# Where to look first for cmake modules
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
if ( NOT AGAPRO_BUILDING_MODE )
SET(AGAPRO_BUILDING_MODE 0)
# Enforce an out-of-source builds before anything else
#
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(STATUS "[AGAPRO] AGAPRO requires an out-of-source build.")
message(STATUS "[AGAPRO] Please remove these files from ${CMAKE_BINARY_DIR} first:")
message(STATUS "[AGAPRO] CMakeCache.txt")
message(STATUS "[AGAPRO] CMakeFiles")
message(STATUS "[AGAPRO] Once these files are removed, create a separate directory")
message(STATUS "[AGAPRO] and run CMake from there")
message(FATAL_ERROR "[AGAPRO] in-source build detected")
endif()
#
#------------------------------------------------------------------------------
#
# ------------------------ CMake TOP file for agapro -------------------------
# =============================================================================
#------------------------------------------------------------------------------
MESSAGE("[AGAPRO] Building Mode is " ${AGAPRO_BUILDING_MODE})
IF (AGAPRO_BUILDING_MODE EQUAL 0)
INCLUDE(CMakeLists_individual_libs.txt)
ENDIF()
#------------------------------------------------------------------------------
# =============================================================================
# +++++++++++++++++++++++++++ Select the built tree +++++++++++++++++++++++++++
#
set(AGAPRO_BUILDING_TYPE_DEFAULT 0)
if ( NOT AGAPRO_BUILDING_TYPE )
set(AGAPRO_BUILDING_TYPE ${AGAPRO_BUILDING_TYPE_DEFAULT})
endif()
#
message("[CMAKE_AGAPRO] Building Type is " ${AGAPRO_BUILDING_TYPE})
if (AGAPRO_BUILDING_TYPE EQUAL 0)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
option(GUESS_THREAD "GUESS THREAD" ON)
include(CMakeLists_T0.txt)
elseif(AGAPRO_BUILDING_TYPE EQUAL 1)
# set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
if(DEFINED ENV{G_RAYSOFTWARE_TOP_DIR})
# for Modern Cmake to look for XXXConfig.cmake files
set(CMAKE_PREFIX_PATH $ENV{G_RAYSOFTWARE_TOP_DIR}/lib/cmake/ ${CMAKE_PREFIX_PATH})
# for old Cmake to look for FindXXX.cmake files
set(CMAKE_MODULE_PATH
$ENV{G_RAYSOFTWARE_TOP_DIR}/scripts/cmake/Modules/V${AGAPRO_BUILDING_TYPE}
${CMAKE_MODULE_PATH})
endif()
include(GNUInstallDirs)
if(EXISTS "$ENV{G_RAYSOFTWARE_TOP_DIR}/scripts/cmake/Modules/V1/gRaySoftwareMacros.cmake")
include(gRaySoftwareMacros)
endif()
include(CMakeLists_T1.txt)
else()
message("[AGAPRO] Building Type is unknown !")
endif()
# -------------------------- Select the built tree ----------------------------
# =============================================================================
# CMake for AGAPRO
# O. Stezowski
#
#------------------------------------------------------------------------------
# Check cmake version is compatible
#
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
#
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Enforce an out-of-source builds before anything else
#
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
MESSAGE(STATUS "[AGAPRO] AGAPRO requires an out-of-source build.")
MESSAGE(STATUS "[AGAPRO] Please remove these files from ${CMAKE_BINARY_DIR} first:")
MESSAGE(STATUS "[AGAPRO] CMakeCache.txt")
MESSAGE(STATUS "[AGAPRO] CMakeFiles")
MESSAGE(STATUS "[AGAPRO] Once these files are removed, create a separate directory")
MESSAGE(STATUS "[AGAPRO] and run CMake from there")
MESSAGE(FATAL_ERROR "[AGAPRO] in-source build detected")
endif()
#
PROJECT(AGAPRO)
#
SET(${PROJECT_NAME}_VERSION "1.1.0")
SET(${PROJECT_NAME}_VERSION_MAJOR "1")
SET(${PROJECT_NAME}_VERSION_MINOR "1")
SET(${PROJECT_NAME}_VERSION_PATCH "0")
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
cmake_policy(SET CMP0042 NEW)
cmake_policy(SET CMP0011 NEW)
# FIX Warning with rpath on macosx
if(APPLE)
set(CMAKE_MACOSX_RPATH 1)
endif()
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
#------------------------------------------------------------------------------
#----------------------------------------------------------------------------
# Globals
#
# Where to look first for cmake modules
#
if(DEFINED ENV{G_RAYSOFTWARE_TOP_DIR})
set(CMAKE_MODULE_PATH $ENV{G_RAYSOFTWARE_TOP_DIR}/scripts/cmake/Modules ${CMAKE_MODULE_PATH})
else()
if(DEFINED ENV{AGATASOFTWARE_TOP_DIR})
set(CMAKE_MODULE_PATH $ENV{AGATASOFTWARE_TOP_DIR}/scripts/cmake/Modules ${CMAKE_MODULE_PATH})
endif()
endif()
message("PATH to search for cmake modules ${CMAKE_MODULE_PATH}")
#
# define format for libraries (force .so for macos)
if(WIN32)
SET(_libprefix lib)
SET(_libsuffix .dll)
elseif(APPLE)
SET(_libprefix lib)
SET(_libsuffix .so)
else()
SET(_libprefix lib)
SET(_libsuffix .so)
endif()
SET(AGAPRO_LIBRARY_PROPERTIES
SUFFIX ${_libsuffix}
PREFIX ${_libprefix} )
#
SET(AGATASOFTWARE_TOP_DIR "${CMAKE_SOURCE_DIR}/../")
#
# ADD OFT
#
OPTION(DO_OFT_INTERFACE "Add the Narval interface for OFT" ON)
if ( DO_OFT_INTERFACE )
if ( WITH_OFT )
MESSAGE("[AGAPRO] OFT, External built-in ")
else()
MESSAGE("[AGAPRO] OFT, Internal built-in ")
OPTION(DO_OFT "Built internal OFT" ON)
endif()
endif()
#
# ADD MGT
#
OPTION(DO_MGT_INTERFACE "Add the Narval interface for MGT" ON)
if ( DO_MGT_INTERFACE )
if ( WITH_MGT )
MESSAGE("[AGAPRO] MGT, External built-in ")
else()
MESSAGE("[AGAPRO] MGT, Internal built-in ")
OPTION(DO_MGT "Built internal MGT" ON)
endif()
endif()
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# Find mondule using cmake find system
# ADF is mandatory !
find_package(ADF REQUIRED)
#
find_package(ROOT)
find_package(MFM)
find_package(DCOD)
find_package(VAMOS)
# Find module using simple test
include(AGAPROMacroUtilities)
include(AGAPROSearchInstalledSoftware)
#
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
#
MESSAGE("[AGAPRO]")
#
#---Set pathes where to put the libraries, executables and headers-----------
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
#
if ( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
set ( CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR} CACHE PATH "Install in building directory" FORCE )
endif()
MESSAGE("[AGAPRO] Install is done in ${CMAKE_INSTALL_PREFIX} ")
#
SET(AGAPRO_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/include)
#
# Add headers for external
#
# ADF
list (APPEND AGAPRO_INCLUDE_DIRS ${ADF_INCLUDE_DIRS})
# ROOT
if (ROOT_FOUND)
list(APPEND AGAPRO_INCLUDE_DIRS ${ROOT_INCLUDES})
link_directories(${ROOT_LIBRARY_DIR})
endif()
# MFM
if (MFM_FOUND)
list (APPEND AGAPRO_INCLUDE_DIRS ${MFM_INCLUDE_DIRS})
endif()
# VAMOS
if (VAMOS_FOUND)
list (APPEND AGAPRO_INCLUDE_DIRS ${VAMOS_INCLUDE_DIRS})
endif()
# Boost
if (HAS_BOOST)
list(APPEND AGAPRO_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
endif()
if (HAS_SKSTREAM)
list(APPEND AGAPRO_INCLUDE_DIRS ${SKSTREAM_INCLUDE_DIRS})
endif()
#
#----------------------------------------------------------------------------
# Add modules
#
ADD_DEFINITIONS(-DHAS_AGAPROCONFIG)
if ( HAS_C11 )
MESSAGE("[AGAPRO] C++11 FOUND ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.13")
endif()
#
add_subdirectory(common)
add_subdirectory(builders)
add_subdirectory(consumers)
add_subdirectory(producers)
add_subdirectory(filters)
# message to a kind of log to track back the sequence of calls
TODAY(CDATE)
file(APPEND $ENV{G_RAYSOFTWARE_TOP_DIR}/CMAKE_LOG_FILE "CMAKE on AGAPRO has been called: ${CDATE}")
#
if ( UNIX )
if( HAS_C11 )
SET(THREAD_MESSAGE "Compiled with C++11 thread" )
else()
if ( HAS_BOOST )
SET(THREAD_MESSAGE "Compiled with BOOST thread")
else()
SET(THREAD_MESSAGE "Compiled without thread")
endif()
endif()
find_package(Subversion)
# IF(SUBVERSION_FOUND)
# Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
# SET(SUBVERSION_LOG "Subversion revision number is " ${Project_WC_REVISION} )
# ENDIF(SUBVERSION_FOUND)
add_custom_target(dolog ALL
COMMAND ${CMAKE_COMMAND} -E echo "Last compilation/installation from " > LAST_AGAPRO_MAKE_LOG
COMMAND ${CMAKE_COMMAND} -E echo ${AGATASOFTWARE_TOP_DIR} >> LAST_AGAPRO_MAKE_LOG
COMMAND ${CMAKE_COMMAND} -E echo "at " >> LAST_AGAPRO_MAKE_LOG
COMMAND date >> LAST_AGAPRO_MAKE_LOG
# COMMAND ${CMAKE_COMMAND} -E echo ${SUBVERSION_LOG} >> LAST_AGAPRO_MAKE_LOG
COMMAND ${CMAKE_COMMAND} -E echo ${THREAD_MESSAGE} >> LAST_AGAPRO_MAKE_LOG
COMMENT " Call log target to trackback last building "
)
endif()
INSTALL(FILES ${CMAKE_BINARY_DIR}/LAST_AGAPRO_MAKE_LOG DESTINATION lib COMPONENT libraries)
# =============================================================================
# ++++++++++++++++++++++++++++ Globals definitions ++++++++++++++++++++++++++++
#
# Modern CMake for module of AGAPRO
# [O. Stezowski]
#
# Effective cmake required
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
#
project(AGAPRO
# VERSION 1.2.0
# DESCRIPTION "CMake project for the AGAPRO package"
# HOMEPAGE_URL
# LANGUAGES C CXX
)
message("PATH to search for cmake modules ${CMAKE_MODULE_PATH}")
#
# is this still useful ?
set(AGATASOFTWARE_TOP_DIR "${CMAKE_SOURCE_DIR}/../")
set(TOP_PROJECT_NAME "AGAPRO")
#
# ---------------------------- Globals definitions ----------------------------
# =============================================================================
# =============================================================================
# ++++++++++++++++++++++++++++ Global dependencies ++++++++++++++++++++++++++++
#
# Find mondule using modern cmake i.e. look
# for XXXConfig files defining targets or import targets from library & includes
#
# ADF is mandatory.
# ADF not installed through modern cmake ==> built an target interface
find_package(ADF REQUIRED)
if ( ADF_FOUND )
message(STATUS "ADF has been found through FindADF")
add_library(ADF SHARED IMPORTED)
set_property(TARGET ADF
PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ADF_INCLUDE_DIRS})
set_property(TARGET ADF
PROPERTY IMPORTED_LOCATION ${ADF_LIBRARY})
else()
message(ERROR "ADF has been found")
endif()
#
# ROOT is not mandatory, but effective root required i.e. > root 6.16
find_package(ROOT QUIET)
if(TARGET ROOT::Core)
message("--> ROOTConfig FOUND")
# this is required for some reasons ... might be removed in the future
set_property(TARGET ROOT::Core
PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${ROOT_INCLUDE_DIRS}")
else()
message("--> ROOTConfig NOT FOUND")
endif()
#
# MFM not mandatory, but find done though modern cmake
find_package(MFM QUIET)
if (TARGET MFM::MFM)
message("--> MFMConfig FOUND")
else()
message("--> MFMConfig NOT FOUND")
endif()
#
# AFT not mandatory, but find done though modern cmake
find_package(AFT QUIET)
if (TARGET AFT::AFT)
message("--> AFTConfig FOUND")
else()
message("--> AFTConfig NOT FOUND")
endif()
#
#
# to be done ...
#find_package(DCOD)
#find_package(VAMOS)
#
# NOTE: this is for pure includes
#add_library(ADF INTERFACE IMPORTED)
#set_property(TARGET ADF PROPERTY
# INTERFACE_INCLUDE_DIRECTORIES ${ADF_INCLUDE_DIRS})
#
# ---------------------------- Global dependencies ----------------------------
# =============================================================================
# =============================================================================
# ++++++++++++++++++++++++++++ Add sub-directories ++++++++++++++++++++++++++++
add_subdirectory(common)
add_subdirectory(builders)
add_subdirectory(producers)
add_subdirectory(filters)
add_subdirectory(consumers)
# ---------------------------- Add sub-directories ----------------------------
# =============================================================================
# =============================================================================
# ++++++++++++++++++++++++++ Install global targets +++++++++++++++++++++++++++
#
# all targets have been collected through LIST_OF_AGAPRO_TARGETS
get_property(AGAPRO_TARGETS GLOBAL PROPERTY LIST_OF_AGAPRO_TARGETS)
message("AGAPRO Targets are ${AGAPRO_TARGETS}")
export(TARGETS ${AGAPRO_TARGETS}
NAMESPACE AGAPRO::
FILE $ENV{G_RAYSOFTWARE_TOP_DIR}/lib/cmake/AGAPROConfig.cmake
)
#INSTALL(FILES ${CMAKE_BINARY_DIR}/AGAPROConfig.cmake DESTINATION lib/cmake COMPONENT libraries)
#
# this is to keep some logs in the lib directory to know installation conditions
if ( UNIXX )
TODAY(CDATE)
file(APPEND $ENV{G_RAYSOFTWARE_TOP_DIR}/CMAKE_LOG_FILE "CMAKE on AGAPRO has been called: ${CDATE}")
add_custom_target(dolog ALL
COMMAND ${CMAKE_COMMAND} -E echo "Last compilation/installation from " > LAST_AGAPRO_MAKE_LOG
COMMAND ${CMAKE_COMMAND} -E echo ${AGATASOFTWARE_TOP_DIR} >> LAST_AGAPRO_MAKE_LOG
COMMAND ${CMAKE_COMMAND} -E echo "at " >> LAST_AGAPRO_MAKE_LOG
COMMAND date >> LAST_AGAPRO_MAKE_LOG
# COMMAND ${CMAKE_COMMAND} -E echo ${SUBVERSION_LOG} >> LAST_AGAPRO_MAKE_LOG
COMMAND ${CMAKE_COMMAND} -E echo ${THREAD_MESSAGE} >> LAST_AGAPRO_MAKE_LOG
COMMENT " Call log target to trackback last building "
)
install(FILES ${CMAKE_BINARY_DIR}/LAST_AGAPRO_MAKE_LOG DESTINATION lib COMPONENT libraries)
endif()
# -------------------------- Install global targets ---------------------------
# =============================================================================
#
# INSTALL CMAKE TARGETS
#install(TARGETS AgaProCommon builders
# EXPORT AGAPROTargets
# LIBRARY DESTINATION lib
# ARCHIVE DESTINATION lib
# RUNTIME DESTINATION bin
# INCLUDES DESTINATION include
#)
#
# INSTALL CMAKE TARGETS
#
#install(EXPORT AGAPROTargets
# FILE
# AGAPROConfig.cmake
# NAMESPACE
# AGAPRO::
# DESTINATION
# lib/cmake/
#)
#
#install(
# EXPORT
# AgaProCommon builders BasicAFP Crystal GRETINA_GT2ADF PreprocessingFilter TrackingFilter PSAFilter ostPSAFilter BasicATSB BasicAFC ProdHist PreproHist PSAHist TreeBuilder
# FILE
# AGAPROConfig.cmake
# NAMESPACE
# AGAPRO::
# DESTINATION
# lib/cmake/
#)
#
# INSTALL CMAKE TARGETS
#install(TARGETS AgaProCommon builders
# EXPORT AGAPROTargets
# LIBRARY DESTINATION lib
# ARCHIVE DESTINATION lib
# RUNTIME DESTINATION bin
# INCLUDES DESTINATION include
#)
#
# INSTALL CMAKE TARGETS
#
#install(EXPORT AGAPROTargets
# FILE
# AGAPROConfig.cmake
# NAMESPACE
# AGAPRO::
# DESTINATION
# lib/cmake/
#)
#
#install(
# EXPORT
# AgaProCommon builders BasicAFP Crystal GRETINA_GT2ADF PreprocessingFilter TrackingFilter PSAFilter ostPSAFilter BasicATSB BasicAFC ProdHist PreproHist PSAHist TreeBuilder
# FILE
# AGAPROConfig.cmake
# NAMESPACE
# AGAPRO::
# DESTINATION
# lib/cmake/
#)
......@@ -88,13 +88,25 @@ endif()
#
OPTION(DO_MGT_INTERFACE "Add the Narval interface for MGT" ON)
if ( DO_MGT_INTERFACE )
if ( DO_MGT )
if ( WITH_MGT )
MESSAGE("[AGAPRO] MGT, External built-in ")
else()
MESSAGE("[AGAPRO] MGT, Internal built-in ")
OPTION(DO_MGT "Built internal MGT" ON)
endif()
endif()
#
# ADD AFT
#
OPTION(DO_AFT_INTERFACE "Add the Narval interface for AFT" OFF)
if ( DO_AFT_INTERFACE )
if ( WITH_AFT )
MESSAGE("[AGAPRO] AFT, External built-in ")
else()
MESSAGE("[AGAPRO] AFT, Internal built-in ")
OPTION(DO_AFT "Built internal AFT" ON)
endif()
endif()
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# Find mondule using cmake find system
......
# CMake for module of AGAPRO
# O. Stezowski
cmake_minimum_required (VERSION 2.6)
#
project (builders)
# Just call the right Cmakefile depending of the building type
#
MESSAGE("[AGAPRO] + ${PROJECT_NAME}")
#
# internal and external dependencies
#
set( EXTRA_INTERNAL_LIBRARIES AgaProCommon)
set( EXTRA_EXTERNAL_LIBRARIES ${ADF_LIBRARY})
if ( HAS_BOOST )
MESSAGE("[AGAPRO] BOOST FOUND ")
set( EXTRA_EXTERNAL_LIBRARIES ${EXTRA_EXTERNAL_LIBRARIES} ${Boost_LIBRARIES} )
endif()
#
# headers / sources
file(GLOB headers ${PROJECT_SOURCE_DIR}/*.h)
file(GLOB sources ${PROJECT_SOURCE_DIR}/*.cpp)
# Remove if any
#if ( NOT DO_NARVAL_INTERFACE )
list(REMOVE_ITEM sources ${PROJECT_SOURCE_DIR}/libEventBuilder.cpp)
#endif()
# add to includes
#
include_directories(${AGAPRO_INCLUDE_DIRS})
#----------------------------------------------------------------------------
#
add_library(EventBuilders SHARED ${sources})
#
target_link_libraries(EventBuilders ${EXTRA_EXTERNAL_LIBRARIES} ${EXTRA_INTERNAL_LIBRARIES})
#
set_target_properties(EventBuilders PROPERTIES ${AGAPRO_LIBRARY_PROPERTIES})
#
install(TARGETS EventBuilders RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
COMPONENT libraries)
install(FILES ${headers} DESTINATION include COMPONENT headers )
#
# copy headers file in a single directory
# because cmake2.6 does not provide COPY in file, do it another way
if( ${CMAKE_VERSION} VERSION_GREATER "2.8.0" )
file(COPY ${headers} DESTINATION ${CMAKE_BINARY_DIR}/include)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/build/T${AGAPRO_BUILDING_TYPE}/CMakeLists.txt")
include(build/T${AGAPRO_BUILDING_TYPE}/CMakeLists.txt)
else()
if ( EXISTS ${CMAKE_BINARY_DIR}/include )
else()
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include/ )
endif()
foreach ( f ${headers} )
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${f} ${CMAKE_BINARY_DIR}/include/ )
endforeach()
endif()
message(AUTHOR_WARNING "Building type ${AGAPRO_BUILDING_TYPE} unknown in ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt")
endif()
# CMake for module of AGAPRO
# O. Stezowski
cmake_minimum_required (VERSION 2.6)
#
project (builders)
#
MESSAGE("[AGAPRO] + ${PROJECT_NAME}")
#
# internal and external dependencies
#
set( EXTRA_INTERNAL_LIBRARIES AgaProCommon)
set( EXTRA_EXTERNAL_LIBRARIES ${ADF_LIBRARY})
if ( HAS_BOOST )
MESSAGE("[AGAPRO] BOOST FOUND ")
set( EXTRA_EXTERNAL_LIBRARIES ${EXTRA_EXTERNAL_LIBRARIES} ${Boost_LIBRARIES} )
endif()
#
# headers / sources
file(GLOB headers ${PROJECT_SOURCE_DIR}/*.h)
file(GLOB sources ${PROJECT_SOURCE_DIR}/*.cpp)
# Remove if any
#if ( NOT DO_NARVAL_INTERFACE )
list(REMOVE_ITEM sources ${PROJECT_SOURCE_DIR}/libEventBuilder.cpp)
#endif()
# add to includes
#
include_directories(${AGAPRO_INCLUDE_DIRS})
#----------------------------------------------------------------------------
#
add_library(EventBuilders SHARED ${sources})
#
target_link_libraries(EventBuilders ${EXTRA_EXTERNAL_LIBRARIES} ${EXTRA_INTERNAL_LIBRARIES})
#
set_target_properties(EventBuilders PROPERTIES ${AGAPRO_LIBRARY_PROPERTIES})
#
install(TARGETS EventBuilders RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
COMPONENT libraries)
install(FILES ${headers} DESTINATION include COMPONENT headers )
#
# copy headers file in a single directory
# because cmake2.6 does not provide COPY in file, do it another way
if( ${CMAKE_VERSION} VERSION_GREATER "2.8.0" )
file(COPY ${headers} DESTINATION ${CMAKE_BINARY_DIR}/include)
else()
if ( EXISTS ${CMAKE_BINARY_DIR}/include )
else()
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include/ )
endif()
foreach ( f ${headers} )
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${f} ${CMAKE_BINARY_DIR}/include/ )
endforeach()
endif()