-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
111 lines (95 loc) · 3.05 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
project(cairomm)
cmake_minimum_required(VERSION 3.4)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build/cmake")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
#get cairomm version
file (STRINGS "configure.ac" CONFIGURE_AC_INIT REGEX "AC_INIT\\(\\[cairomm\\], \\[.*\\].*" )
string(REGEX REPLACE "AC_INIT\\(\\[.*\\], \\[([0-9]+\\.[0-9]+\\.[0-9]+)\\].*" "\\1" VERSION ${CONFIGURE_AC_INIT})
string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" CAIROMM_MAJOR_VERSION ${VERSION})
string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" CAIROMM_MINOR_VERSION ${VERSION})
string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" CAIROMM_MICRO_VERSION ${VERSION})
message(STATUS "Ciaromm version: ${CAIROMM_MAJOR_VERSION}.${CAIROMM_MINOR_VERSION}.${CAIROMM_MICRO_VERSION}")
find_package(Cairo REQUIRED)
find_package(SigC++ REQUIRED)
#configure
option(BUILD_SHARED_LIBS "Build the shared library" ON)
option(CAIROMM_ENABLE_API_EXCEPTIONS "enable API exceptions" ON)
if(CAIROMM_ENABLE_API_EXCEPTIONS)
set(CAIROMM_EXCEPTIONS_ENABLED ON)
else()
set(CAIROMM_EXCEPTIONS_ENABLED OFF)
endif()
configure_file("build/cmake/cairommconfig.h.cmake" "cairommconfig.h")
configure_file("build/cmake/cairomm.rc.cmake" "cairomm.rc" @ONLY)
#build
set(cairomm_cc
cairomm/context.cc
cairomm/context_surface_quartz.cc
cairomm/context_surface_win32.cc
cairomm/context_surface_xlib.cc
cairomm/device.cc
cairomm/exception.cc
cairomm/fontface.cc
cairomm/fontoptions.cc
cairomm/matrix.cc
cairomm/path.cc
cairomm/pattern.cc
cairomm/private.cc
cairomm/quartz_font.cc
cairomm/quartz_surface.cc
cairomm/region.cc
cairomm/scaledfont.cc
cairomm/script.cc
cairomm/script_surface.cc
cairomm/surface.cc
cairomm/win32_font.cc
cairomm/win32_surface.cc
cairomm/xlib_surface.cc)
set(cairomm_public_h
cairomm/cairomm.h
cairomm/context.h
cairomm/device.h
cairomm/enums.h
cairomm/exception.h
cairomm/fontface.h
cairomm/fontoptions.h
cairomm/matrix.h
cairomm/path.h
cairomm/pattern.h
cairomm/quartz_font.h
cairomm/quartz_surface.h
cairomm/refptr.h
cairomm/region.h
cairomm/scaledfont.h
cairomm/script.h
cairomm/script_surface.h
cairomm/surface.h
cairomm/types.h
cairomm/win32_font.h
cairomm/win32_surface.h
cairomm/xlib_surface.h)
set(cairomm_private_h
cairomm/context_private.h
cairomm/private.h)
set(cairomm_rc
${CMAKE_BINARY_DIR}/cairomm.rc)
add_library(cairomm-1.0 ${cairomm_cc} ${cairomm_rc})
target_link_libraries(cairomm-1.0 ${CAIRO_LIBRARY} ${SIGC++_LIBRARY} )
target_include_directories(cairomm-1.0 PRIVATE
${CAIRO_INCLUDE_DIR}
${SIGC++_INCLUDE_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR})
install(
TARGETS cairomm-1.0
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
install(
FILES ${cairomm_public_h}
DESTINATION include/cairomm)
install(
FILES ${CMAKE_BINARY_DIR}/cairommconfig.h
DESTINATION include)