forked from apache/incubator-retired-corinthia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
88 lines (71 loc) · 3.03 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
87
88
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###
## global definitions
###
cmake_minimum_required(VERSION 3.1)
project(Corinthia)
message("Source directory is " ${CMAKE_SOURCE_DIR})
message("Build directory is " ${CMAKE_BINARY_DIR})
# Make sure we're not building in the root of the source tree
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR
"
Building in the source directory is not supported. Instead, you should
create another directory specifically for the build. For example:
mkdir ~/build/corinthia
cd ~/build/corinthia
cmake -G \"${CMAKE_GENERATOR}\" ${CMAKE_SOURCE_DIR}
Before this will work, you should delete CMakeCache.txt and
the CMakeFiles directory that were just generated in the source
directory.")
endif()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
set(LIBS )
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_library(FOUNDATION_LIBRARY Foundation)
find_library(IMAGEIO_LIBRARY ImageIO)
set(INCLUDE_DIRS /usr/include/libxml2)
set(LIBS ${LIBS} xml2 z ${FOUNDATION_LIBRARY} ${IMAGEIO_LIBRARY})
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_C_FLAGS "-std=c99 -D_GNU_SOURCE -g -fPIC")
set(INCLUDE_DIRS /usr/include/libxml2)
set(LIBS ${LIBS} m pthread xml2 z SDL2 SDL2_image)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(INCLUDE_DIRS ${CMAKE_BINARY_DIR}/target_include)
set(LIB_DIRS ${CMAKE_BINARY_DIR}/target_lib)
set(CMAKE_C_FLAGS "/DWIN64 /D_WINDOWS /W3 /wd4090 /wd4996")
if(${CMAKE_GENERATOR_PLATFORM} MATCHES "x64")
set(LIBS ${LIBS} libxml2_64 zlibwapi64 SDL2_64 SDL2_image_64)
else(${CMAKE_GENERATOR_PLATFORM} MATCHES "x64")
set(LIBS ${LIBS} libxml2 zlibwapi SDL2 SDL2_image)
endif(${CMAKE_GENERATOR_PLATFORM} MATCHES "x64")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
###
## run subprojects
###
add_subdirectory(DocFormats)
add_subdirectory(consumers/dftest/src)
add_subdirectory(consumers/dfconvert/src)
add_subdirectory(consumers/dfutil/src)
if(DEFINED NONCONFORM_APACHE)
add_subdirectory(consumers/corinthia/src)
endif(DEFINED NONCONFORM_APACHE)
add_subdirectory(experiments/flat/src)