CMakeLists.txt 1.7 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
find_package(ROOT REQUIRED COMPONENTS Net Netx Tree XMLIO)
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
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
34
    TJAlienResultRewriter.cxx
35
    TJAlienSAXHandler.cxx
Nikola Hardi's avatar
Nikola Hardi committed
36
37
38
39
40
    TJAlienSystem.cxx
    TJAlienCredentials.cxx
    TJClientFile.cxx
    TJAlienDNSResolver.cxx
    )
41
42
string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
43
include_directories(${LIBNAME} ${OPENSSL_INCLUDE_DIR})
44
45
46
47
48
49
50
51
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)