Use more GNUInstallDirs (doc, man)

parent bd4353a9
......@@ -15,7 +15,7 @@ endif()
include(FeatureSummary)
include(GenerateExportHeader)
include("GNUInstallDirs")
include(GNUInstallDirs)
# Version setup
set(CLAZY_VERSION_MAJOR "1")
......@@ -184,8 +184,6 @@ if (NOT CLAZY_BUILD_WITH_CLANG)
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
set(SHARE_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR} CACHE STRING "Share directory name")
if(NOT WIN32)
if(APPLE)
find_program(READLINK_CMD greadlink)
......@@ -200,27 +198,24 @@ if (NOT CLAZY_BUILD_WITH_CLANG)
configure_file(${CMAKE_CURRENT_LIST_DIR}/clazy.cmake ${CMAKE_BINARY_DIR}/clazy @ONLY)
install(PROGRAMS ${CMAKE_BINARY_DIR}/clazy DESTINATION bin)
else()
install(PROGRAMS ${CMAKE_CURRENT_LIST_DIR}/clazy.bat DESTINATION bin)
install(PROGRAMS ${CMAKE_CURRENT_LIST_DIR}/clazy.bat DESTINATION ${CMAKE_INSTALL_BINDIR})
if(MSVC)
install(PROGRAMS ${CMAKE_CURRENT_LIST_DIR}/clazy-cl.bat DESTINATION bin)
install(PROGRAMS ${CMAKE_CURRENT_LIST_DIR}/clazy-cl.bat DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
endif()
# Install the explanation README's
set(DOC_INSTALL_DIR ${SHARE_INSTALL_DIR}/doc/clazy)
include(${CMAKE_CURRENT_LIST_DIR}/readmes.cmake)
install(FILES ${README_LEVEL0_FILES} DESTINATION ${DOC_INSTALL_DIR}/level0)
install(FILES ${README_LEVEL1_FILES} DESTINATION ${DOC_INSTALL_DIR}/level1)
install(FILES ${README_LEVEL2_FILES} DESTINATION ${DOC_INSTALL_DIR}/level2)
install(FILES ${README_manuallevel_FILES} DESTINATION ${DOC_INSTALL_DIR}/manuallevel)
install(FILES ${README_LEVEL0_FILES} DESTINATION ${CMAKE_INSTALL_DOCDIR}/level0)
install(FILES ${README_LEVEL1_FILES} DESTINATION ${CMAKE_INSTALL_DOCDIR}/level1)
install(FILES ${README_LEVEL2_FILES} DESTINATION ${CMAKE_INSTALL_DOCDIR}/level2)
install(FILES ${README_manuallevel_FILES} DESTINATION ${CMAKE_INSTALL_DOCDIR}/manuallevel)
# Install more doc files
install(FILES README.md COPYING-LGPL2.txt checks.json DESTINATION ${DOC_INSTALL_DIR})
install(FILES README.md COPYING-LGPL2.txt checks.json DESTINATION ${CMAKE_INSTALL_DOCDIR})
# Build docs
set(MAN_INSTALL_DIR "${SHARE_INSTALL_DIR}/man/man1")
add_subdirectory(docs)
# rpath
......
......@@ -14,6 +14,6 @@ if(UNIX)
)
add_custom_target(man ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/clazy.1)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/clazy.1 DESTINATION ${MAN_INSTALL_DIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/clazy.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
endif()
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment