forked from Esri/lerc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
46 lines (36 loc) · 1.37 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
cmake_minimum_required(VERSION 3.12)
project(Lerc
DESCRIPTION "Limited Error Raster Compression"
HOMEPAGE_URL "https://github.com/Esri/lerc"
VERSION 3.0.0) # Keep in sync with Lerc_c_api.h
include(GNUInstallDirs)
set(CMAKE_CXX_STANDARD 17)
file(GLOB SOURCES
"src/LercLib/*"
"src/LercLib/Lerc1Decode/*"
"src/LercLib/include/*"
)
# Make an option, defaulting to shared libs, but allow -DBUILD_SHARED_LIBS=OFF
option (BUILD_SHARED_LIBS "Build shared libraries (set to OFF to build static libs)" ON)
# If no SHARED or STATIC is specified explicitly, add_library will honor BUILD_SHARED_LIBS
add_library(Lerc ${SOURCES})
set_target_properties(Lerc
PROPERTIES
PUBLIC_HEADER "src/LercLib/include/Lerc_types.h;src/LercLib/include/Lerc_c_api.h")
if(BUILD_SHARED_LIBS)
set_target_properties(Lerc
PROPERTIES
SOVERSION ${CMAKE_PROJECT_VERSION_MAJOR}
DEFINE_SYMBOL LERC_EXPORTS)
endif()
install(
TARGETS Lerc
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
# Configure and install pkgconfig file
configure_file(Lerc.pc.in ${CMAKE_CURRENT_BINARY_DIR}/Lerc.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Lerc.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)