Creator: hasufell Date: Tue Mar 27 18:07:46 CEST 2012 add Path options to build system see https://bugs.gentoo.org/show_bug.cgi?id=408811 --- CMakeLists.txt +++ CMakeLists.txt @@ -85,12 +85,20 @@ ${CRYPTO_LIBRARY} ) -install(DIRECTORY ${PROJECT_SOURCE_DIR}/data DESTINATION share/meandmyshadow/) -install(TARGETS meandmyshadow RUNTIME DESTINATION bin) +# Path options +set(BINDIR "bin" CACHE STRING "Where to install binaries") +set(DATAROOTDIR "${CMAKE_INSTALL_PREFIX}/share" CACHE STRING "Sets the root of data directories to a non-default location") +set(ICONDIR "${DATAROOTDIR}/icons" CACHE STRING "Sets the icon directory for desktop entry to a non-default location.") +set(DESKTOPDIR "${DATAROOTDIR}/applications" CACHE STRING "Sets the desktop file directory for desktop entry to a non-default location.") + +# install locations +install(DIRECTORY ${PROJECT_SOURCE_DIR}/data DESTINATION ${DATAROOTDIR}/meandmyshadow/) +install(TARGETS meandmyshadow RUNTIME DESTINATION ${BINDIR}) + if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") - install(FILES meandmyshadow.desktop DESTINATION share/applications/) - install(FILES icons/16x16/meandmyshadow.png DESTINATION share/icons/hicolor/16x16/apps/) - install(FILES icons/32x32/meandmyshadow.png DESTINATION share/icons/hicolor/32x32/apps/) - install(FILES icons/48x48/meandmyshadow.png DESTINATION share/icons/hicolor/48x48/apps/) - install(FILES icons/64x64/meandmyshadow.png DESTINATION share/icons/hicolor/64x64/apps/) + install(FILES meandmyshadow.desktop DESTINATION ${DESKTOPDIR}) + install(FILES icons/16x16/meandmyshadow.png DESTINATION ${ICONDIR}/hicolor/16x16/apps/) + install(FILES icons/32x32/meandmyshadow.png DESTINATION ${ICONDIR}/hicolor/32x32/apps/) + install(FILES icons/48x48/meandmyshadow.png DESTINATION ${ICONDIR}/hicolor/48x48/apps/) + install(FILES icons/64x64/meandmyshadow.png DESTINATION ${ICONDIR}/hicolor/64x64/apps/) endif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") --- src/config.h.in +++ src/config.h.in @@ -4,7 +4,7 @@ #if defined(WIN32) //#define DATA_PATH #else -#define DATA_PATH "@CMAKE_INSTALL_PREFIX@/share/meandmyshadow/data/" +#define DATA_PATH "@DATAROOTDIR@/meandmyshadow/data/" #endif #endif