CMakeLists.txt 1.51 KB
Newer Older
1
2
3
4
5
6
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)
find_package(libwebsockets REQUIRED)
Dario Berzano's avatar
Dario Berzano committed
7
find_package(ROOT REQUIRED COMPONENTS Net Netx Tree)
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
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)

set(SRCS
    TJAlienCollection.cxx
    TJAlien.cxx
    TJAlienDirectory.cxx
    TJAlienFile.cxx
    TJAlienJDL.cxx
    TJAlienJob.cxx
    TJAlienJobStatus.cxx
    TJAlienJobStatusList.cxx
    TJAlienMasterJob.cxx
    TJAlienMasterJobStatus.cxx
    TJAlienPackage.cxx
    TJAlienResult.cxx
    TJAlienSAXHandler.cxx
    TJAlienSystem.cxx)
string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
ROOT_GENERATE_DICTIONARY(G__${LIBNAME} "${HDRS}" LINKDEF LinkDef.h)
add_library(${LIBNAME} SHARED "${SRCS}" G__${LIBNAME}.cxx)
target_link_libraries(${LIBNAME} ${ROOT_LIBRARIES} json-c websockets)

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)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/etc/plugins DESTINATION etc)