diff --git a/CMakeLists.txt b/CMakeLists.txt index cb271686..9fea3bc1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1683,12 +1683,12 @@ configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfigVersion.cmake.in # Install compat headers install(FILES ${HDR_COMPAT} - DESTINATION "include" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" COMPONENT dev) # Install public headers install(FILES ${HDR_PUBLIC} - DESTINATION "include/event2" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/event2" COMPONENT dev) # Install the configs. @@ -1716,7 +1716,7 @@ endif() # Install the scripts. install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/event_rpcgen.py - DESTINATION "bin" + DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime) # Create documents with doxygen. diff --git a/cmake/AddEventLibrary.cmake b/cmake/AddEventLibrary.cmake index 8041847b..c295b3b0 100644 --- a/cmake/AddEventLibrary.cmake +++ b/cmake/AddEventLibrary.cmake @@ -36,9 +36,9 @@ endmacro() macro(export_install_target TYPE LIB_NAME) if("${LIB_NAME}" STREQUAL "event") install(TARGETS "${LIB_NAME}_${TYPE}" - LIBRARY DESTINATION "lib" COMPONENT lib - ARCHIVE DESTINATION "lib" COMPONENT lib - RUNTIME DESTINATION "lib" COMPONENT lib + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib + RUNTIME DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib COMPONENT dev ) else() @@ -62,9 +62,9 @@ macro(export_install_target TYPE LIB_NAME) ) install(TARGETS "${LIB_NAME}_${TYPE}" EXPORT LibeventTargets-${TYPE} - LIBRARY DESTINATION "lib" COMPONENT lib - ARCHIVE DESTINATION "lib" COMPONENT lib - RUNTIME DESTINATION "lib" COMPONENT lib + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib + RUNTIME DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib COMPONENT dev ) endif() @@ -169,7 +169,7 @@ macro(add_event_library LIB_NAME) if (NOT WIN32) install(FILES "$/${LIB_LINK_NAME}" - DESTINATION "lib" + DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib) endif() endif()