2022-12-18 14:19:04 +00:00
|
|
|
################################################################################
|
|
|
|
## Project for working with OpenGL and Qt6 widgets ##
|
2023-01-02 03:26:58 +00:00
|
|
|
## ##
|
|
|
|
## Author: Shaun Reed | Contact: shaunrd0@gmail.com | URL: www.shaunreed.com ##
|
|
|
|
## All Content (c) 2023 Shaun Reed, all rights reserved ##
|
2022-12-18 14:19:04 +00:00
|
|
|
################################################################################
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Qtk Widget Library
|
|
|
|
################################################################################
|
|
|
|
# Create a library of widgets used to build Qtk GUI
|
2023-01-03 03:18:53 +00:00
|
|
|
set(
|
|
|
|
QTK_PLUGIN_LIBRARY_SOURCES
|
|
|
|
qtkwidget.cpp qtkwidget.h
|
2022-12-18 14:19:04 +00:00
|
|
|
debugconsole.cpp debugconsole.ui
|
|
|
|
toolbox.cpp toolbox.ui
|
|
|
|
treeview.cpp treeview.ui
|
|
|
|
)
|
2023-01-03 03:18:53 +00:00
|
|
|
set(
|
|
|
|
QTK_PLUGIN_LIBRARY_HEADERS
|
2022-12-18 14:19:04 +00:00
|
|
|
debugconsole.h
|
|
|
|
toolbox.h
|
|
|
|
treeview.h
|
|
|
|
)
|
|
|
|
qt_add_library(qtk-plugin-library SHARED)
|
2023-01-03 03:18:53 +00:00
|
|
|
target_sources(
|
|
|
|
qtk-plugin-library PRIVATE
|
|
|
|
"${QTK_PLUGIN_LIBRARY_SOURCES}"
|
|
|
|
"${QTK_PLUGIN_LIBRARY_HEADERS}"
|
2022-12-18 14:19:04 +00:00
|
|
|
)
|
|
|
|
target_link_libraries(qtk-plugin-library PUBLIC Qt6::UiPlugin qtk-library)
|
|
|
|
|
2023-01-03 03:18:53 +00:00
|
|
|
install(
|
|
|
|
TARGETS qtk-plugin-library
|
|
|
|
BUNDLE DESTINATION lib
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib/static
|
|
|
|
RUNTIME DESTINATION bin
|
2022-12-18 14:19:04 +00:00
|
|
|
)
|
|
|
|
|
2023-01-03 03:18:53 +00:00
|
|
|
install(
|
|
|
|
TARGETS qtk-plugin-library
|
|
|
|
BUNDLE DESTINATION "${QTK_PLUGIN_LIBRARY_DIR}"
|
|
|
|
LIBRARY DESTINATION "${QTK_PLUGIN_LIBRARY_DIR}"
|
|
|
|
RUNTIME DESTINATION "${QTK_PLUGIN_LIBRARY_DIR}"
|
|
|
|
ARCHIVE DESTINATION "${QTK_PLUGIN_LIBRARY_DIR}"
|
2022-12-18 14:19:04 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Qtk Widget Collection Plugin
|
|
|
|
################################################################################
|
|
|
|
# Create a Qt Designer plugin for a collection of widgets from our library.
|
|
|
|
qt_add_plugin(qtk-collection)
|
2023-01-03 03:18:53 +00:00
|
|
|
target_sources(
|
|
|
|
qtk-collection PRIVATE
|
2022-12-18 14:19:04 +00:00
|
|
|
widgetplugincollection.cpp widgetplugincollection.h
|
|
|
|
widgetplugin.cpp widgetplugin.h
|
|
|
|
)
|
|
|
|
target_link_libraries(qtk-collection PUBLIC qtk-plugin-library)
|
|
|
|
|
2023-01-03 03:18:53 +00:00
|
|
|
install(
|
|
|
|
TARGETS qtk-collection
|
|
|
|
RUNTIME DESTINATION "${QTK_PLUGIN_INSTALL_DIR}"
|
|
|
|
BUNDLE DESTINATION "${QTK_PLUGIN_INSTALL_DIR}"
|
|
|
|
LIBRARY DESTINATION "${QTK_PLUGIN_INSTALL_DIR}"
|
2022-12-18 14:19:04 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Final Qtk Application
|
|
|
|
################################################################################
|
|
|
|
|
2023-01-03 03:18:53 +00:00
|
|
|
set(
|
|
|
|
QTK_APP_SOURCES
|
2022-12-18 14:19:04 +00:00
|
|
|
examplescene.cpp examplescene.h
|
|
|
|
qtkmainwindow.cpp qtkmainwindow.ui
|
|
|
|
qtkmainwindow.h
|
|
|
|
main.cpp
|
|
|
|
)
|
2023-01-03 03:18:53 +00:00
|
|
|
# TODO: Qtk library should not depend on these resources. (qtkapi.h)
|
|
|
|
# Or should some resources be installed somewhere?
|
|
|
|
qt6_add_resources(QTK_APP_SOURCES "${QTK_RESOURCES}/resources.qrc")
|
2022-12-18 14:19:04 +00:00
|
|
|
configure_file(
|
2023-01-03 03:18:53 +00:00
|
|
|
resources.h.in
|
2022-12-18 14:19:04 +00:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/resources.h"
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
|
|
|
|
qt_add_executable(qtk-main ${QTK_APP_SOURCES})
|
|
|
|
target_link_libraries(qtk-main PRIVATE qtk-plugin-library)
|
|
|
|
|
2023-01-03 03:18:53 +00:00
|
|
|
set_target_properties(
|
|
|
|
qtk-main PROPERTIES
|
2022-12-18 14:19:04 +00:00
|
|
|
WIN32_EXECUTABLE TRUE
|
|
|
|
MACOSX_BUNDLE TRUE
|
|
|
|
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
|
|
|
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
|
|
|
)
|
|
|
|
|
2023-01-03 03:18:53 +00:00
|
|
|
install(
|
|
|
|
TARGETS qtk-main
|
|
|
|
BUNDLE DESTINATION bin
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION bin/lib
|
2022-12-18 14:19:04 +00:00
|
|
|
)
|