Skip to content

Commit c10ff7c

Browse files
Merge pull request #69 from nairaner/feature/cmake-find
Add support for CMake Find config module
2 parents d2fb157 + 909c189 commit c10ff7c

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

CMakeLists.txt

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,27 @@ install(FILES
8080
COMPONENT license
8181
)
8282
install(TARGETS qtadvanceddocking
83-
EXPORT adsBinary
84-
RUNTIME DESTINATION bin COMPONENT library
85-
LIBRARY DESTINATION lib COMPONENT library
86-
ARCHIVE DESTINATION lib COMPONENT library
83+
EXPORT adsTargets
84+
RUNTIME DESTINATION bin
85+
LIBRARY DESTINATION lib
86+
ARCHIVE DESTINATION lib
87+
INCLUDES DESTINATION include
8788
)
89+
90+
include(CMakePackageConfigHelpers)
91+
write_basic_package_version_file("adsConfigVersion.cmake"
92+
VERSION ${ads_VERSION}
93+
COMPATIBILITY SameMajorVersion
94+
)
95+
install(EXPORT adsTargets
96+
FILE adsTargets.cmake
97+
NAMESPACE ads::
98+
DESTINATION lib/cmake/ads
99+
)
100+
install(FILES "adsConfig.cmake" "${CMAKE_BINARY_DIR}/adsConfigVersion.cmake"
101+
DESTINATION lib/cmake/ads
102+
)
103+
88104
target_include_directories(qtadvanceddocking PUBLIC
89105
"$<BUILD_INTERFACE:${ads_INCLUDE}>"
90106
$<INSTALL_INTERFACE:include>
@@ -93,7 +109,7 @@ target_link_libraries(qtadvanceddocking PUBLIC ${ads_LIBS})
93109
target_compile_definitions(qtadvanceddocking PRIVATE ${ads_COMPILE_DEFINE})
94110
set_target_properties(qtadvanceddocking PROPERTIES
95111
VERSION ${ads_VERSION}
96-
EXPORT_NAME "Qt Advanced Docking System"
112+
EXPORT_NAME "QtAdvancedDockingSystem"
97113
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib"
98114
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib"
99115
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/bin"

adsConfig.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include(CMakeFindDependencyMacro)
2+
find_dependency(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED)
3+
find_dependency(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED)
4+
find_dependency(Qt5Widgets ${REQUIRED_QT_VERSION} REQUIRED)
5+
include("${CMAKE_CURRENT_LIST_DIR}/adsTargets.cmake")

0 commit comments

Comments
 (0)