Merge pull request #69 from nairaner/feature/cmake-find

Add support for CMake Find config module
This commit is contained in:
githubuser0xFFFF 2019-10-01 11:58:37 +02:00 committed by GitHub
commit c10ff7c688
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 5 deletions

View File

@ -80,11 +80,27 @@ install(FILES
COMPONENT license
)
install(TARGETS qtadvanceddocking
EXPORT adsBinary
RUNTIME DESTINATION bin COMPONENT library
LIBRARY DESTINATION lib COMPONENT library
ARCHIVE DESTINATION lib COMPONENT library
EXPORT adsTargets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
INCLUDES DESTINATION include
)
include(CMakePackageConfigHelpers)
write_basic_package_version_file("adsConfigVersion.cmake"
VERSION ${ads_VERSION}
COMPATIBILITY SameMajorVersion
)
install(EXPORT adsTargets
FILE adsTargets.cmake
NAMESPACE ads::
DESTINATION lib/cmake/ads
)
install(FILES "adsConfig.cmake" "${CMAKE_BINARY_DIR}/adsConfigVersion.cmake"
DESTINATION lib/cmake/ads
)
target_include_directories(qtadvanceddocking PUBLIC
"$<BUILD_INTERFACE:${ads_INCLUDE}>"
$<INSTALL_INTERFACE:include>

5
adsConfig.cmake Normal file
View File

@ -0,0 +1,5 @@
include(CMakeFindDependencyMacro)
find_dependency(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED)
find_dependency(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED)
find_dependency(Qt5Widgets ${REQUIRED_QT_VERSION} REQUIRED)
include("${CMAKE_CURRENT_LIST_DIR}/adsTargets.cmake")