Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved cmake installation instructions #237

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cmake/QuickQanavaConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include(CMakeFindDependencyMacro)

find_dependency(Qt6 COMPONENTS Core Quick Qml Quick QuickControls2)

@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
check_required_components("@PROJECT_NAME@")
58 changes: 49 additions & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ set(qan_source_files

set (qan_header_files
qanAbstractDraggableCtrl.h
qanAnalysisTimeHeatMap.h
qanBehaviour.h
qanBottomRightResizer.h
qanRightResizer.h
Expand All @@ -45,6 +46,7 @@ set (qan_header_files
qanEdgeDraggableCtrl.h
qanEdgeItem.h
qanGraph.h
qanGraph.hpp
qanGraphView.h
qanGrid.h
qanGroup.h
Expand All @@ -58,13 +60,15 @@ set (qan_header_files
qanSelectable.h
qanStyle.h
qanStyleManager.h
qanAnalysisTimeHeatMap.cpp
qanUtils.h
qanTableGroup.h
qanTableCell.h
qanTableBorder.h
qanTableGroupItem.h
QuickQanava.h
)

set (gtpo_header_files
gtpo/container_adapter.h
gtpo/edge.h
gtpo/graph.h
Expand Down Expand Up @@ -97,7 +101,7 @@ set (qan_plugin_files

# Configure Qt
set(CMAKE_AUTOMOC ON)
qt_wrap_cpp(qan_source_files, qan_header_files) # Creates .moc files from sources
qt_wrap_cpp(qan_source_files, qan_header_files, gtpo_header_files) # Creates .moc files from sources
set(CMAKE_AUTORCC ON)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:QT_QML_DEBUG>)

Expand All @@ -106,6 +110,7 @@ list(APPEND qan_resources QuickQanava_static.qrc)
add_library(QuickQanava STATIC
${qan_source_files}
${qan_header_files}
${gtpo_header_files}
${quickcontainers_source_files}
${quickcontainers_header_files}
${qan_resources}
Expand All @@ -122,24 +127,59 @@ target_compile_features(QuickQanava
cxx_std_17
)


set(CMAKE_INCLUDE_CURRENT_DIR ON)
target_link_libraries(QuickQanava PUBLIC Qt6::Core
Qt6::Gui
Qt6::Qml
Qt6::Quick
Qt6::QuickControls2)


install(FILES
${qan_header_files}
DESTINATION include/quickqanava
)

install(FILES
${gtpo_header_files}
DESTINATION include/quickqanava/gtpo
)

install(FILES
${quickcontainers_header_files}
DESTINATION include/quickcontainers
)

install(TARGETS QuickQanava
EXPORT Targets
EXPORT ${PROJECT_NAME}Targets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include/quickqanava
)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
target_link_libraries(QuickQanava PUBLIC Qt6::Core
Qt6::Gui
Qt6::Qml
Qt6::Quick
Qt6::QuickControls2)
# Export the package for use from the build tree
export(TARGETS
${PROJECT_NAME}
FILE cmake/${PROJECT_NAME}Targets.cmake)
export(PACKAGE ${PROJECT_NAME})

include(CMakePackageConfigHelpers)
write_basic_package_version_file(
cmake/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion)

configure_package_config_file(
${CMAKE_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in
cmake/${PROJECT_NAME}Config.cmake
INSTALL_DESTINATION lib/cmake/)

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION lib/cmake/)

install(EXPORT ${PROJECT_NAME}Targets
DESTINATION lib/cmake/)