~elementary-pantheon/contractor/master

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
# Vala stuff
find_package(Vala REQUIRED)
include(ValaVersion)
ensure_vala_version("0.16.0" MINIMUM)
include(ValaPrecompile)

set(EXEC_NAME ${CMAKE_PROJECT_NAME})

add_definitions(-DGETTEXT_PACKAGE=\"${CMAKE_PROJECT_NAME}\")

# pkgconfig, real C code
find_package(PkgConfig)
pkg_check_modules(DEPS REQUIRED gee-0.8 glib-2.0 gio-2.0 gio-unix-2.0)

set(CFLAGS ${DEPS_CFLAGS} ${DEPS_CFLAGS_OTHER})
set(LIB_PATHS ${DEPS_LIBRARY_DIRS})

link_directories(${LIB_PATHS})
add_definitions(${CFLAGS})

vala_precompile(VALA_C ${EXEC_NAME}
    main.vala
    Application.vala
    Contract.vala
    GenericContract.vala
    ContractFile.vala
    ContractKeyFile.vala
    MimeTypeManager.vala
    ContractMatcher.vala
    ContractSource.vala
    DBusService.vala
    ContractDirectory.vala
    FileService.vala
    FileEnumerator.vala
    ContractSorter.vala
    Translations.vala
    String.vala
PACKAGES
    gee-0.8
    glib-2.0
    gio-2.0
    gio-unix-2.0
)

add_executable(${EXEC_NAME} ${VALA_C})
target_link_libraries(${EXEC_NAME} ${DEPS_LIBRARIES})
install(TARGETS ${EXEC_NAME} RUNTIME DESTINATION bin)