--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -391,12 +391,12 @@
#--------------------------------------------------------------------
include(CMakePackageConfigHelpers)
-if (UNIX)
- set(GLFW_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/lib/cmake/glfw3/")
-else()
- set(GLFW_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/")
+if (NOT GLFW_CMAKE_CONFIG_PATH)
+ set(GLFW_CMAKE_CONFIG_PATH "lib${LIB_SUFFIX}")
endif()
+set(GLFW_CONFIG_PATH "${GLFW_CMAKE_CONFIG_PATH}/cmake/glfw3")
+
configure_package_config_file("${GLFW_SOURCE_DIR}/src/glfw3Config.cmake.in"
"${GLFW_BINARY_DIR}/src/glfw3Config.cmake"
INSTALL_DESTINATION "${GLFW_CONFIG_PATH}"
@@ -433,6 +433,9 @@
if (DOXYGEN_FOUND AND GLFW_BUILD_DOCS)
add_subdirectory(docs)
+ if (NOT GLFW_DOCS_PATH)
+ set(GLFW_DOCS_PATH "share/doc/glfw3/")
+ endif()
endif()
#--------------------------------------------------------------------
@@ -445,12 +448,18 @@
install(FILES "${GLFW_BINARY_DIR}/src/glfw3Config.cmake"
"${GLFW_BINARY_DIR}/src/glfw3ConfigVersion.cmake"
- DESTINATION lib${LIB_SUFFIX}/cmake/glfw)
+ DESTINATION ${GLFW_CONFIG_PATH})
+
+ install(EXPORT glfwTargets DESTINATION ${GLFW_CONFIG_PATH})
- install(EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}/cmake/glfw)
install(FILES "${GLFW_BINARY_DIR}/src/glfw3.pc"
DESTINATION lib${LIB_SUFFIX}/pkgconfig)
+ if (DOXYGEN_FOUND AND GLFW_BUILD_DOCS)
+ install(FILES "${GLFW_BINARY_DIR}/docs/html"
+ DESTINATION "${GLFW_DOCS_PATH}")
+ endif()
+
# Only generate this target if no higher-level project already has
if (NOT TARGET uninstall)
configure_file("${GLFW_SOURCE_DIR}/cmake_uninstall.cmake.in"