-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
86 lines (73 loc) · 2.46 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
PROJECT("XDMF_GENERATOR")
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)
find_package(HDF5)
if(WIN32)
link_directories("C:/Program Files/H5FDdsm/lib")
endif()
#--------------------------------------------------
# Load ParaView env
#--------------------------------------------------
IF(NOT USE_H5FD_DSM)
FIND_PACKAGE(ParaView REQUIRED)
INCLUDE(${PARAVIEW_USE_FILE})
INCLUDE(${ParaView_DIR}//VTK/ThirdParty/xdmf2/vtkxdmf2/XDMFConfig.cmake)
INCLUDE_DIRECTORIES(${XDMF_INCLUDE_DIRS} ${XDMF_MPI_INCLUDE_PATH} ${XDMF_LIBXML2_INCLUDE})
ENDIF(NOT USE_H5FD_DSM)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/h5dump
${CMAKE_CURRENT_BINARY_DIR}
)
SET(XdmfGenerator_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/h5dump/h5dump.cxx
${CMAKE_CURRENT_SOURCE_DIR}/h5dump/h5tools.c
${CMAKE_CURRENT_SOURCE_DIR}/h5dump/h5tools_ref.c
${CMAKE_CURRENT_SOURCE_DIR}/h5dump/h5tools_str.c
${CMAKE_CURRENT_SOURCE_DIR}/h5dump/h5tools_type.c
${CMAKE_CURRENT_SOURCE_DIR}/h5dump/h5tools_utils.cxx
${CMAKE_CURRENT_SOURCE_DIR}/h5dump/h5trav.c
${CMAKE_CURRENT_SOURCE_DIR}/XdmfGenerator.cxx
${CMAKE_CURRENT_SOURCE_DIR}/XdmfHDFDOM.cxx
${CMAKE_CURRENT_SOURCE_DIR}/FileSeriesFinder.cxx
${CMAKE_CURRENT_SOURCE_DIR}/XdmfDump.cxx
)
IF(VTK_BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
SET(XdmfGenerator_LIBTYPE SHARED)
ELSE(VTK_BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
SET(XdmfGenerator_LIBTYPE STATIC)
ENDIF(VTK_BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
IF (WIN32)
SET(XdmfGenerator_LIBTYPE STATIC)
ENDIF (WIN32)
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/XdmfGeneratorconfig.h.in
${CMAKE_CURRENT_BINARY_DIR}/XdmfGeneratorconfig.h)
ADD_LIBRARY(XdmfGenerator ${XdmfGenerator_LIBTYPE} ${XdmfGenerator_SRCS})
set_target_properties(XdmfGenerator
PROPERTIES
COMPILE_FLAGS "-Dhdf5_tools_EXPORTS"
)
IF(USE_H5FD_DSM)
TARGET_LINK_LIBRARIES(XdmfGenerator H5FDdsm)
ENDIF(USE_H5FD_DSM)
TARGET_LINK_LIBRARIES(XdmfGenerator vtkxdmf2 vtksys)
ADD_EXECUTABLE(XdmfGenerate ${CMAKE_CURRENT_SOURCE_DIR}/XdmfGenerate.cxx)
TARGET_LINK_LIBRARIES(XdmfGenerate XdmfGenerator)
#--------------------------------------------------
# Install
#--------------------------------------------------
INSTALL(
TARGETS
XdmfGenerate
DESTINATION
"${CMAKE_INSTALL_PREFIX}/bin"
)
INSTALL(
TARGETS
XdmfGenerator
DESTINATION
"${CMAKE_INSTALL_PREFIX}/lib/paraview-${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}"
)