############################################################################ # 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)