-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
71 lines (64 loc) · 2.13 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
# Cleaver library
find_library(CLEAVER_LIBRARY NAMES cleaver)
if(NOT CLEAVER_LIBRARY)
message(FATAL_ERROR "Could not find Cleaver library")
endif()
message(STATUS "Found Cleaver library at: ${CLEAVER_LIBRARY}")
# Cleaver include directory
find_path(CLEAVER_INCLUDE_DIR cleaver/Cleaver.h)
if(NOT CLEAVER_INCLUDE_DIR)
message(FATAL_ERROR "Could not find Cleaver include directory")
endif()
message(STATUS "Found Cleaver include directory: ${CLEAVER_INCLUDE_DIR}")
# JsonCpp library
if(NOT DEFINED CLEAVER_JsonCpp_LIBRARY)
set(CLEAVER_JsonCpp_LIBRARY ${CLEAVER_LIBRARY})
cmake_path(REMOVE_FILENAME CLEAVER_JsonCpp_LIBRARY)
if(WIN32)
cmake_path(APPEND CLEAVER_JsonCpp_LIBRARY "jsoncpp.lib")
elseif(APPLE)
cmake_path(APPEND CLEAVER_JsonCpp_LIBRARY "libjsoncpp.a")
else()
cmake_path(APPEND CLEAVER_JsonCpp_LIBRARY "libjsoncpp.a")
endif()
endif()
if(NOT CLEAVER_JsonCpp_LIBRARY)
message(FATAL_ERROR "Could not find Cleaver JsonCpp library")
endif()
message(STATUS "Found Cleaver JsonCpp library at: ${CLEAVER_JsonCpp_LIBRARY}")
# JsonCpp include directory
if(NOT DEFINED CLEAVER_JsonCpp_INCLUDE_DIR)
set(CLEAVER_JsonCpp_INCLUDE_DIR ${CLEAVER_INCLUDE_DIR})
endif()
if(NOT CLEAVER_JsonCpp_INCLUDE_DIR)
message(FATAL_ERROR "Could not find Cleaver JsonCpp include directory")
endif()
message(STATUS "Found Cleaver JsonCpp include directory at: ${CLEAVER_JsonCpp_INCLUDE_DIR}")
# Cleaver target
add_library(Cleaver::Cleaver UNKNOWN IMPORTED)
set_target_properties(Cleaver::Cleaver PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CLEAVER_INCLUDE_DIR}"
)
set_property(TARGET Cleaver::Cleaver APPEND PROPERTY
IMPORTED_LOCATION "${CLEAVER_LIBRARY}"
)
# JsonCpp target
add_library(Cleaver::JsonCpp UNKNOWN IMPORTED)
set_target_properties(Cleaver::JsonCpp PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CLEAVER_JsonCpp_INCLUDE_DIR}"
)
set_property(TARGET Cleaver::JsonCpp APPEND PROPERTY
IMPORTED_LOCATION "${CLEAVER_JsonCpp_LIBRARY}"
)
# VTK module
set(classes
vtkCleaverImageToUnstructuredGridFilter
)
vtk_module_add_module(VTK::Cleaver
CLASSES ${classes}
)
vtk_module_link(VTK::Cleaver
PUBLIC
Cleaver::Cleaver
Cleaver::JsonCpp
)