Clarify: Oldest still-supported Ubuntu LTS release
[appimagekit/gsi.git] / libappimage / CMakeLists.txt
blob652436fd296ac98d08603c775e0e9678bb2962df
1 project(appimagelib)
2 cmake_minimum_required(VERSION 3.5)
4 set(APPIMAGE_MAJOR_VERSION 0)
5 set(APPIMAGE_MINOR_VERSION 1)
6 set(APPIMAGE_PATCH_VERSION 0)
7 set(APPIMAGE_VERSION
8   ${APPIMAGE_MAJOR_VERSION}.${APPIMAGE_MINOR_VERSION}.${APPIMAGE_PATCH_VERSION})
9   
10 SET (STATIC_BUILD NO CACHE PATH "Link against static libs.")
12 include(cmake/ImportedTargets.cmake)
15 ###
16 # Looking for dependencies
17 ###
18 find_package(PkgConfig)
20 execute_process(
21     COMMAND git describe --tags --always --abbrev=7
22     OUTPUT_VARIABLE VERSION_NUMBER
24 string(STRIP ${VERSION_NUMBER} VERSION_NUMBER)
26 pkg_check_modules(GLIB REQUIRED glib-2.0)
27 include_directories(${GLIB_INCLUDE_DIRS})
29 pkg_check_modules(GIO REQUIRED gio-2.0)
30 include_directories(${GIO_INCLUDE_DIRS})
33 pkg_check_modules(CAIRO REQUIRED cairo)
34 include_directories(${CAIRO_INCLUDE_DIRS})
36 ###
37 # Sources
38 ###
39 include_directories("../squashfuse/")
40 include_directories("../libarchive-3.3.1/libarchive")
42 SET(LIBAPPIMAGE_SRC
43     libappimage.h
45     ../shared.c
46     ../getsection.c
47     ../notify.c
48     ../elf.c
51 ###
52 # Build
53 ###
54 add_library(appimage ${LIBAPPIMAGE_SRC})
55 target_compile_definitions(appimage
56     PRIVATE _FILE_OFFSET_BITS=64
57     PRIVATE HAVE_LIBARCHIVE3=0
58     PRIVATE VERSION_NUMBER="${VERSION_NUMBER}"
60 set_target_properties(appimage PROPERTIES VERSION ${VERSION_NUMBER})
61 set_target_properties(appimage PROPERTIES PUBLIC_HEADER ./libappimage.h)
63 target_link_libraries(appimage
64     ssl
65     squashfuse
66     crypto
67     z
68     lzma
69     pthread
70     archive
71     inotifytools
72     ${GLIB_LIBRARIES}
73     ${GIO_LIBRARIES}
74     ${CAIRO_LIBRARIES}
77 ###
78 # Deploy
79 ###
80 include(cmake/ConfigureDeploy.cmake)
82 enable_testing()
83 add_subdirectory(test)