diff options
-rw-r--r-- | CMakeLists.txt | 8 | ||||
-rw-r--r-- | bin/gui/CMakeLists.txt | 6 | ||||
-rw-r--r-- | bin/tools/CMakeLists.txt | 2 | ||||
-rw-r--r-- | cmake/ConfigurePaths.cmake | 94 | ||||
-rw-r--r-- | plugins/file/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/mock/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/CMakeLists.txt | 12 | ||||
-rw-r--r-- | src/config.h.in | 2 | ||||
-rw-r--r-- | src/libuca.pc.in | 14 |
9 files changed, 27 insertions, 121 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 33342fb..390d2eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,11 +75,13 @@ macro(create_enums prefix template_prefix header_list) endmacro() #}}} #{{{ Configure -include(ConfigurePaths) include(PkgConfigVars) -configure_paths(UCA) +include(GNUInstallDirs) -set(UCA_PLUGINDIR "${UCA_LIBDIR}/uca") +set(CMAKE_INSTALL_GIRDIR "${CMAKE_INSTALL_DATAROOTDIR}/gir-1.0") +set(CMAKE_INSTALL_PLUGINDIR "${CMAKE_INSTALL_LIBDIR}/ufo") +set(CMAKE_INSTALL_TYPELIBDIR "${CMAKE_INSTALL_LIBDIR}/girepository-1.0") +set(CMAKE_INSTALL_PKGCONFIGDIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/package.sh.in ${CMAKE_CURRENT_BINARY_DIR}/package.sh) diff --git a/bin/gui/CMakeLists.txt b/bin/gui/CMakeLists.txt index 97ddddd..2ca575d 100644 --- a/bin/gui/CMakeLists.txt +++ b/bin/gui/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.6) #{{{ Variables -set(UCA_GLADEDIR "${UCA_DATADIR}/libuca") +set(CMAKE_INSTALL_GLADEDIR "${CMAKE_INSTALL_DATADIR}/libuca") #}}} #{{{ Configure find_package(PkgConfig) @@ -34,11 +34,11 @@ if (GTK2_FOUND) ${GTHREAD2_LIBRARIES}) install(TARGETS ${BINARY} - RUNTIME DESTINATION ${UCA_BINDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT executables) install(FILES control.glade - DESTINATION ${UCA_GLADEDIR} + DESTINATION ${CMAKE_INSTALL_GLADEDIR} COMPONENT executables) endif() #}}} diff --git a/bin/tools/CMakeLists.txt b/bin/tools/CMakeLists.txt index 977af28..6eb99eb 100644 --- a/bin/tools/CMakeLists.txt +++ b/bin/tools/CMakeLists.txt @@ -27,6 +27,6 @@ foreach (BINARY ${BINARIES}) endforeach () install(TARGETS uca-benchmark uca-grab uca-gen-doc uca-info - RUNTIME DESTINATION ${UCA_BINDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT executables) #}}} diff --git a/cmake/ConfigurePaths.cmake b/cmake/ConfigurePaths.cmake deleted file mode 100644 index d5449f4..0000000 --- a/cmake/ConfigurePaths.cmake +++ /dev/null @@ -1,94 +0,0 @@ -# - pre-configured paths for CMake -# -# Usage: -# configure_paths(<PREFIX>) -# -# Checks if configure-like prefix and installation paths were passed by the user -# and sets up corresponding variables for use in install() commands and to fill -# out .pc files: -# -# PREFIX_PREFIX defaults to ... CMAKE_INSTALL_PREFIX -# PREFIX_EPREFIX PREFIX_PREFIX -# PREFIX_SBINDIR PREFIX_EPREFIX/sbin -# PREFIX_SYSCONFDIR PREFIX_PREFIX/etc -# PREFIX_LOCALSTATEDIR PREFIX_PREFIX/var -# PREFIX_BINDIR PREFIX_EPREFIX/bin -# PREFIX_LIBDIR PREFIX_EPREFIX/lib -# PREFIX_INCLUDEDIR PREFIX_PREFIX/include -# PREFIX_PKGCONFIGDIR PREFIX_LIBDIR/pkgconfig -# PREFIX_TYPELIBDIR PREFIX_LIBDIR/girepository-1.0 -# PREFIX_DATAROOTDIR PREFIX_PREFIX/share -# PREFIX_DATADIR PREFIX_DATAROOTDIR -# PREFIX_INFODIR PREFIX_DATAROOTDIR/info -# PREFIX_MANDIR PREFIX_DATAROOTDIR/man -# PREFIX_LOCALEDIR PREFIX_DATAROOTDIR/locale -# PREFIX_GIRDIR PREFIX_DATAROOTDIR/gir-1.0 - -# Copyright (C) 2013 Matthias Vogelgesang <matthias.vogelgesang@gmail.com> -# -# Redistribution and use, with or without modification, are permitted -# provided that the following conditions are met: -# -# 1. Redistributions must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# 2. The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -if(__configure_paths) - return() -endif() - -set(__configure_paths YES) - -macro(_set_var _prefix _var _user _override _description) - set(_name "${_prefix}_${_var}") - - set("${_name}" "${_user}") - - if("${_name}" STREQUAL "") - set("${_name}" "${_override}") - endif() - - set(${_name} "${${_name}}" CACHE PATH "${_description}") - mark_as_advanced(${_name}) -endmacro() - -function(configure_paths _prefix) - _set_var("${_prefix}" "PREFIX" "${PREFIX}" "${CMAKE_INSTALL_PREFIX}" "install architecture-independent files in PREFIX") - _set_var("${_prefix}" "EPREFIX" "${EXEC_PREFIX}" "${${_prefix}_PREFIX}" "install architecture-dependent files in EPREFIX") - - _set_var("${_prefix}" "SBINDIR" "${SBINDIR}" "${${_prefix}_EPREFIX}/sbin" "system admin executabls") - _set_var("${_prefix}" "SYSCONFDIR" "${SYSCONFDIR}" "${${_prefix}_PREFIX}/etc" "read-only single-machine data") - _set_var("${_prefix}" "LOCALSTATEDIR" "${LOCALSTATEDIR}" "${${_prefix}_PREFIX}/var" "modifiable single-machine data") - _set_var("${_prefix}" "BINDIR" "${BINDIR}" "${${_prefix}_EPREFIX}/bin" "user executables") -if(WIN32) - _set_var("${_prefix}" "LIBDIR" "${LIBDIR}" "${${_prefix}_EPREFIX}/bin" "object code libraries") -else() - _set_var("${_prefix}" "LIBDIR" "${LIBDIR}" "${${_prefix}_EPREFIX}/lib" "object code libraries") -endif() - _set_var("${_prefix}" "INCLUDEDIR" "${INCLUDEDIR}" "${${_prefix}_PREFIX}/include" "C header files") - _set_var("${_prefix}" "PKGCONFIGDIR" "${PKGCONFIGDIR}" "${${_prefix}_LIBDIR}/pkgconfig" "pkg-config files") - _set_var("${_prefix}" "TYPELIBDIR" "${TYPELIBDIR}" "${${_prefix}_LIBDIR}/girepository-1.0" "GObject run-time introspection data") - _set_var("${_prefix}" "DATAROOTDIR" "${DATAROOTDIR}" "${${_prefix}_PREFIX}/share" "read-only arch.-independent data root") - _set_var("${_prefix}" "DATADIR" "${DATADIR}" "${${_prefix}_DATAROOTDIR}" "read-only architecture-independent data") - _set_var("${_prefix}" "INFODIR" "${INFODIR}" "${${_prefix}_DATAROOTDIR}/info" "info documentation") - _set_var("${_prefix}" "MANDIR" "${MANDIR}" "${${_prefix}_DATAROOTDIR}/man" "man documentation") - _set_var("${_prefix}" "LOCALEDIR" "${LOCALEDIR}" "${${_prefix}_DATAROOTDIR}/locale" "locale-dependent data") - _set_var("${_prefix}" "GIRDIR" "${GIRDIR}" "${${_prefix}_DATAROOTDIR}/gir-1.0" "GObject introspection data") -endfunction() - -# vim: tw=0: diff --git a/plugins/file/CMakeLists.txt b/plugins/file/CMakeLists.txt index 8d45944..6874168 100644 --- a/plugins/file/CMakeLists.txt +++ b/plugins/file/CMakeLists.txt @@ -21,8 +21,7 @@ if (TIFF_FOUND) target_link_libraries(ucafile uca ${UCA_DEPS} ${TIFF_LIBRARIES}) install(TARGETS ucafile - ARCHIVE DESTINATION ${UCA_LIBDIR} - LIBRARY DESTINATION ${UCA_PLUGINDIR} - RUNTIME DESTINATION ${UCA_PLUGINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_PLUGINDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_PLUGINDIR} COMPONENT ${UCA_CAMERA_NAME}) endif () diff --git a/plugins/mock/CMakeLists.txt b/plugins/mock/CMakeLists.txt index d8f5338..48a11be 100644 --- a/plugins/mock/CMakeLists.txt +++ b/plugins/mock/CMakeLists.txt @@ -16,7 +16,6 @@ add_library(ucamock SHARED target_link_libraries(ucamock uca m ${UCA_DEPS}) install(TARGETS ucamock - ARCHIVE DESTINATION ${UCA_LIBDIR} - LIBRARY DESTINATION ${UCA_PLUGINDIR} - RUNTIME DESTINATION ${UCA_PLUGINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_PLUGINDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_PLUGINDIR} COMPONENT ${UCA_CAMERA_NAME}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index eab0f9c..e5c4ab7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -113,25 +113,25 @@ endif() #}}} #{{{ Installation install(TARGETS uca - LIBRARY DESTINATION ${UCA_LIBDIR} - RUNTIME DESTINATION ${UCA_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libuca.pc - DESTINATION ${UCA_PKGCONFIGDIR} + DESTINATION ${CMAKE_INSTALL_PKGCONFIGDIR} COMPONENT libraries) install(FILES ${uca_HDRS} - DESTINATION ${UCA_INCLUDEDIR}/uca + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/uca COMPONENT headers) if(WITH_GIR) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_XML} - DESTINATION ${UCA_GIRDIR} + DESTINATION ${CMAKE_INSTALL_GIRDIR} COMPONENT libraries) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_TYPELIB} - DESTINATION ${UCA_TYPELIBDIR} + DESTINATION ${CMAKE_INSTALL_TYPELIBDIR} COMPONENT libraries) endif() #}}} diff --git a/src/config.h.in b/src/config.h.in index 8b11c60..4cceee4 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -6,4 +6,4 @@ #cmakedefine HAVE_PYLON_CAMERA #cmakedefine HAVE_DEXELA_CL #cmakedefine HAVE_MOCK_CAMERA -#cmakedefine UCA_PLUGINDIR "${UCA_PLUGINDIR}" +#define UCA_PLUGINDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_PLUGINDIR}" diff --git a/src/libuca.pc.in b/src/libuca.pc.in index cd3f58c..c660a0f 100644 --- a/src/libuca.pc.in +++ b/src/libuca.pc.in @@ -1,10 +1,10 @@ -prefix=@UCA_PREFIX@ -exec_prefix=@UCA_EPREFIX@ -libdir=@UCA_LIBDIR@ -includedir=@UCA_INCLUDEDIR@ -girdir=@UCA_GIRDIR@ -typelibdir=@UCA_TYPELIBDIR@ -plugindir=@UCA_PLUGINDIR@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=@CMAKE_INSTALL_PREFIX@ +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ +girdir=${prefix}/@CMAKE_INSTALL_GIRDIR@ +typelibdir=${exec_prefix}/@CMAKE_INSTALL_TYPELIBDIR@ +plugindir=${exec_prefix}/@CMAKE_INSTALL_PLUGINDIR@ Name: libuca Description: @UCA_DESCRIPTION@ |