############################################################################ # CMakeLists.txt file for building TELoss package ############################################################################ # include_directories(TELoss) # Get the list of include directories get_property(INCLUDE_DIRS DIRECTORY PROPERTY INCLUDE_DIRECTORIES) # Print the include directories message(STATUS "Include directories: ${INCLUDE_DIRS}") message(STATUS "CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}") message(STATUS "CMAKE_CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}") # Add the source files specific to the TELoss module set(SOURCES TELoss.cpp TELoss.h TELossLinkDef.h ) # Add the Fortran source file set(FORTRAN_SOURCES ELOSS.f90 ) # Generate dictionary for TELoss class ROOT_GENERATE_DICTIONARY( G__TELoss ${CMAKE_CURRENT_SOURCE_DIR}/TELoss.h LINKDEF ${CMAKE_CURRENT_SOURCE_DIR}/TELossLinkDef.h) # Add the dictionary source file to the sources list list(APPEND SOURCES ${CMAKE_CURRENT_BINARY_DIR}/G__TELoss.cxx) # Create a library target for the TELoss module add_library(TELoss SHARED ${SOURCES} ${FORTRAN_SOURCES}) # Link against ROOT libraries target_link_libraries(TELoss ${ROOT_LIBRARIES}) # Set compiler flags for Fortran source enable_language(Fortran) set_source_files_properties(${FORTRAN_SOURCES} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/modules) # install(FILES ${CMAKE_CURRENT_BINARY_DIR}/G__AculData.cxx DESTINATION ${CMAKE_BINARY_DIR}/include) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libTELoss.rootmap DESTINATION ${CMAKE_BINARY_DIR}/lib) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libTELoss_rdict.pcm DESTINATION ${CMAKE_BINARY_DIR}/lib) install(TARGETS TELoss LIBRARY DESTINATION ${CMAKE_BINARY_DIR}/lib ARCHIVE DESTINATION ${CMAKE_BINARY_DIR}/lib)