summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2017-04-04 12:54:10 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2017-04-04 12:54:50 +0200
commit7e9a3327a131b62a6e808ae356131447deb1802d (patch)
tree5e3a73b5a7d04fc404a84672cc61ab68d322f233
parent6590cc9cfecaeaa2c48b0e83f3f4fae9b339902d (diff)
downloaduca-net-7e9a3327a131b62a6e808ae356131447deb1802d.tar.gz
uca-net-7e9a3327a131b62a6e808ae356131447deb1802d.tar.bz2
uca-net-7e9a3327a131b62a6e808ae356131447deb1802d.tar.xz
uca-net-7e9a3327a131b62a6e808ae356131447deb1802d.zip
Use GNUInstallDirs to set install paths
-rw-r--r--CMakeLists.txt42
1 files changed, 29 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 775312f..480c91c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,11 +12,11 @@ project(ucanet C)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+find_package(PkgConfig)
+
include(FindPackageHandleStandardArgs)
include(PkgConfigVars)
-include(ConfigurePaths)
-
-find_package(PkgConfig)
+include(GNUInstallDirs)
add_definitions("-std=c99 -Wall -fPIC")
add_definitions(-DG_LOG_DOMAIN="Uca-Net")
@@ -26,23 +26,39 @@ pkg_check_modules(UCA libuca>=2.1.0 REQUIRED)
pkg_check_variable(libuca plugindir)
set(UCA_NET_DEFAULT_PORT 8989)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${UCA_INCLUDE_DIRS} ${GIO_INCLUDE_DIRS})
-link_directories(${UCA_LIBRARY_DIRS} ${GIO_LIBRARY_DIRS})
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${UCA_INCLUDE_DIRS}
+ ${GIO_INCLUDE_DIRS})
+
+link_directories(
+ ${UCA_LIBRARY_DIRS}
+ ${GIO_LIBRARY_DIRS})
# uca-net client camera
-configure_paths(UCANET)
-set(UCANET_PLUGINDIR "${UCANET_LIBDIR}/uca") # TODO: Maybe move this to ConfigurePaths?
add_library(ucanet SHARED uca-net-camera.c)
-target_link_libraries(ucanet ${UCA_LIBRARIES} ${GIO_LIBRARIES})
-install(TARGETS ucanet LIBRARY DESTINATION ${UCANET_PLUGINDIR} RUNTIME DESTINATION ${UCANET_PLUGINDIR})
+target_link_libraries(ucanet
+ ${UCA_LIBRARIES}
+ ${GIO_LIBRARIES})
+
+install(TARGETS ucanet
+ LIBRARY DESTINATION ${LIBUCA_PLUGINDIR}
+ RUNTIME DESTINATION ${LIBUCA_PLUGINDIR})
# uca-net server
-configure_paths(UCAD)
add_executable(ucad ucad.c)
-target_link_libraries(ucad ${UCA_LIBRARIES} ${GIO_LIBRARIES})
+target_link_libraries(ucad
+ ${UCA_LIBRARIES}
+ ${GIO_LIBRARIES})
-install(TARGETS ucad RUNTIME DESTINATION ${UCAD_BINDIR} COMPONENT executables)
+install(TARGETS ucad
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ COMPONENT executables)