File tree Expand file tree Collapse file tree 5 files changed +40
-7
lines changed
Expand file tree Collapse file tree 5 files changed +40
-7
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ set(BIN_INSTALL_DIR bin CACHE STRING "Binary installation directory relative to
1515set (LIB_INSTALL_DIR lib CACHE STRING "Library installation directory relative to the install prefix" )
1616set (INCLUDE_INSTALL_DIR include CACHE STRING "Header installation directory relative to the install prefix" )
1717
18+ set (DOC_INSTALL_DIR share/doc /qmdnsengine CACHE STRING "Documentation installation directory relative to the install prefix" )
19+ set (EXAMPLES_INSTALL_DIR "${LIB_INSTALL_DIR} /qmdnsengine/examples" CACHE STRING "Examples installation directory relative to the install prefix" )
20+
1821find_package (Qt5Network 5.4 REQUIRED)
1922
2023set (CMAKE_AUTOMOC ON )
@@ -40,9 +43,15 @@ if(BUILD_TESTS)
4043 add_subdirectory (tests)
4144endif ()
4245
43- include (CPack)
44-
45- set (CPACK_PACKAGE_NAME "${PROJECT_NAME} " )
46+ set (CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME} " )
47+ set (CPACK_PACKAGE_VENDOR "${PROJECT_AUTHOR} " )
4648set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR} )
4749set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR} )
4850set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH} )
51+
52+ set (CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "Documentation" )
53+ set (CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION "Documentation generated for the library" )
54+ set (CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples" )
55+ set (CPACK_COMPONENT_EXAMPLES_DESCRIPTION "Sample applications using the library" )
56+
57+ include (CPack)
Original file line number Diff line number Diff line change @@ -3,3 +3,8 @@ configure_file(Doxyfile.in "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
33add_custom_target (doc ALL
44 "${DOXYGEN_EXECUTABLE} " \"${CMAKE_CURRENT_BINARY_DIR} /Doxyfile\"
55)
6+
7+ install (DIRECTORY "${CMAKE_CURRENT_BINARY_DIR} /html"
8+ DESTINATION "${DOC_INSTALL_DIR} "
9+ COMPONENT documentation
10+ )
Original file line number Diff line number Diff line change 1- if (Qt5Widgets_FOUND)
2- add_subdirectory (browser)
3- add_subdirectory (provider)
4- endif ()
1+ set (EXAMPLES
2+ browser
3+ provider
4+ )
5+
6+ foreach (EXAMPLE ${EXAMPLES} )
7+ set (EXAMPLE_DIR "${EXAMPLES_INSTALL_DIR} /${EXAMPLE} " )
8+ add_subdirectory (${EXAMPLE} )
9+ install (DIRECTORY ${EXAMPLE}
10+ DESTINATION "${EXAMPLES_INSTALL_DIR} "
11+ COMPONENT examples
12+ )
13+ endforeach ()
Original file line number Diff line number Diff line change @@ -11,3 +11,8 @@ set_target_properties(browser PROPERTIES
1111)
1212
1313target_link_libraries (browser qmdnsengine Qt5::Widgets)
14+
15+ install (TARGETS browser
16+ RUNTIME DESTINATION "${EXAMPLE_DIR} "
17+ COMPONENT examples
18+ )
Original file line number Diff line number Diff line change 66add_executable (provider WIN32 ${SRC} )
77
88target_link_libraries (provider qmdnsengine Qt5::Widgets)
9+
10+ install (TARGETS provider
11+ RUNTIME DESTINATION "${EXAMPLE_DIR} "
12+ COMPONENT examples
13+ )
You can’t perform that action at this time.
0 commit comments