-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (42 loc) · 1.98 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
cmake_minimum_required(VERSION 2.6)
project(pcio-sns)
set(PCIO_MAJOR_VERSION "1")
set(PCIO_MINOR_VERSION "0")
set(PCIO_PATCH_VERSION "0")
# Guard against in-source builds
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "In-source builds are not allowed. You may need to remove CMakeCache.txt.")
endif()
# Set the C99 standard for the C files
set(CMAKE_C_FLAGS --std=gnu99)
# Link to somatic, amino and ach
# NOTE: Ideally we would like to 'find' these packages but for now, we assume they are either
# in /usr/lib or /usr/local/lib
link_libraries(ach sns ntcan ntcanopen amino)
# Add the executables
include_directories(include)
#add_executable(pciod pciod.c pcio.c code.c)
add_executable(pcio-sns pcio-sns.c pcio.c code.c)
set_target_properties( pcio-sns PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin )
#add_executable(pcio_util pcio_util.c pcio.c code.c)
#add_executable(query tests/query.c pcio.c code.c)
# Install it
#install(TARGETS pciod pcio_util DESTINATION /usr/local/bin)
install( TARGETS pcio-sns DESTINATION $ENV{HOME}/local/bin )
###############
# Package Installer
set(CPACK_PACKAGE_NAME "pcio")
set(CPACK_SYSTEM_NAME "i386")
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set(CPACK_SYSTEM_NAME "amd64")
endif()
set(CPACK_PACKAGE_VERSION_MAJOR ${PCIO_MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${PCIO_MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${PCIO_PATCH_VERSION})
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libach-dev, somatic, libamino-dev")
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_SYSTEM_NAME}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Can Erdogan <[email protected]>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "An interface to control the Schunk modules using the somatic library")
set(CPACK_PACKAGE_VENDOR "Georgia Tech Humanoids Lab")
include(CPack)