-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
56 lines (38 loc) · 1.33 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
cmake_minimum_required(VERSION 2.8)
project(platform-independent-layer)
set(SYS_LIB_LIST "")
# platform config
if(WIN32)
set(PLATFORM_WIN32 ON)
set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/deploy/win32" CACHE PATH "Project install directory" FORCE)
elseif(UNIX)
set(PLATFORM_LINUX ON)
set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/deploy/linux" CACHE PATH "Project install directory" FORCE)
# Use C++11 in linux
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++0x")
link_directories(/usr/include/X11)
SET(SYS_LIB_LIST ${SYS_LIB_LIST} "X11")
endif()
# option
option(BUILD_EXAMPLES "build examples" ON)
option(PIL_STATIC "build static lib" FALSE)
set(PIL_STATIC_LIB 0)
if(PIL_STATIC)
set(PIL_LIB_TYPE STATIC)
set(PIL_STATIC_LIB 1)
else()
set(PIL_LIB_TYPE SHARED)
endif()
configure_file(
"${PROJECT_SOURCE_DIR}/platform/PILConfig.h.in"
"${PROJECT_BINARY_DIR}/include/PILConfig.h"
)
set(PLATFORM_INDEP_LAYER_INC ${PROJECT_SOURCE_DIR}/platform)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
link_directories(${PROJECT_BINARY_DIR}/lib)
include_directories(${PLATFORM_INDEP_LAYER_INC})
include_directories(${PROJECT_BINARY_DIR}/include)
add_subdirectory(platform)
add_subdirectory(examples)