This repository has been archived by the owner on Mar 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (42 loc) · 1.95 KB
/
CMakeLists.txt
1
2
3
4
5
6
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#-----------------------------------------------------------------------------#
#/*!
# * \file CMakeLists.txt
# * \author Stefano Tognini
# * \brief CMakeLists for the H5ToRoot package within the Celeritas Project.
# * \note Copyright (c) 2020 Oak Ridge National Laboratory, UT-Battelle, LLC.
# */
#-----------------------------------------------------------------------------#
#------------------------------------------------------------------------------
# Setting up the project
#------------------------------------------------------------------------------
project(H5ToRoot LANGUAGES CXX C)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
#------------------------------------------------------------------------------
# Setting environmental variables
#------------------------------------------------------------------------------
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
#------------------------------------------------------------------------------
# Finding packages
#------------------------------------------------------------------------------
find_package(ROOT REQUIRED)
find_package(HDF5 REQUIRED)
find_package(SCALE COMPONENTS Nemesis)
find_package(MPI REQUIRED COMPONENTS C)
#------------------------------------------------------------------------------
# Adding the executable, and linking it to the needed libraries
#------------------------------------------------------------------------------
add_executable(h5ToRoot main.cpp src/H5ToRoot.cpp include/H5ToRoot.hh)
target_include_directories(h5ToRoot PRIVATE
${HDF5_INCLUDE_DIRS}
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
target_link_libraries(h5ToRoot PRIVATE
ROOT::Core ROOT::Tree
${HDF5_LIBRARIES}
Nemesis
MPI::MPI_C
)
#------------------------------------------------------------------------------
# Installing the executable to the current directory
#------------------------------------------------------------------------------
install(TARGETS h5ToRoot DESTINATION .)