-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
57 lines (46 loc) · 2.08 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
cmake_minimum_required(VERSION 3.6)
project(overlayaz)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK REQUIRED gtk+-3.0)
include_directories(${GTK_INCLUDE_DIRS})
link_directories(${GTK_LIBRARY_DIRS})
add_definitions(${GTK_CFLAGS_OTHER})
pkg_check_modules(SQLITE REQUIRED sqlite3)
include_directories(${SQLITE_INCLUDE_DIRS})
link_directories(${SQLITE_LIBRARY_DIRS})
add_definitions(${SQLITE_CFLAGS_OTHER})
pkg_check_modules(JSON-C REQUIRED json-c)
include_directories(${JSON-C_INCLUDE_DIRS})
link_directories(${JSON-C_LIBRARY_DIRS})
add_definitions(${JSON-C_CFLAGS_OTHER})
pkg_check_modules(OSMGPSMAP REQUIRED osmgpsmap-1.0)
include_directories(${OSMGPSMAP_INCLUDE_DIRS})
link_directories(${OSMGPSMAP_LIBRARY_DIRS})
add_definitions(${OSMGPSMAP_CFLAGS_OTHER})
pkg_check_modules(GEXIV2 REQUIRED gexiv2)
include_directories(${GEXIV2_INCLUDE_DIRS})
link_directories(${GEXIV2_LIBRARY_DIRS})
add_definitions(${GEXIV2_CFLAGS_OTHER})
find_program(GLIB_COMPILE_RESOURCES NAMES glib-compile-resources REQUIRED)
execute_process(COMMAND ${GLIB_COMPILE_RESOURCES} --generate-source --sourcedir=${CMAKE_SOURCE_DIR} --target=${CMAKE_BINARY_DIR}/resources.c ${CMAKE_SOURCE_DIR}/icons/icons.xml)
execute_process(COMMAND ${GLIB_COMPILE_RESOURCES} --generate-header --sourcedir=${CMAKE_SOURCE_DIR} --target=${CMAKE_BINARY_DIR}/resources.h ${CMAKE_SOURCE_DIR}/icons/icons.xml)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wno-overlength-strings -pedantic -std=c11")
enable_testing()
set(LIBRARIES
${GTK_LIBRARIES}
${SQLITE_LIBRARIES}
${JSON-C_LIBRARIES}
${OSMGPSMAP_LIBRARIES}
${GEXIV2_LIBRARIES}
m)
add_subdirectory(src)
add_subdirectory(test)
if(NOT MINGW)
install(TARGETS overlayaz DESTINATION bin)
install(FILES overlayaz.desktop DESTINATION share/applications)
install(DIRECTORY icons/ DESTINATION share/icons/hicolor
PATTERN "INFO" EXCLUDE
PATTERN "overlayaz.ico" EXCLUDE
PATTERN "icons.xml" EXCLUDE)
install(CODE "execute_process(COMMAND gtk-update-icon-cache /usr/share/icons/hicolor)")
endif()