summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 4aeb72c49088fd02a02c4f82e024e68c4e4c576f (plain)
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
cmake_minimum_required(VERSION 2.6)
project(KIROCS C)

set(CMAKE_INCLUDE_CURRENT_DIR TRUE)

set(TARNAME "uca-kiro")
set(LIBKIROCS_VERSION_MAJOR "0")
set(LIBKIROCS_VERSION_MINOR "0")
set(LIBKIROCS_VERSION_PATCH "1")
set(LIBKIROCS_VERSION_RELEASE "0")
set(LIBKIROCS_VERSION_STRING "${LIBKIROCS_VERSION_MAJOR}.${LIBKIROCS_VERSION_MINOR}.${LIBKIROCS_VERSION_PATCH}")
set(VERSION "${LIBKIROCS_VERSION_STRING}")
set(LIBKIROCS_DESCRIPTION "KIRO InfiniBand camera remote control server and plugin for libuca")

# Increase the ABI version when binary compatibility cannot be guaranteed, e.g.
# symbols have been removed, function signatures, structures, constants etc.
# changed.
set(LIBKIROCS_ABI_VERSION "1")

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/common/cmake")

include(ConfigurePaths)
include(PkgConfigVars)
configure_paths(KIROCS)

find_package(PkgConfig)
pkg_check_modules(GLIB2 glib-2.0>=2.32 REQUIRED)
pkg_check_modules(GOBJECT2 gobject-2.0>=2.32 REQUIRED)
pkg_check_modules(GMODULE2 gmodule-2.0>=2.32 REQUIRED)
pkg_check_modules(GIO2 gio-2.0>=2.32 REQUIRED)
pkg_check_modules(LIBUCA libuca>=2.0 REQUIRED)
pkg_check_modules(KIRO kiro>=1.4 REQUIRED)

pkg_check_variable(libuca plugindir)

include_directories(
    SYSTEM
    ${CMAKE_CURRENT_SOURCE_DIR}/src
    ${GLIB2_INCLUDE_DIRS}
    ${GOBJECT2_INCLUDE_DIRS}
    ${GMODULE2_INCLUDE_DIRS}
    ${GIO2_INCLUDE_DIRS}
    ${LIBUCA_INCLUDE_DIR}
    ${KIRO_INCLUDE_DIR})

link_directories(
    ${GLIB2_LIBDIR}
    ${GOBJECT2_LIBDIR}
    ${GMODULE2_LIBDIR}
    ${GIO2_LIBDIR}
    ${LIBUCA_LIBDIR}
    ${KIRO_LIBDIR})

set(KIROCS_DEPS
    ${GLIB2_LIBRARIES}
    ${GOBJECT2_LIBRARIES}
    ${GMODULE2_LIBRARIES}
    ${GIO2_LIBRARIES}
    ${LIBUCA_LIBRARIES}
    ${KIRO_LIBRARIES})

set(LIBKIROCS_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR})

add_definitions(-Wall -Wextra -std=c99)

add_subdirectory(bin)
add_subdirectory(src)