CMakeLists.txt 2.67 KB
Newer Older
1 2 3 4 5 6
cmake_minimum_required(VERSION 3.0)
project(AculUtils)

# Find ROOT package
find_package(ROOT REQUIRED)

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
# Set installation prefix
# set(CMAKE_INSTALL_PREFIX "..")

# Set output directories for built targets
# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

message(STATUS "CMAKE_LIBRARY_OUTPUT_DIRECTORY is: ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")


# file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/lib) # prevent mkdir races
# 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)

# message(STATUS "ROOT Configuration \n
# System          ${CMAKE_SYSTEM}
# Processor       ${PROCESSOR} (${CMAKE_SYSTEM_PROCESSOR})
# Build type      ${CMAKE_BUILD_TYPE}
# Install path    ${CMAKE_INSTALL_PREFIX}
# Compiler        ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}
# Compiler flags:
# C               ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${_BUILD_TYPE_UPPER}}
# C++             ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${_BUILD_TYPE_UPPER}}
# Linker flags:
# Executable      ${CMAKE_EXE_LINKER_FLAGS}
# Module          ${CMAKE_MODULE_LINKER_FLAGS}
# Shared          ${CMAKE_SHARED_LINKER_FLAGS}\n")

36 37 38 39
# 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}")
40 41 42
message(STATUS "ROOT_GET_INSTALL_DIR: ${ROOT_GET_INSTALL_DIR}")
# ROOT_GET_INSTALL_DIR
ROOT_GET_INSTALL_DIR(shared_lib_install_dir)
43

44
# Add the subdirectories
45
add_subdirectory(TELoss)
46
add_subdirectory(AculCalib)
47
add_subdirectory(AculData)
48
add_subdirectory(Utilities)
49

50 51 52 53 54 55 56

# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/G__AculData.cxx DESTINATION include)
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libAculData.rootmap DESTINATION lib)
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libAculData_rdict.pcm DESTINATION lib)
# install(TARGETS AculData LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)


57
# Set the output directory for the dictionary files
58 59 60
# set(GEN_DICT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
# set(GEN_DICT_OUTPUT_DIR ${CMAKE_BINARY_DIR})
message(STATUS "GEN_DICT_OUTPUT_DIR: ${GEN_DICT_OUTPUT_DIR}")
61
message(STATUS "CMAKE_CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}")
62 63 64 65
message(STATUS "CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
message(STATUS "GEN_DICT_OUTPUT_DIR: ${GEN_DICT_OUTPUT_DIR}")
message(STATUS "CMAKE_COMMAND: ${CMAKE_COMMAND}")

66 67 68
# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# message(STATUS "CMAKE_LIBRARY_OUTPUT_DIRECTORY: ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
# message(STATUS "shared_lib_install_dir: ${shared_lib_install_dir}")