summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2016-03-16 20:06:45 +0100
committerSuren A. Chilingaryan <csa@suren.me>2016-03-16 20:06:45 +0100
commit6fa5eb9906e9d5f47abd3f704bfe3604171c58ab (patch)
tree98e3ac7e6cec2d73c2a492e6eb3005433b6a0df7
parentda2be2cf6bff18aaf01b90257a5b6edf04e2cebc (diff)
downloadipecamera-6fa5eb9906e9d5f47abd3f704bfe3604171c58ab.tar.gz
ipecamera-6fa5eb9906e9d5f47abd3f704bfe3604171c58ab.tar.bz2
ipecamera-6fa5eb9906e9d5f47abd3f704bfe3604171c58ab.tar.xz
ipecamera-6fa5eb9906e9d5f47abd3f704bfe3604171c58ab.zip
Use GNUInstallDirs
-rw-r--r--CMakeLists.txt17
-rw-r--r--ipecamera.pc.in6
-rw-r--r--ipecamera.spec.in3
3 files changed, 8 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 053ae3f..352d4f4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,6 +19,7 @@ exec_program("pkg-config --variable=plugindir pcitool" OUTPUT_VARIABLE PCILIB_PL
include(cmake/version.cmake)
VERSION_TO_VARS(${IPECAMERA_VERSION} IPECAMERA_VERSION_MAJOR IPECAMERA_VERSION_MINOR IPECAMERA_VERSION_MICRO)
+include(GNUInstallDirs)
add_subdirectory(apps)
@@ -40,7 +41,7 @@ add_library(ipecamera SHARED model.c cmosis.c base.c reader.c events.c data.c en
target_link_libraries(ipecamera ${PCILIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${UFODECODE_LIBRARIES} )
install(FILES ipecamera.h
- DESTINATION include
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(TARGETS ipecamera
@@ -69,23 +70,11 @@ add_custom_target(dist_clean COMMAND ${CMAKE_MAKE_PROGRAM} clean WORKING_DIRECTO
add_custom_target(dist DEPENDS dist_clean COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
-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)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ipecamera.spec.in ${CMAKE_CURRENT_BINARY_DIR}/ipecamera.spec)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/ipecamera.pc
- DESTINATION ${LIB_INSTALL_DIR}/pkgconfig
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
diff --git a/ipecamera.pc.in b/ipecamera.pc.in
index 6d34409..9ba4da9 100644
--- a/ipecamera.pc.in
+++ b/ipecamera.pc.in
@@ -1,10 +1,10 @@
prefix=${CMAKE_INSTALL_PREFIX}
-exec_prefix=${BIN_INSTALL_DIR}
+exec_prefix=${CMAKE_INSTALL_FULL_BINDIR}
libdir=${PCILIB_PLUGIN_DIR}
-includedir=${INCLUDE_INSTALL_DIR}
+includedir=${CMAKE_INSTALL_FULL_INCLUDEDIR}
Name: ${TARNAME}
Description: IPECamera event engine for pcilib
Version: ${PACKAGE_VERSION}
Libs: -L${PCILIB_PLUGIN_DIR} -lipecamera
-Cflags: -I${INCLUDE_INSTALL_DIR}
+Cflags: -I${CMAKE_INSTALL_FULL_INCLUDEDIR}
diff --git a/ipecamera.spec.in b/ipecamera.spec.in
index 328ca74..17523bb 100644
--- a/ipecamera.spec.in
+++ b/ipecamera.spec.in
@@ -32,7 +32,8 @@ Development files provide access to some non-standard features of the event engi
%setup -q
%build
-cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DLIB_INSTALL_DIR=%{_libdir} -DBIN_INSTALL_DIR=%{_bindir} -DDATA_INSTALL_DIR=%{_datadir} -DINCLUDE_INSTALL_DIR=%{_includedir} .
+cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=%{_libdir} -DCMAKE_INSTALL_BINDIR=%{_bindir} -DCMAKE_INSTALL_DATADIR=%{_datadir} -DCMAKE_INSTALL_DATAROOTDIR=%{_datadir} -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} .
+
make
%install