forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
134 lines (120 loc) · 4.12 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
cmake_minimum_required(VERSION 3.0)
project(atk C)
set(ATK_LIB_SUFFIX 1.0)
set(ATK_DLL_SUFFIX 1)
set(GLIB_LIB_VERSION 2.0)
if(BUILD_SHARED_LIBS)
set(ATK_EXPORT_MACRO DLL_EXPORT)
endif()
# generate atkmarshal.c and atkmarshal.h source files
# glib-genmarshal should be installed along with glib
find_program(GLIB_GENMARSHAL glib-genmarshal PATH_SUFFIXES glib)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/atk)
message("Generating atkmarshal.h: ${GLIB_GENMARSHAL} --prefix=atk_marshal ${CMAKE_CURRENT_SOURCE_DIR}/atk/atkmarshal.list --header")
execute_process(
COMMAND ${GLIB_GENMARSHAL} --prefix=atk_marshal ${CMAKE_CURRENT_SOURCE_DIR}/atk/atkmarshal.list --header
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/atk
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/atk/atkmarshal.h
)
message("Generating atkmarshal.c: ${GLIB_GENMARSHAL} --prefix=atk_marshal ${CMAKE_CURRENT_SOURCE_DIR}/atk/atkmarshal.list --body")
execute_process(
COMMAND ${GLIB_GENMARSHAL} --prefix=atk_marshal ${CMAKE_CURRENT_SOURCE_DIR}/atk/atkmarshal.list --body
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/atk
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/atk/atkmarshal.c
)
configure_file(config.h.win32 ${CMAKE_CURRENT_BINARY_DIR}/config.h COPYONLY)
add_definitions(-DHAVE_CONFIG_H)
include_directories(. ./atk ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/atk)
find_path(GLIB_INCLUDE_DIR glib.h)
find_library(GLIB_GLIB_LIBRARY glib-${GLIB_LIB_VERSION})
find_library(GLIB_GOBJECT_LIBRARY gobject-${GLIB_LIB_VERSION})
find_library(GLIB_GMODULE_LIBRARY gmodule-${GLIB_LIB_VERSION})
set(GLIB_LIBRARIES ${GLIB_GLIB_LIBRARY} ${GLIB_GOBJECT_LIBRARY} ${GLIB_GMODULE_LIBRARY})
find_path(LIBINTL_INCLUDE_DIR libintl.h)
find_library(LIBINTL_LIBRARY NAMES libintl intl)
set(ATK_SOURCES
atk/atkaction.c
atk/atkcomponent.c
atk/atkdocument.c
atk/atkeditabletext.c
atk/atkgobjectaccessible.c
atk/atkhyperlink.c
atk/atkhyperlinkimpl.c
atk/atkhypertext.c
atk/atkimage.c
atk/atknoopobject.c
atk/atknoopobjectfactory.c
atk/atkobject.c
atk/atkobjectfactory.c
atk/atkplug.c
atk/atkprivate.c
atk/atkrange.c
atk/atkregistry.c
atk/atkrelation.c
atk/atkrelationset.c
atk/atkselection.c
atk/atksocket.c
atk/atkstate.c
atk/atkstateset.c
atk/atkstreamablecontent.c
atk/atktable.c
atk/atktablecell.c
atk/atktext.c
atk/atkutil.c
atk/atkmisc.c
atk/atkvalue.c
atk/atkversion.c
atk/atkwindow.c
atk/atk-enum-types.c)
add_library(atk ${ATK_SOURCES})
target_compile_definitions(atk PRIVATE ATK_COMPILATION ${ATK_EXPORT_MACRO} G_DISABLE_SINGLE_INCLUDES ATK_LOCALEDIR="/dummy/share/locale")
target_link_libraries(atk ${LIBINTL_LIBRARY} ${GLIB_LIBRARIES})
target_include_directories(atk PRIVATE ${GLIB_INCLUDE_DIR} ${LIBINTL_INCLUDE_DIR})
set_target_properties(atk PROPERTIES
OUTPUT_NAME atk-${ATK_DLL_SUFFIX}
ARCHIVE_OUTPUT_NAME atk-${ATK_LIB_SUFFIX})
install(TARGETS atk RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
if(NOT ATK_SKIP_HEADERS)
install(FILES
atk/atk.h
atk/atkaction.h
atk/atkcomponent.h
atk/atkdocument.h
atk/atkeditabletext.h
atk/atkgobjectaccessible.h
atk/atkhyperlink.h
atk/atkhyperlinkimpl.h
atk/atkhypertext.h
atk/atknoopobject.h
atk/atknoopobjectfactory.h
atk/atkobject.h
atk/atkobjectfactory.h
atk/atkplug.h
atk/atkimage.h
atk/atkrange.h
atk/atkregistry.h
atk/atkrelation.h
atk/atkrelationtype.h
atk/atkrelationset.h
atk/atkselection.h
atk/atksocket.h
atk/atkstate.h
atk/atkstateset.h
atk/atkstreamablecontent.h
atk/atktable.h
atk/atktablecell.h
atk/atktext.h
atk/atkutil.h
atk/atkmisc.h
atk/atkvalue.h
atk/atkwindow.h
atk/atkversion.h
atk/atk-enum-types.h
atk/atkversion.h
DESTINATION include/atk)
endif()
message(STATUS "Link-time dependencies:")
message(STATUS " " ${LIBINTL_LIBRARY})
foreach(GL ${GLIB_LIBRARIES})
message(STATUS " " ${GL})
endforeach()