[cmake] use GNUInstallDirs to set defaults for several directories
This will do the right thing for most distros, and if not they know how to
override it.
github:
@@ -831,12 +831,8 @@ set(LIGHTTPD_VERSION_ID 0x104${PROJECT_VERSION_PATCH})
set(PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
set(PACKAGE_VERSION "${PROJECT_VERSION}")
-if(NOT SBINDIR)
- set(SBINDIR "sbin")
-endif()
-
if(NOT LIGHTTPD_MODULES_DIR)
- set(LIGHTTPD_MODULES_DIR "lib${LIB_SUFFIX}/lighttpd")
+ set(LIGHTTPD_MODULES_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/lighttpd")
endif()
if(NOT WIN32)
@@ -896,7 +892,7 @@ set(L_INSTALL_TARGETS)
add_executable(lighttpd-angel lighttpd-angel.c)
set(L_INSTALL_TARGETS ${L_INSTALL_TARGETS} lighttpd-angel)
-add_target_properties(lighttpd-angel COMPILE_FLAGS "-DSBIN_DIR=\\\\\"${CMAKE_INSTALL_PREFIX}/${SBINDIR}\\\\\"")
+add_target_properties(lighttpd-angel COMPILE_FLAGS "-DSBIN_DIR=\\\\\"${CMAKE_INSTALL_FULL_SBINDIR}\\\\\"")
add_executable(lighttpd
server.c
@@ -1249,17 +1245,17 @@ endif()
if(NOT WIN32)
install(TARGETS ${L_INSTALL_TARGETS}
- RUNTIME DESTINATION ${SBINDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
LIBRARY DESTINATION ${LIGHTTPD_MODULES_DIR}
ARCHIVE DESTINATION ${LIGHTTPD_MODULES_DIR}/static)
else()
## HACK to make win32 to install our libraries in desired directory..
install(TARGETS lighttpd
- RUNTIME DESTINATION ${SBINDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
ARCHIVE DESTINATION lib/static)
list(REMOVE_ITEM L_INSTALL_TARGETS lighttpd)
install(TARGETS ${L_INSTALL_TARGETS}
- RUNTIME DESTINATION ${SBINDIR}/lib
+ RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}/lib
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static)
endif()
