forked from jmcmellen/splat
-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
34 lines (28 loc) · 1.06 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
cmake_minimum_required(VERSION 3.10)
project(splat VERSION 2.0)
# specify the C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_FLAGS "-O3 -Wall -ffast-math")
set(CMAKE_C_FLAGS "-O3 -Wall -ffast-math") # required for optimization of itwom3.c until it is ported to C++
if(WIN32)
add_definitions(-DHAVE_LIBPNG)
set(SHAREDIR ".")
set(DOCDIR "docs")
elseif(APPLE)
add_definitions(-DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBGDAL)
set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}")
set(DOCDIR "share/docs/${PROJECT_NAME}")
set(MANDIR "share/man")
# See https://stackoverflow.com/questions/36523911/osx-homebrew-cmake-libpng-version-mismatch-issue
set(CMAKE_FIND_FRAMEWORK LAST)
elseif(UNIX) # Linux, BSD etc
add_definitions(-DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBGDAL)
set(SHAREDIR "share/${PROJECT_NAME}")
set(DOCDIR "share/docs/${PROJECT_NAME}")
set(MANDIR "share/man")
endif()
add_subdirectory(src)
add_subdirectory(utils)
add_subdirectory(docs)
install(DIRECTORY sample_data DESTINATION "${SHAREDIR}")