mirror of
https://github.com/gamecreature/QtAwesome.git
synced 2024-11-15 13:35:44 +08:00
Fix CMake install() for proper find_package()/add_subdirectory() support
This commit is contained in:
parent
91111568fd
commit
45e3e703b1
@ -20,25 +20,35 @@ add_library(QtAwesome
|
|||||||
QtAwesome/QtAwesomeFree.qrc
|
QtAwesome/QtAwesomeFree.qrc
|
||||||
)
|
)
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
target_include_directories(QtAwesome
|
target_include_directories(QtAwesome
|
||||||
INTERFACE ${PROJECT_SOURCE_DIR}/QtAwesome
|
INTERFACE
|
||||||
|
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/QtAwesome>
|
||||||
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(QtAwesome PUBLIC
|
target_link_libraries(QtAwesome PUBLIC
|
||||||
Qt${QT_VERSION_MAJOR}::Widgets
|
Qt${QT_VERSION_MAJOR}::Widgets
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS QtAwesome
|
install(TARGETS QtAwesome EXPORT QtAwesomeConfig
|
||||||
RUNTIME DESTINATION bin
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINARYDIR}
|
||||||
LIBRARY DESTINATION lib
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
ARCHIVE DESTINATION lib
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
install(EXPORT QtAwesomeConfig
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/QtAwesome/
|
||||||
|
NAMESPACE QtAwesome::
|
||||||
|
)
|
||||||
|
export(EXPORT QtAwesomeConfig NAMESPACE QtAwesome::)
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
QtAwesome/QtAwesome.h
|
QtAwesome/QtAwesome.h
|
||||||
QtAwesome/QtAwesomeAnim.h
|
QtAwesome/QtAwesomeAnim.h
|
||||||
QtAwesome/QtAwesomeEnumGenerated.h
|
QtAwesome/QtAwesomeEnumGenerated.h
|
||||||
QtAwesome/QtAwesomeStringGenerated.h
|
QtAwesome/QtAwesomeStringGenerated.h
|
||||||
DESTINATION include
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/QtAwesome
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user