summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-05-02 14:46:12 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-05-02 14:46:12 +0200
commit5252a0049e0a509508a8f331222543620db0e6d3 (patch)
tree8d4b6bb20cbbbcfd8881130a6f6c2cbf2a3d6339 /CMakeLists.txt
parent6d3c61711bfe6524272bbde591e3494e0346a7da (diff)
downloadipecamera-5252a0049e0a509508a8f331222543620db0e6d3.tar.gz
ipecamera-5252a0049e0a509508a8f331222543620db0e6d3.tar.bz2
ipecamera-5252a0049e0a509508a8f331222543620db0e6d3.tar.xz
ipecamera-5252a0049e0a509508a8f331222543620db0e6d3.zip
Provide version information as required by new pcilib interface
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt32
1 files changed, 31 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2bcfc15..610baa1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,10 @@ pkg_check_modules(UFODECODE ufodecode>=0.3 REQUIRED)
pkg_check_modules(PCILIB pcitool>=0.2 REQUIRED)
exec_program("pkg-config --variable=plugindir pcitool" OUTPUT_VARIABLE PCILIB_PLUGIN_DIR)
+include(cmake/version.cmake)
+VERSION_TO_VARS(${IPECAMERA_VERSION} IPECAMERA_VERSION_MAJOR IPECAMERA_VERSION_MINOR IPECAMERA_VERSION_MICRO)
+
+
add_subdirectory(apps)
include_directories(
@@ -26,7 +30,7 @@ link_directories(
${PCILIB_LIBRARY_DIRS}
)
-set(HEADERS ${HEADERS} model.h cmosis.h base.h reader.h events.h data.h private.h ipecamera.h)
+set(HEADERS ${HEADERS} model.h cmosis.h base.h reader.h events.h data.h private.h ipecamera.h version.h)
add_library(ipecamera SHARED model.c cmosis.c base.c reader.c events.c data.c)
@@ -40,3 +44,29 @@ install(TARGETS ipecamera
DESTINATION ${PCILIB_PLUGIN_DIR}
)
+set(TARNAME "ipecamera")
+set(PACKAGE_VERSION ${IPECAMERA_VERSION})
+set(PACKAGE_NAME "${TARNAME}")
+set(PACKAGE_TARNAME "${TARNAME}")
+set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
+set(PACKAGE_BUGREPORT "http://ufo.kit.edu/ufo/newticket")
+
+if(NOT DEFINED BIN_INSTALL_DIR)
+ set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
+endif(NOT DEFINED BIN_INSTALL_DIR)
+
+if(NOT DEFINED LIB_INSTALL_DIR)
+ set(LIB_INSTALL_DIR "${LIB_INSTALL_DIR}")
+endif(NOT DEFINED LIB_INSTALL_DIR)
+
+if(NOT DEFINED INCLUDE_INSTALL_DIR)
+ set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include")
+endif(NOT DEFINED INCLUDE_INSTALL_DIR)
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ipecamera.pc.in ${CMAKE_CURRENT_BINARY_DIR}/ipecamera.pc)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
+
+install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/ipecamera.pc
+ DESTINATION ${LIB_INSTALL_DIR}/pkgconfig
+)