Commit 60a7464d authored by francesco's avatar francesco
Browse files

modification of cmake files, steps still needed before using it

git-svn-id: svn://gal-serv.lnl.infn.it/agata/trunk/narval_emulator@1071 170316e4-aea8-4b27-aad4-0380ec0519c9
parent 82bd07b3
# CMake for ADPP
# CMake for AGAPRO
# O. Stezowski
#
#------------------------------------------------------------------------------
# Check cmake version is compatible
#
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
#set(CMAKE_BACKWARDS_COMPATIBILITY 2.2)
#
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Enforce an out-of-source builds before anything else
#
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(STATUS "ADPP requires an out-of-source build.")
message(STATUS "Please remove these files from ${CMAKE_BINARY_DIR} first:")
message(STATUS "CMakeCache.txt")
message(STATUS "CMakeFiles")
message(STATUS "Once these files are removed, create a separate directory")
message(STATUS "and run CMake from there")
message(FATAL_ERROR "in-source build detected")
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(ADPP)
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")
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")
#------------------------------------------------------------------------------
#----------------------------------------------------------------------------
# Globals
#
# Where to look first for cmake modules
#
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
#
# define format for libraries (force .so for macos)
if(WIN32)
set(_libprefix lib)
set(_libsuffix .dll)
SET(_libprefix lib)
SET(_libsuffix .dll)
elseif(APPLE)
set(_libprefix lib)
set(_libsuffix .so)
SET(_libprefix lib)
SET(_libsuffix .so)
else()
set(_libprefix lib)
set(_libsuffix .so)
SET(_libprefix lib)
SET(_libsuffix .so)
endif()
set(ADPP_LIBRARY_PROPERTIES
SET(AGAPRO_LIBRARY_PROPERTIES
SUFFIX ${_libsuffix}
PREFIX ${_libprefix} )
#
# ADD OFT
option(DO_OFT_INTERFACE "Add the Narval interface for OFT" ON)
#
OPTION(DO_OFT_INTERFACE "Add the Narval interface for OFT" ON)
if ( DO_OFT_INTERFACE )
if ( WITH_OFT )
MESSAGE(" External built-in ")
MESSAGE("[AGAPRO] OFT, External built-in ")
else()
MESSAGE(" Internal built-in ")
option(DO_OFT "Built internal OFT" ON)
MESSAGE("[AGAPRO] OFT, Internal built-in ")
OPTION(DO_OFT "Built internal OFT" ON)
endif()
endif()
option(DO_MGT_INTERFACE "Add the Narval interface for MGT" ON)
#
# ADD MGT
#
OPTION(DO_MGT_INTERFACE "Add the Narval interface for MGT" ON)
if ( DO_MGT_INTERFACE )
if ( DO_MGT )
MESSAGE(" External built-in ")
MESSAGE("[AGAPRO] MGT, External built-in ")
else()
MESSAGE(" Internal built-in ")
option(DO_MGT "Built internal MGT" ON)
MESSAGE("[AGAPRO] MGT, Internal built-in ")
OPTION(DO_MGT "Built internal MGT" ON)
endif()
endif()
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# ADF is mandatory so far ... in case what may thing of internal buidin
# ADF is mandatory !
find_package(ADF REQUIRED)
#
# Optional packages
include(ADPPSearchInstalledSoftware)
#
include(AGAPROSearchInstalledSoftware)
#
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
#
MESSAGE("+ ${PROJECT_NAME}")
MESSAGE("[AGAPRO] + ${PROJECT_NAME}")
#
#---Set pathes where to put the libraries, executables and headers------------------------------
# from root
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)
#---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)
#
# to be done CMAKE_INSTALL_BINDIR CMAKE_INSTALL_LIBDIR in case one would mike to install
# headers and libraries in once directory (narval case and ADPL case)
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(ADPP_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/include)
SET(AGAPRO_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/include)
#
# Add headers for external
#
# ADF
list (APPEND ADPP_INCLUDE_DIRS ${ADF_INCLUDE_DIRS})
list (APPEND AGAPRO_INCLUDE_DIRS ${ADF_INCLUDE_DIRS})
#
#----------------------------------------------------------------------------
# Add modules
#
add_subdirectory(common)
add_subdirectory(builders)
add_subdirectory(consumers)
add_subdirectory(producers)
add_subdirectory(filters)
#add_subdirectory(builders)
#add_subdirectory(consumers)
#add_subdirectory(producers)
#add_subdirectory(filters)
# CMake for module of ADPP
# CMake for module of AGAPRO
# O. Stezowski
cmake_minimum_required (VERSION 2.6)
#
......@@ -20,7 +20,7 @@ list(REMOVE_ITEM sources ${PROJECT_SOURCE_DIR}/libEventBuilder.cpp)
# add to includes
#
include_directories(${ADPP_INCLUDE_DIRS})
include_directories(${AGAPRO_INCLUDE_DIRS})
#----------------------------------------------------------------------------
#
......@@ -28,7 +28,7 @@ add_library(EventBuilders SHARED ${sources})
#
target_link_libraries(EventBuilders ${EXTRA_EXTERNAL_LIBRARIES} ${EXTRA_INTERNAL_LIBRARIES})
#
set_target_properties(EventBuilders PROPERTIES ${ADPP_LIBRARY_PROPERTIES})
set_target_properties(EventBuilders PROPERTIES ${AGAPRO_LIBRARY_PROPERTIES})
#
install(TARGETS EventBuilders RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
......
#----------------------------------------------------------------------------
# Search Narval : Not mandatory
# first set default directory to /agata/narval if none is given
# then check if narval_install is found in this directory
if (NOT WITH_NARVAL)
set(WITH_NARVAL "/agata/narval")
# if WITHOUT_NARVAL is given explicitely, nothing is searched
# Otherwise, try to look for narval_install in WITH_NARVAL (default is /agata/narval)
#
if ( NOT WITH_NARVAL )
if ( NOT WITHOUT_NARVAL )
set(WITH_NARVAL "/agata/narval")
endif()
endif(NOT WITH_NARVAL)
#
if (EXISTS ${WITH_NARVAL}/narval_install)
MESSAGE("Narval seems installed on this machine")
option(NARVAL_FOUND ON)
option(DO_NARVAL_INTERFACE ON)
MESSAGE("[AGAPRO] Narval seems installed on this machine")
option(CMAKE_HAS_NARVAL ON) # for includes
option(DO_NARVAL_INTERFACE ON) # for cmake so that the the library to load actors are build
else()
MESSAGE("Narval has not been found on this machine")
MESSAGE("[AGAPRO] Narval has not been found on this machine")
endif()
# MESSAGE("--> ${DO_NARVAL_INTERFACE}")
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# Search skstream : Not mandatory
# first set default directory to ../ADPD/skstream and search for skstream/skstream.h
if (NOT WITH_SKSTREAM)
set(WITH_SKSTREAM "${CMAKE_SOURCE_DIR}/../ADPD/skstream")
endif(NOT WITH_SKSTREAM)
# first set default directory to ../AGATPRO_DEP/skstream and search for skstream/skstream.h
#
if (NOT WITH_SKSTREAM AND NOT WITHOUT_SKSTREAM)
set(WITH_SKSTREAM "${CMAKE_SOURCE_DIR}/../AGATPRO_DEP/skstream")
endif(NOT WITH_SKSTREAM AND NOT WITHOUT_SKSTREAM)
#
if (EXISTS ${WITH_SKSTREAM}/skstream/skstream.h)
MESSAGE("skstream seems installed on this machine")
OPTION(CMAKE_HAS_SKSTREAM ON)
MESSAGE("[AGAPRO] skstream seems installed on this machine")
#
# should use WITH_SKSTREAM as SKSTREAM_PATH in makefiles
else()
MESSAGE("skstream has not been found on this machine")
MESSAGE("[AGAPRO] skstream has not been found on this machine")
endif()
#----------------------------------------------------------------------------
......
......@@ -47,12 +47,12 @@ endif()
set(ADF_FOUND false)
#
if ( ADF_INCLUDE_DIR AND ADF_LIBRARY AND IS_ADF_CONF )
set(ADF_DEFAULT_MSG "ADF found.
set(ADF_DEFAULT_MSG "[ADF] ADF found.
--> includes in: ${ADF_INCLUDE_DIR},
--> lib: ${ADF_LIBRARY},
--> ADF.conf: ${IS_ADF_CONF}")
else()
set(ADF_DEFAULT_MSG "ADF NOT found. includes in : ${ADF_INCLUDE_DIR}, lib: ${ADF_LIBRARY}, ADF.conf: ${IS_ADF_CONF}")
set(ADF_DEFAULT_MSG "[ADF] ADF NOT found. includes in : ${ADF_INCLUDE_DIR}, lib: ${ADF_LIBRARY}, ADF.conf: ${IS_ADF_CONF}")
endif()
#----------------------------------------------------------------------------
......@@ -69,7 +69,7 @@ find_package_handle_standard_args (ADF
# If we found ADF, set the needed non-cache variables
#
if(ADF_FOUND)
MESSAGE("[ADF] ${ADF_DEFAULT_MSG}")
MESSAGE("${ADF_DEFAULT_MSG}")
set(ADF_LIBRARIES ${ADF_LIBRARY})
set(ADF_INCLUDE_DIRS ${ADF_INCLUDE_DIR})
endif()
......
#ifndef AGAPROCONFIG_H
#define AGAPROCONFIG_H
#cmakedefine HAS_BOOST
#cmakedefine HAS_SKSTREAM
//////////////////////////////
////// Define OS_TYPE ////////
//////////////////////////////
#define OS_TYPE @CMAKE_OS_TYPE@
/////////////////////////////////////////////////////
//////// Choose your version of the program(s) //////
/////////////////////////////////////////////////////
#define NRV_ONLINE 1
#define NRV_OFFLINE 2
#define NRV_TYPE @CMAKE_NRV_TYPE@
#if NRV_TYPE != NRV_ONLINE
# undef NRV_TYPE
# define NRV_TYPE NRV_OFFLINE
#endif
#if NRV_TYPE == NRV_ONLINE
#if (OS_TYPE != OS_LINUX)
#error The online version can only be built on Linux
#endif
#endif
#endif
\ No newline at end of file
# CMake for module of ADPP
# CMake for module of AGAPRO
# O. Stezowski
#
cmake_minimum_required (VERSION 2.6)
......@@ -16,13 +16,35 @@ set( EXTRA_EXTERNAL_LIBRARIES )
file(GLOB headers ${PROJECT_SOURCE_DIR}/*.h)
file(GLOB sources ${PROJECT_SOURCE_DIR}/*.cpp)
#
# TEST current configuration
if ( UNIX )
set(CMAKE_OS_TYPE 1)
endif()
if ( WIN32 )
set(CMAKE_OS_TYPE 2)
endif()
if ( CYGWIN )
set(CMAKE_OS_TYPE 3)
endif()
if ( APPLE )
set(CMAKE_OS_TYPE 4)
endif()
if ( EXISTS /agata/narval/narval_install )
set( CMAKE_NRV_TYPE 1 )
else()
set( CMAKE_NRV_TYPE 2 )
endif()
#
#
ADD_DEFINITIONS(-DHAS_AGAPROCONFIG)
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/commonDefs.h.cmake"
"${CMAKE_BINARY_DIR}/include/commonDefs.h"
"${CMAKE_CURRENT_SOURCE_DIR}/AGAPROConfig.h.cmake"
"${CMAKE_BINARY_DIR}/include/AGAPROConfig.h"
)
set(headers ${headers} ${CMAKE_BINARY_DIR}/include/AGAPROConfig.h)
# add to includes
#
include_directories(${ADPP_INCLUDE_DIRS})
include_directories(${AGAPRO_INCLUDE_DIRS})
# set library
#
......@@ -30,13 +52,13 @@ add_library(AgataDPPCommon SHARED ${sources})
#
target_link_libraries(AgataDPPCommon ${EXTRA_EXTERNAL_LIBRARIES} ${EXTRA_INTERNAL_LIBRARIES})
#
set_target_properties(AgataDPPCommon PROPERTIES ${ADPP_LIBRARY_PROPERTIES})
set_target_properties(AgataDPPCommon PROPERTIES ${AGAPRO_LIBRARY_PROPERTIES})
#
install(TARGETS AgataDPPCommon RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
COMPONENT libraries)
install(FILES ${headers} DESTINATION include COMPONENT headers )
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
......
# CMake for module of ADPP
# CMake for module of AGAPRO
# O. Stezowski
cmake_minimum_required (VERSION 2.6)
#
......@@ -21,7 +21,7 @@ endif()
# add to includes
#
include_directories(${ADPP_INCLUDE_DIRS})
include_directories(${AGAPRO_INCLUDE_DIRS})
#----------------------------------------------------------------------------
#
......@@ -29,7 +29,7 @@ add_library(AncillaryFilter SHARED ${sources})
#
target_link_libraries(AncillaryFilter ${EXTRA_EXTERNAL_LIBRARIES} ${EXTRA_INTERNAL_LIBRARIES})
#
set_target_properties(AncillaryFilter PROPERTIES ${ADPP_LIBRARY_PROPERTIES})
set_target_properties(AncillaryFilter PROPERTIES ${AGAPRO_LIBRARY_PROPERTIES})
#
install(TARGETS AncillaryFilter RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
......
# CMake for ADPP/filters
# CMake for AGAPRO/filters
# O. Stezowski
project(filters)
......
# CMake for module of ADPP
# CMake for module of AGAPRO
# O. Stezowski
cmake_minimum_required (VERSION 2.6)
#
......@@ -21,7 +21,7 @@ endif()
# add to includes
#
include_directories(${ADPP_INCLUDE_DIRS})
include_directories(${AGAPRO_INCLUDE_DIRS})
#----------------------------------------------------------------------------
#
......@@ -29,7 +29,7 @@ add_library(PSAFilter SHARED ${sources})
#
target_link_libraries(PSAFilter ${EXTRA_EXTERNAL_LIBRARIES} ${EXTRA_INTERNAL_LIBRARIES})
#
set_target_properties(PSAFilter PROPERTIES ${ADPP_LIBRARY_PROPERTIES})
set_target_properties(PSAFilter PROPERTIES ${AGAPRO_LIBRARY_PROPERTIES})
#
install(TARGETS PSAFilter RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
......
# CMake for module of ADPP
# CMake for module of AGAPRO
# O. Stezowski
cmake_minimum_required (VERSION 2.6)
#
......@@ -21,7 +21,7 @@ endif()
# add to includes
#
include_directories(${ADPP_INCLUDE_DIRS})
include_directories(${AGAPRO_INCLUDE_DIRS})
#----------------------------------------------------------------------------
#
......@@ -29,7 +29,7 @@ add_library(PreprocessingFilter SHARED ${sources})
#
target_link_libraries(PreprocessingFilter ${EXTRA_EXTERNAL_LIBRARIES} ${EXTRA_INTERNAL_LIBRARIES})
#
set_target_properties(PreprocessingFilter PROPERTIES ${ADPP_LIBRARY_PROPERTIES})
set_target_properties(PreprocessingFilter PROPERTIES ${AGAPRO_LIBRARY_PROPERTIES})
#
install(TARGETS PreprocessingFilter RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
......
# CMake for module of ADPP
# CMake for module of AGAPRO
# O. Stezowski
cmake_minimum_required (VERSION 2.6)
#
......@@ -47,7 +47,7 @@ endif()
# add to includes
#
include_directories(${ADPP_INCLUDE_DIRS})
include_directories(${AGAPRO_INCLUDE_DIRS})
#----------------------------------------------------------------------------
#
......@@ -55,7 +55,7 @@ add_library(TrackingFilter SHARED ${sources})
#
target_link_libraries(TrackingFilter ${EXTRA_EXTERNAL_LIBRARIES} ${EXTRA_INTERNAL_LIBRARIES})
#
set_target_properties(TrackingFilter PROPERTIES ${ADPP_LIBRARY_PROPERTIES})
set_target_properties(TrackingFilter PROPERTIES ${AGAPRO_LIBRARY_PROPERTIES})
#
install(TARGETS TrackingFilter RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
......
# CMake for module of ADPP
# CMake for module of AGAPRO
# O. Stezowski
cmake_minimum_required (VERSION 2.6)
#
......@@ -21,7 +21,7 @@ endif()
# add to includes
#
include_directories(${ADPP_INCLUDE_DIRS})
include_directories(${AGAPRO_INCLUDE_DIRS})
#----------------------------------------------------------------------------
#
......@@ -29,7 +29,7 @@ add_library(AncillaryTCP SHARED ${sources})
#
target_link_libraries(AncillaryTCP ${EXTRA_EXTERNAL_LIBRARIES} ${EXTRA_INTERNAL_LIBRARIES})
#
set_target_properties(AncillaryTCP PROPERTIES ${ADPP_LIBRARY_PROPERTIES})
set_target_properties(AncillaryTCP PROPERTIES ${AGAPRO_LIBRARY_PROPERTIES})
#
install(TARGETS AncillaryTCP RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
......
# CMake for ADPP/filters
# CMake for AGAPRO/filters
# O. Stezowski
project(producers)
......
# CMake for module of ADPP
# CMake for module of AGAPRO
# O. Stezowski
cmake_minimum_required (VERSION 2.6)
#
......@@ -22,7 +22,7 @@ list(REMOVE_ITEM sources ${PROJECT_SOURCE_DIR}/CrystalProducerATCA.cpp)
# add to includes
#
include_directories(${ADPP_INCLUDE_DIRS})
include_directories(${AGAPRO_INCLUDE_DIRS})
#----------------------------------------------------------------------------
#
......@@ -30,7 +30,7 @@ add_library(CrystalProducer SHARED ${sources})
#
target_link_libraries(CrystalProducer ${EXTRA_EXTERNAL_LIBRARIES} ${EXTRA_INTERNAL_LIBRARIES})
#
set_target_properties(CrystalProducer PROPERTIES ${ADPP_LIBRARY_PROPERTIES})
set_target_properties(CrystalProducer PROPERTIES ${AGAPRO_LIBRARY_PROPERTIES})
#
install(TARGETS CrystalProducer RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
......
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