-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
58 lines (47 loc) · 2.09 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
cmake_minimum_required(VERSION 2.6)
PROJECT(autolab-nd)
SET( V_MAJOR 0 )
SET( V_MINOR 1 )
SET( V_BUGFIX 0 )
SET( VERSION ${V_MAJOR}.${V_MINOR}.${V_BUGFIX} )
SET( APIVERSION ${V_MAJOR}.${V_MINOR} )
ADD_DEFINITIONS(-g -Wall -O2)
SET(CMAKE_VERBOSE_MAKEFILE OFF)
INCLUDE(FindPkgConfig)
PKG_SEARCH_MODULE( RAPI REQUIRED autolab-rapi )
IF( RAPI_FOUND )
MESSAGE( STATUS ${INDENT} "Rapi version ${RAPI_VERSION} detected at ${RAPI_PREFIX}" )
# MESSAGE( STATUS " RAPI_CFLAGS = ${RAPI_CFLAGS}" )
# MESSAGE( STATUS " RAPI_LDFLAGS = ${RAPI_LDFLAGS}" )
# MESSAGE( STATUS " RAPI_INCLUDE = ${RAPI_INCLUDE_DIRS}" )
# MESSAGE( STATUS " RAPI_LIBS = ${RAPI_LIBRARIES}" )
ELSE( RAPI_FOUND )
MESSAGE( ${INDENT} "Rapi not detected" )
ENDIF( RAPI_FOUND )
INCLUDE(FindPkgConfig)
PKG_SEARCH_MODULE( RAPI-CHATTERBOX autolab-rapi-chatterbox )
IF( RAPI-CHATTERBOX_FOUND )
MESSAGE( STATUS ${INDENT} "Rapi-Chatterbox version ${RAPI-CHATTERBOX_VERSION} detected at ${RAPI-CHATTERBOX_PREFIX}" )
# MESSAGE( STATUS " RAPI_CFLAGS = ${RAPI-CHATTERBOX_CFLAGS}" )
# MESSAGE( STATUS " RAPI_LDFLAGS = ${RAPI-CHATTERBOX_LDFLAGS}" )
# MESSAGE( STATUS " RAPI_INCLUDE = ${RAPI-CHATTERBOX_INCLUDE_DIRS}" )
# MESSAGE( STATUS " RAPI_LIBS = ${RAPI-CHATTERBOX_LIBRARIES}" )
ELSE( RAPI-CHATTERBOX_FOUND )
MESSAGE( ${INDENT} "Rapi not detected" )
ENDIF( RAPI-CHATTERBOX_FOUND )
# paths common to all subdirectories
INCLUDE_DIRECTORIES( ${RAPI_INCLUDE_DIRS} ${RAPI-CHATTERBOX_INCLUDE_DIRS} )
LINK_DIRECTORIES( ${RAPI_LIBRARY_DIRS} ${RAPI-CHATTERBOX_LIBRARY_DIRS} )
# optional Stage stuff
PKG_SEARCH_MODULE( STAGE stage )
PKG_SEARCH_MODULE( RAPI_STAGE autolab-rapi-stage )
IF( STAGE_FOUND AND RAPI_STAGE_FOUND )
MESSAGE( "Found Stage" )
ADD_SUBDIRECTORY(examples) # right now the example targets Stage
ENDIF( STAGE_FOUND AND RAPI_STAGE_FOUND )
# check for Stage before descending
ADD_SUBDIRECTORY(src)
# Create and install the pkgconfig file from the .in template
SET( PKGFILE ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc )
CONFIGURE_FILE( ${PKGFILE}.in ${PKGFILE} @ONLY)
INSTALL( FILES ${PKGFILE} DESTINATION lib/pkgconfig/)