CMakeLists.txt 6.61 KB
Newer Older
Jørgen Lind's avatar
Jørgen Lind committed
1
set(SOURCE_FILES
Jørgen Lind's avatar
Jørgen Lind committed
2
  OpenVDS.cpp
3
4
5
  IO/File.cpp
  IO/Linux_File.cpp
  IO/Win_File.cpp
Jørgen Lind's avatar
Jørgen Lind committed
6
7
  IO/IOManager.cpp
  IO/IOManagerAWS.cpp
Jørgen Lind's avatar
Jørgen Lind committed
8
  IO/IOManagerAzure.cpp
9
  VDS/VolumeDataPartition.cpp
10
  VDS/VolumeDataChannelMapping.cpp
11
  VDS/VolumeDataLayer.cpp
12
  VDS/VolumeDataLayoutImpl.cpp
13
14
  VDS/VolumeDataRegion.cpp
  VDS/VolumeDataHash.cpp
15
  VDS/VolumeDataPageAccessorImpl.cpp
16
  VDS/VolumeDataAccessManagerImpl.cpp
17
  VDS/VolumeDataPageImpl.cpp
18
  VDS/VolumeDataAccessor.cpp
19
  VDS/DimensionGroup.cpp
Jørgen Lind's avatar
Jørgen Lind committed
20
  VDS/ParseVDSJson.cpp
21
  VDS/MetadataManager.cpp
Jørgen Lind's avatar
Jørgen Lind committed
22
  VDS/Base64.cpp
23
24
  VDS/VolumeDataStore.cpp
  VDS/Wavelet.cpp
Jørgen Lind's avatar
Jørgen Lind committed
25
26
27
28
  VDS/WaveletAdaptiveLL.cpp
  VDS/DataBlock.cpp
  VDS/FSE/entropy_common.cpp
  VDS/FSE/fse_decompress.cpp
Jørgen Lind's avatar
Jørgen Lind committed
29
  VDS/Rle.cpp
Jørgen Lind's avatar
Jørgen Lind committed
30
  VDS/VolumeDataRequestProcessor.cpp
Jørgen Lind's avatar
Jørgen Lind committed
31
  )
Jørgen Lind's avatar
Jørgen Lind committed
32
33

set (PRIVATE_HEADER_FILES
34
  IO/File.h
Jørgen Lind's avatar
Jørgen Lind committed
35
36
  IO/IOManager.h
  IO/IOManagerAWS.h
Jørgen Lind's avatar
Jørgen Lind committed
37
  IO/IOManagerAzure.h
Jørgen Lind's avatar
Jørgen Lind committed
38
  VDS/VDS.h
39
  VDS/VolumeDataPartition.h
40
  VDS/VolumeDataChannelMapping.h
41
  VDS/VolumeDataLayer.h
42
  VDS/VolumeDataLayoutImpl.h
43
44
45
  VDS/VolumeDataChunk.h
  VDS/VolumeDataRegion.h
  VDS/VolumeDataHash.h
46
  VDS/VolumeDataPageAccessorImpl.h
47
  VDS/VolumeDataAccessManagerImpl.h
48
  VDS/VolumeDataAccessor.h
49
  VDS/VolumeDataPageImpl.h
50
51
  VDS/DimensionGroup.h
  VDS/Hash.h
52
  VDS/Bitmask.h
Jørgen Lind's avatar
Jørgen Lind committed
53
  VDS/ParseVDSJson.h
54
  VDS/MetadataManager.h
55
  VDS/IntrusiveList.h
Jørgen Lind's avatar
Jørgen Lind committed
56
  VDS/Base64.h
57
  VDS/VolumeDataStore.h
Jørgen Lind's avatar
Jørgen Lind committed
58
59
60
61
62
63
64
65
66
67
  VDS/Wavelet.h
  VDS/WaveletAdaptiveLL.h
  VDS/WaveletTypes.h
  VDS/DataBlock.h
  VDS/WaveletSSETransform.h
  VDS/FSE/bitstream.h
  VDS/FSE/error_private.h
  VDS/FSE/error_public.h
  VDS/FSE/mem.h
  VDS/FSE/fse.h
Jørgen Lind's avatar
Jørgen Lind committed
68
  VDS/Rle.h
Jørgen Lind's avatar
Jørgen Lind committed
69
  VDS/VolumeDataRequestProcessor.h
Jørgen Lind's avatar
Jørgen Lind committed
70
  VDS/ThreadPool.h
Jørgen Lind's avatar
Jørgen Lind committed
71
  )
Jørgen Lind's avatar
Jørgen Lind committed
72
73

set (EXPORTED_HEADER_FILES
74
  OpenVDS/GlobalMetadataCommon.h
75
  OpenVDS/KnownMetadata.h
76
  OpenVDS/Metadata.h
77
78
79
80
81
  OpenVDS/OpenVDS.h
  OpenVDS/openvds_export.h
  OpenVDS/Range.h
  OpenVDS/ValueConversion.h
  OpenVDS/Vector.h
Jørgen Lind's avatar
Jørgen Lind committed
82
  OpenVDS/VolumeData.h
83
  OpenVDS/VolumeDataAccess.h
84
85
  OpenVDS/VolumeDataAxisDescriptor.h
  OpenVDS/VolumeDataChannelDescriptor.h
86
  OpenVDS/VolumeDataLayout.h
87
88
89
  OpenVDS/VolumeDataLayoutDescriptor.h
  OpenVDS/VolumeSampler.h
  )
90

91
add_library(openvds_objects OBJECT
Jørgen Lind's avatar
Jørgen Lind committed
92
93
94
  ${PRIVATE_HEADER_FILES}
  ${EXPORTED_HEADER_FILES}
  ${SOURCE_FILES})
Jørgen Lind's avatar
Jørgen Lind committed
95

96
97
98
99
100
101
102
103
104
105
106
107
108
function(compileInTarget to_target source_target)
  get_target_property(src_sources ${source_target} SOURCES)
  get_target_property(src_include ${source_target} INTERFACE_INCLUDE_DIRECTORIES)
  get_target_property(src_dir ${source_target} SOURCE_DIR)
  foreach (src_file ${src_sources})
    set(complete_file "${src_dir}/${src_file}")
    target_sources(${to_target} PRIVATE ${complete_file})
  endforeach()
  target_include_directories(${to_target} PRIVATE ${src_include})
endfunction()

compileInTarget(openvds_objects fmt::fmt)
compileInTarget(openvds_objects jsoncpp_lib_static)
109
110
111
112
113

if(MSVC_VERSION)
  set_source_files_properties(VDS/VolumeDataAccessor.cpp PROPERTIES COMPILE_FLAGS /bigobj)
endif()

114
115
get_property(link_3rdparty_release GLOBAL PROPERTY OPENVDS_LINK_LIBRARIES_RELEASE)
get_property(link_3rdparty_debug   GLOBAL PROPERTY OPENVDS_LINK_LIBRARIES_DEBUG)
116
117
get_property(runtime_3rdparty_release GLOBAL PROPERTY OPENVDS_RUNTIME_LIBS_RELEASE)
get_property(runtime_3rdparty_debug   GLOBAL PROPERTY OPENVDS_RUNTIME_LIBS_DEBUG)
118
119
get_property(include_3rdparty      GLOBAL PROPERTY OPENVDS_INCLUDE_LIBRARIES)

120
add_dependencies(openvds_objects aws-cpp-sdk azure-storage)
121

Jørgen Lind's avatar
Jørgen Lind committed
122
target_include_directories(openvds_objects SYSTEM PRIVATE ${include_3rdparty} "${CMAKE_CURRENT_SOURCE_DIR}")
123
124
target_compile_definitions(openvds_objects PRIVATE openvds_EXPORTS)

125
target_link_libraries(openvds_objects PUBLIC Threads::Threads)
Jørgen Lind's avatar
Jørgen Lind committed
126

127
if (aws-cpp-sdk_EXTERNAL_LIBS)
128
  target_link_libraries(openvds_objects PUBLIC ${aws-cpp-sdk_EXTERNAL_LIBS})
129
endif()
130
target_link_libraries(openvds_objects PUBLIC $<$<NOT:$<CONFIG:Debug>>:${link_3rdparty_release}> $<$<CONFIG:Debug>:${link_3rdparty_debug}>)
131

Andrew K's avatar
Andrew K committed
132
133
134
# this need to be explicitly included on centos7 for some reason
target_link_libraries(openvds_objects PUBLIC "ssl")

Jørgen Lind's avatar
Jørgen Lind committed
135
136
137
138
139
#Azure storage exposes boost_system on linux et al.
if (UNIX)
    target_link_libraries(openvds_objects PUBLIC boost_system)
endif()

Jørgen Lind's avatar
Jørgen Lind committed
140
if (OpenMP_CXX_FOUND)
141
    target_link_libraries(openvds_objects PUBLIC OpenMP::OpenMP_CXX)
142
endif()
Jørgen Lind's avatar
Jørgen Lind committed
143
144
145
146
147

if (BUILD_ZLIB)
  add_dependencies(openvds_objects zlib)
else()
  find_package(ZLIB REQUIRED)
148
  target_link_libraries(openvds_objects PUBLIC ZLIB::ZLIB)
Jørgen Lind's avatar
Jørgen Lind committed
149
endif()
Jørgen Lind's avatar
Jørgen Lind committed
150

Jørgen Lind's avatar
Jørgen Lind committed
151
if (WIN32)
152
  set_source_files_properties(IO/Linux_File.cpp PROPERTIES HEADER_FILE_ONLY TRUE)
Jørgen Lind's avatar
Jørgen Lind committed
153
elseif (UNIX)
154
  set_source_files_properties(IO/Win_File.cpp PROPERTIES HEADER_FILE_ONLY TRUE)
Jørgen Lind's avatar
Jørgen Lind committed
155
endif()
Jørgen Lind's avatar
Jørgen Lind committed
156
157

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
Jørgen Lind's avatar
Jørgen Lind committed
158
  set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR}/Dist/OpenVDS CACHE STRING "" FORCE)
Jørgen Lind's avatar
Jørgen Lind committed
159
160
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

161
add_library(openvds $<TARGET_OBJECTS:openvds_objects>)
162
target_link_libraries(openvds openvds_objects)
Jørgen Lind's avatar
Jørgen Lind committed
163
set_target_properties(openvds
Jørgen Lind's avatar
Jørgen Lind committed
164
165
166
167
168
169
170
  PROPERTIES
  FRAMEWORK ON
  SOVERSION 0
  VERSION 0.1.0
  PUBLIC_HEADER "${EXPORTED_HEADER_FILES}"
  PRIVATE_HEADER "${PRIVATE_HEADER_FILES}"
  #OUTPUT_NAME ${PROJECT_NAME}
Jørgen Lind's avatar
Jørgen Lind committed
171
)
172
173
174
175
176
target_include_directories(openvds
    PUBLIC
        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
        $<INSTALL_INTERFACE:include>
)
Jørgen Lind's avatar
Jørgen Lind committed
177

178
179
if (${MSVC_TOOLSET_VERSION_LOCAL})
  set(LIB_TOOLSET_DIR "/msvc_${MSVC_TOOLSET_VERSION_LOCAL}")
Jørgen Lind's avatar
Jørgen Lind committed
180
181
endif()

182
install(TARGETS openvds openvds_objects
183
  EXPORT openvds-export
Jørgen Lind's avatar
Jørgen Lind committed
184
  ARCHIVE
185
    DESTINATION ${CMAKE_INSTALL_LIBDIR}${LIB_TOOLSET_DIR}
Jørgen Lind's avatar
Jørgen Lind committed
186
  LIBRARY
187
    DESTINATION ${CMAKE_INSTALL_LIBDIR}${LIB_TOOLSET_DIR}
Jørgen Lind's avatar
Jørgen Lind committed
188
  RUNTIME
189
    DESTINATION ${CMAKE_INSTALL_BINDIR}${LIB_TOOLSET_DIR}
Jørgen Lind's avatar
Jørgen Lind committed
190
191
  FRAMEWORK
    DESTINATION framework
Jørgen Lind's avatar
Jørgen Lind committed
192
  PUBLIC_HEADER
193
    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/OpenVDS
Jørgen Lind's avatar
Jørgen Lind committed
194
  PRIVATE_HEADER
195
    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/OpenVDS/private)
Jørgen Lind's avatar
Jørgen Lind committed
196

197
198
199
200
201
202
203
install(
    EXPORT openvds-export
    NAMESPACE openvds::
    DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/openvds/cmake
    FILE openvds-config.cmake
)

204
205
206
207
208
install(FILES ${link_3rdparty_release} CONFIGURATIONS Release RelWithDebInfo MinSizeRel DESTINATION ${CMAKE_INSTALL_LIBDIR}${LIB_TOOLSET_DIR})
install(FILES ${link_3rdparty_debug} CONFIGURATIONS Debug DESTINATION ${CMAKE_INSTALL_LIBDIR}${LIB_TOOLSET_DIR})
install(FILES ${runtime_3rdparty_release} CONFIGURATIONS Release RelWithDebInfo MinSizeRel DESTINATION ${CMAKE_INSTALL_BINDIR}${LIB_TOOLSET_DIR})
install(FILES ${runtime_3rdparty_debug} CONFIGURATIONS Debug DESTINATION ${CMAKE_INSTALL_BINDIR}${LIB_TOOLSET_DIR})

209
210
211
212
213
214
215
216
217
export(
    TARGETS
        openvds
        openvds_objects
    NAMESPACE
        openvds::
    FILE
        openvds-config.cmake
)
218
219
220
221

set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ${CMAKE_INSTALL_BINDIR}${LIB_TOOLSET_DIR})
include (InstallRequiredSystemLibraries)

222
223
set(OPENVDS_LIB_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "")

Jørgen Lind's avatar
Jørgen Lind committed
224
add_subdirectory(SEG-Y)