CMakeLists.txt 1.49 KB
Newer Older
1
2
3
4
5
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
project(JAliEn-ROOT CXX)
list(APPEND CMAKE_PREFIX_PATH ${ROOTSYS})
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
find_package(JSONC REQUIRED)
6
find_package(OpenSSL REQUIRED)
7
find_package(libwebsockets REQUIRED)
8
9
find_package(ROOT REQUIRED COMPONENTS Net Netx Tree XMLIO Proof)
find_package(ZLIB REQUIRED)
10
11
12
13
14
15
16
17
18
19
20
21
22
foreach(FEATURE xrootd xml)
  if(NOT ROOT_${FEATURE}_FOUND)
    message(FATAL_ERROR "ROOT was built without ${FEATURE} support (required)")
  endif()
endforeach()
include(${ROOT_USE_FILE})
set(CMAKE_CXX_FLAGS ${ROOT_CXX_FLAGS})
message(STATUS "Using same ROOT CXX flags: ${CMAKE_CXX_FLAGS}")

# This is our library's name
set(LIBNAME JAliEnROOT)

include_directories(${CMAKE_CURRENT_SOURCE_DIR})
23
24
25
26
include_directories(${CMAKE_SOURCE_DIR}/inc)
file(GLOB SRCS "src/*.cxx")
string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
string(REPLACE "src" "inc" HDRS "${HDRS}")
27
include_directories(${LIBNAME} ${OPENSSL_INCLUDE_DIR})
28
29
ROOT_GENERATE_DICTIONARY(G__${LIBNAME} "${HDRS}" LINKDEF LinkDef.h)
add_library(${LIBNAME} SHARED "${SRCS}" G__${LIBNAME}.cxx)
30
target_link_libraries(${LIBNAME} ${ROOT_LIBRARIES} json-c websockets ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES})
31
32
33
34

install(TARGETS ${LIBNAME} LIBRARY DESTINATION lib)
install(FILES ${PROJECT_BINARY_DIR}/lib${LIBNAME}.rootmap DESTINATION lib)
install(FILES ${PROJECT_BINARY_DIR}/lib${LIBNAME}_rdict.pcm DESTINATION lib)
Nikola Hardi's avatar
Nikola Hardi committed
35
install(FILES ${HDRS} DESTINATION include)
36
install(DIRECTORY ${CMAKE_SOURCE_DIR}/etc/plugins DESTINATION etc)