CMakeLists.txt 2.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
cmake_minimum_required(VERSION 3.0)
project(AculUtils)


# Find ROOT package
find_package(ROOT REQUIRED)

# Add include directories for ROOT
include_directories(${ROOT_INCLUDE_DIRS})
# Print the value of ROOT_INCLUDE_DIRS
message(STATUS "ROOT include directories: ${ROOT_INCLUDE_DIRS}")
# message(STATUS "target_link_libraries(TELoss): ${ROOT_LIBRARIES}")

# include_directories(TELoss)

# Add the TELoss directory
add_subdirectory(TELoss)

# Add the "TELoss" directory to the include path
# include_directories(TELoss)

# Add the source files
# set(SOURCES
#     TELoss/TELoss.cpp
#     TELoss/TELoss.h
#     TELoss/linkdef.h
# )

# # Add the Fortran source file
# set(FORTRAN_SOURCES
#     TELoss/ELOSS.f90
# )

# Set the output directory for the dictionary files
# set(GEN_DICT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/TELoss)
set(GEN_DICT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
message(STATUS "CMAKE_CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}")
message(STATUS "GEN_DICT_OUTPUT_DIR: ${GEN_DICT_OUTPUT_DIR}")

# Generate dictionary for TELoss class

# #working
# ROOT_GENERATE_DICTIONARY(G__TELoss ${CMAKE_CURRENT_SOURCE_DIR}/TELoss/TELoss.h
#     LINKDEF TELoss/TELossLinkDef.h)

message(STATUS "CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}")

# ROOT_GENERATE_DICTIONARY(G__TELoss TELoss/TELoss.h LINKDEF TELoss/linkdef.h OPTIONS -I${CMAKE_CURRENT_SOURCE_DIR}/TELoss -o ${CMAKE_CURRENT_BINARY_DIR}/TELoss)

# ROOT_GENERATE_DICTIONARY(G__TELoss ${CMAKE_CURRENT_SOURCE_DIR}/TELoss/TELoss.h 
#  LINKDEF TELoss/TELossLinkDef.h 
#  OPTIONS -I${CMAKE_CURRENT_SOURCE_DIR}/TELoss -o ${GEN_DICT_OUTPUT_DIR})

# ROOT_GENERATE_DICTIONARY(G__TELoss ${CMAKE_CURRENT_SOURCE_DIR}/TELoss/TELoss.h 
#     # MODULE TELoss
#     # LINKDEF ${CMAKE_CURRENT_SOURCE_DIR}/TELoss/TELossLinkDef.h 
#     LINKDEF TELoss/TELossLinkDef.h
#     OPTIONS -o ${GEN_DICT_OUTPUT_DIR})


# Add the dictionary source file to the sources list
# list(APPEND SOURCES ${CMAKE_CURRENT_BINARY_DIR}/G__TELoss.cxx)
# list(APPEND SOURCES ${GEN_DICT_OUTPUT_DIR}/G__TELoss.cxx)
message(STATUS "SOURCES: ${SOURCES}")

# Add an executable target for the C++ class
# add_library(TELoss SHARED TELoss/TELoss.cpp TELoss/TELoss.h TELoss/linkdef.h TELoss/ELOSS.f90 ${GEN_DICT_OUTPUT_DIR}/G__TELoss.cxx)

#working
# add_library(TELoss SHARED TELoss/TELoss.cpp TELoss/TELoss.h TELoss/TELossLinkDef.h TELoss/ELOSS.f90 G__TELoss.cxx)

# add_library(TELoss SHARED ${SOURCES} ${FORTRAN_SOURCES})

# Link ROOT libraries
# target_link_libraries(TELoss ${ROOT_LIBRARIES})
# target_link_libraries(TELoss PUBLIC ROOT::Core)

# Set compiler flags for Fortran source
# enable_language(Fortran)
# set_source_files_properties(${FORTRAN_SOURCES} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/modules)