Skip to content

Commit b8fdf51

Browse files
committed
Fix a number of issues with the build system.
1 parent 2595bbe commit b8fdf51

File tree

5 files changed

+40
-7
lines changed

5 files changed

+40
-7
lines changed

CMakeLists.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ set(BIN_INSTALL_DIR bin CACHE STRING "Binary installation directory relative to
1515
set(LIB_INSTALL_DIR lib CACHE STRING "Library installation directory relative to the install prefix")
1616
set(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+
1821
find_package(Qt5Network 5.4 REQUIRED)
1922

2023
set(CMAKE_AUTOMOC ON)
@@ -40,9 +43,15 @@ if(BUILD_TESTS)
4043
add_subdirectory(tests)
4144
endif()
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}")
4648
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
4749
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
4850
set(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)

doc/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@ configure_file(Doxyfile.in "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
33
add_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+
)

examples/CMakeLists.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
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()

examples/browser/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ set_target_properties(browser PROPERTIES
1111
)
1212

1313
target_link_libraries(browser qmdnsengine Qt5::Widgets)
14+
15+
install(TARGETS browser
16+
RUNTIME DESTINATION "${EXAMPLE_DIR}"
17+
COMPONENT examples
18+
)

examples/provider/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ set(SRC
66
add_executable(provider WIN32 ${SRC})
77

88
target_link_libraries(provider qmdnsengine Qt5::Widgets)
9+
10+
install(TARGETS provider
11+
RUNTIME DESTINATION "${EXAMPLE_DIR}"
12+
COMPONENT examples
13+
)

0 commit comments

Comments
 (0)