1
0
mirror of synced 2024-11-12 16:08:53 +01:00
modern-cmake/examples/root-dict/CMakeLists.txt

31 lines
867 B
CMake
Raw Normal View History

2018-03-28 22:48:45 +02:00
## [main]
2018-03-28 20:50:38 +02:00
cmake_minimum_required(VERSION 3.1)
2018-03-29 12:27:23 +02:00
project(RootDictExample LANGUAGES CXX)
2018-03-28 20:50:38 +02:00
find_package(ROOT CONFIG REQUIRED)
include("${ROOT_DIR}/modules/RootNewMacros.cmake")
message(STATUS "Found ROOT: ${ROOT_VERSION} at ${ROOT_DIR}")
2018-03-29 19:30:00 +02:00
separate_arguments(ROOT_CXX_FLAGS)
2018-03-28 20:50:38 +02:00
set_target_properties(ROOT::Core PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${ROOT_INCLUDE_DIRS}"
2018-03-29 19:30:00 +02:00
INTERFACE_COMPILE_OPTIONS "${ROOT_CXX_FLAGS}"
2018-03-28 20:50:38 +02:00
)
include_directories(ROOT_BUG)
2018-03-29 12:27:23 +02:00
root_generate_dictionary(G__DictExample DictExample.h LINKDEF DictLinkDef.h)
2018-03-28 20:50:38 +02:00
2018-03-29 12:27:23 +02:00
add_library(DictExample SHARED DictExample.cxx DictExample.h G__DictExample.cxx)
target_link_libraries(DictExample PUBLIC ROOT::Core)
2018-03-28 20:50:38 +02:00
2018-03-28 22:48:45 +02:00
## [main]
2018-03-29 12:27:23 +02:00
enable_testing()
add_test(NAME RootDictExample
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMAND "${ROOT_root_CMD}" -b -l -q "${CMAKE_CURRENT_SOURCE_DIR}/CheckLoad.C")