# CMake for module of AGAPRO # O. Stezowski cmake_minimum_required (VERSION 2.6) # project (TreeBuilder) # MESSAGE("[AGAPRO] + ${PROJECT_NAME}") # # internal and external dependencies # set( EXTRA_INTERNAL_LIBRARIES AgaProCommon ) set( EXTRA_EXTERNAL_LIBRARIES ${ADF_LIBRARY} ) if (ROOT_FOUND) set(EXTRA_EXTERNAL_LIBRARIES ${EXTRA_EXTERNAL_LIBRARIES} Core Graf MathCore Gpad Hist Tree RIO Thread Net TreePlayer Geom) endif() #if (MFM_FOUND) # SET(EXTRA_EXTERNAL_LIBRARIES ${EXTRA_EXTERNAL_LIBRARIES} MFM) #endif() # headers / sources file(GLOB headers ${PROJECT_SOURCE_DIR}/*.h) file(GLOB sources ${PROJECT_SOURCE_DIR}/*.cpp) if ( NOT MFM_FOUND) list(REMOVE_ITEM sources ${PROJECT_SOURCE_DIR}/AGAPRO_TB_AgNedDiam.cpp) list(REMOVE_ITEM headers ${PROJECT_SOURCE_DIR}/AGAPRO_TB_AgNedDiam.h) endif() # Remove if any if ( NOT DO_NARVAL_INTERFACE ) list(REMOVE_ITEM sources ${PROJECT_SOURCE_DIR}/libAGAPRO_TreeBuilder.cpp) endif() # add to includes # include_directories(${AGAPRO_INCLUDE_DIRS}) #---------------------------------------------------------------------------- # add_library(AGAPRO_TreeBuilder SHARED ${sources}) # target_link_libraries(AGAPRO_TreeBuilder ${EXTRA_EXTERNAL_LIBRARIES} ${EXTRA_INTERNAL_LIBRARIES}) # set_target_properties(AGAPRO_TreeBuilder PROPERTIES ${AGAPRO_LIBRARY_PROPERTIES}) # install(TARGETS AGAPRO_TreeBuilder 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()