Compare commits

..

No commits in common. "baa2ed1e179f43e70e86f67be1dbfbf0dab0b354" and "195a4ef30d219a0844283789c98d7a1c9b09c37a" have entirely different histories.

5 changed files with 32 additions and 49 deletions

View File

@ -40,12 +40,6 @@ jobs:
cmake -B build/ ${{ matrix.cmake }} -DQTK_UPDATE_SUBMODULES=ON cmake -B build/ ${{ matrix.cmake }} -DQTK_UPDATE_SUBMODULES=ON
cmake --build build/ cmake --build build/
- name: OSX Stuff
if: matrix.os == 'macos-lates'
shell: bash
run: |
ls build/
- name: Package Qtk - name: Package Qtk
shell: bash shell: bash
run: | run: |

View File

@ -24,8 +24,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
if(MSVC) if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
add_compile_options(/WX:NO /wd4131 /wd4127) add_compile_options(/wd4131 /wd4127)
endif() endif()
################################################################################ ################################################################################
@ -84,7 +84,6 @@ if (QTK_PREFIX_QTCREATOR)
endif() endif()
message(STATUS "[Qtk] CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") message(STATUS "[Qtk] CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
set(QTK_RESOURCES "${CMAKE_SOURCE_DIR}/resources") set(QTK_RESOURCES "${CMAKE_SOURCE_DIR}/resources")
set(QTK_OSX_ICONS ${CMAKE_SOURCE_DIR}/resources/icons/osx/kilroy.icns)
# Print all QTK options and their values. # Print all QTK options and their values.
get_cmake_property(VAR_NAMES VARIABLES) get_cmake_property(VAR_NAMES VARIABLES)

View File

@ -29,7 +29,7 @@ install(
DESTINATION lib/cmake/Qtk DESTINATION lib/cmake/Qtk
) )
install( install(
EXPORT qtk_export EXPORT qtk-export
FILE QtkTargets.cmake FILE QtkTargets.cmake
NAMESPACE Qtk:: NAMESPACE Qtk::
DESTINATION lib/cmake/Qtk DESTINATION lib/cmake/Qtk
@ -43,11 +43,6 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Qt OpenGL 3D graphics library.")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/shaunrd0/qtk") set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/shaunrd0/qtk")
set(CPACK_SOURCE_IGNORE_FILES build;install;\.git;\.github;\.idea) set(CPACK_SOURCE_IGNORE_FILES build;install;\.git;\.github;\.idea)
set(CPACK_PACKAGE_DIRECTORY packages/) set(CPACK_PACKAGE_DIRECTORY packages/)
# OSX
set(CPACK_BUNDLE_NAME Qtk)
set(CPACK_BUNDLE_PLIST ${CMAKE_BINARY_DIR}/Info.plist)
set(CPACK_BUNDLE_ICON ${QTK_OSX_ICONS})
if(WIN32) if(WIN32)
set(CPACK_SOURCE_GENERATOR ZIP) set(CPACK_SOURCE_GENERATOR ZIP)
else() else()

View File

@ -23,16 +23,16 @@ set(
toolbox.h toolbox.h
treeview.h treeview.h
) )
qt_add_library(qtk_plugin_library STATIC) qt_add_library(qtk-plugin-library STATIC)
target_sources( target_sources(
qtk_plugin_library PRIVATE qtk-plugin-library PRIVATE
"${QTK_PLUGIN_LIBRARY_SOURCES}" "${QTK_PLUGIN_LIBRARY_SOURCES}"
"${QTK_PLUGIN_LIBRARY_HEADERS}" "${QTK_PLUGIN_LIBRARY_HEADERS}"
) )
target_link_libraries(qtk_plugin_library PUBLIC Qt6::UiPlugin qtk_library) target_link_libraries(qtk-plugin-library PUBLIC Qt6::UiPlugin qtk-library)
install( install(
TARGETS qtk_plugin_library TARGETS qtk-plugin-library
BUNDLE DESTINATION lib BUNDLE DESTINATION lib
LIBRARY DESTINATION lib LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static ARCHIVE DESTINATION lib/static
@ -40,7 +40,7 @@ install(
) )
install( install(
TARGETS qtk_plugin_library TARGETS qtk-plugin-library
BUNDLE DESTINATION "${QTK_PLUGIN_LIBRARY_DIR}" BUNDLE DESTINATION "${QTK_PLUGIN_LIBRARY_DIR}"
LIBRARY DESTINATION "${QTK_PLUGIN_LIBRARY_DIR}" LIBRARY DESTINATION "${QTK_PLUGIN_LIBRARY_DIR}"
RUNTIME DESTINATION "${QTK_PLUGIN_LIBRARY_DIR}" RUNTIME DESTINATION "${QTK_PLUGIN_LIBRARY_DIR}"
@ -57,7 +57,7 @@ target_sources(
widgetplugincollection.cpp widgetplugincollection.h widgetplugincollection.cpp widgetplugincollection.h
widgetplugin.cpp widgetplugin.h widgetplugin.cpp widgetplugin.h
) )
target_link_libraries(qtk_collection PUBLIC qtk_plugin_library) target_link_libraries(qtk_collection PUBLIC qtk-plugin-library)
install( install(
TARGETS qtk_collection TARGETS qtk_collection
@ -84,31 +84,26 @@ configure_file(
@ONLY @ONLY
) )
qt_add_executable(qtk_main ${QTK_APP_SOURCES}) qt_add_executable(qtk-main ${QTK_APP_SOURCES})
target_link_libraries(qtk_main PRIVATE qtk_plugin_library) target_link_libraries(qtk-main PRIVATE qtk-plugin-library)
set_target_properties( set_target_properties(
qtk_main PROPERTIES qtk-main PROPERTIES
WIN32_EXECUTABLE TRUE WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_BUNDLE_NAME Qtk
MACOSX_BUNDLE_ICON_FILE ${QTK_OSX_ICONS}
MACOSX_BUNDLE_GUI_IDENTIFIER ${CMAKE_PROJECT_NAME}
MACOSX_BUNDLE_INFO_STRING ${CMAKE_PROJECT_DESCRIPTION}
MACOSX_BUNDLE_COPYRIGHT "All Content (c) 2023 Shaun Reed, all rights reserved"
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
) )
install( install(
TARGETS qtk_main TARGETS qtk-main
BUNDLE DESTINATION bin BUNDLE DESTINATION bin
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
LIBRARY DESTINATION bin/lib LIBRARY DESTINATION bin/lib
) )
qt_generate_deploy_app_script( qt_generate_deploy_app_script(
TARGET qtk_main TARGET qtk-main
FILENAME_VARIABLE QTK_DEPLOY_SCRIPT FILENAME_VARIABLE QTK_DEPLOY_SCRIPT
NO_UNSUPPORTED_PLATFORM_ERROR NO_UNSUPPORTED_PLATFORM_ERROR
) )
@ -126,16 +121,16 @@ if(WIN32)
if(TARGET Qt6::windeployqt) if(TARGET Qt6::windeployqt)
add_custom_command( add_custom_command(
TARGET qtk_main TARGET qtk-main
POST_BUILD POST_BUILD
COMMAND set PATH=%PATH%$<SEMICOLON>${qt6_install_prefix} COMMAND set PATH=%PATH%$<SEMICOLON>${qt6_install_prefix}
COMMAND Qt6::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:qtk_main>/$<TARGET_FILE_NAME:qtk_main>" COMMAND Qt6::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:qtk-main>/$<TARGET_FILE_NAME:qtk-main>"
) )
install(DIRECTORY "${CMAKE_BINARY_DIR}/windeployqt/" DESTINATION bin) install(DIRECTORY "${CMAKE_BINARY_DIR}/windeployqt/" DESTINATION bin)
endif() endif()
if(MSVC AND TARGET Qt6::qmake) if(MSVC AND TARGET Qt6::qmake)
set(VSUSER_FILE "${CMAKE_CURRENT_BINARY_DIR}/qtk_main.vcxproj.user") set(VSUSER_FILE "${CMAKE_CURRENT_BINARY_DIR}/qtk-main.vcxproj.user")
file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/extern/assimp/assimp/bin" assimp_bin) file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/extern/assimp/assimp/bin" assimp_bin)
file(WRITE ${VSUSER_FILE} "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n") file(WRITE ${VSUSER_FILE} "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
file(APPEND ${VSUSER_FILE} "<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n") file(APPEND ${VSUSER_FILE} "<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n")

View File

@ -44,46 +44,46 @@ set(
) )
qt6_add_big_resources(QTK_LIBRARY_SOURCES "${QTK_RESOURCES}/resources.qrc") qt6_add_big_resources(QTK_LIBRARY_SOURCES "${QTK_RESOURCES}/resources.qrc")
qt_add_library(qtk_library STATIC) qt_add_library(qtk-library STATIC)
target_sources(qtk_library PRIVATE ${QTK_LIBRARY_SOURCES}) target_sources(qtk-library PRIVATE ${QTK_LIBRARY_SOURCES})
target_sources( target_sources(
qtk_library PUBLIC qtk-library PUBLIC
FILE_SET HEADERS FILE_SET HEADERS
BASE_DIRS "${CMAKE_SOURCE_DIR}/src" BASE_DIRS "${CMAKE_SOURCE_DIR}/src"
FILES ${QTK_LIBRARY_PUBLIC_HEADERS} FILES ${QTK_LIBRARY_PUBLIC_HEADERS}
) )
if(QTK_DEBUG) if(QTK_DEBUG)
target_compile_definitions(qtk_library PUBLIC QTK_DEBUG) target_compile_definitions(qtk-library PUBLIC QTK_DEBUG)
endif() endif()
set_target_properties( set_target_properties(
qtk_library PROPERTIES qtk-library PROPERTIES
WIN32_EXECUTABLE TRUE WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE MACOSX_BUNDLE TRUE
VERSION ${PROJECT_VERSION} VERSION ${PROJECT_VERSION}
) )
target_link_libraries( target_link_libraries(
qtk_library PUBLIC qtk-library PUBLIC
Qt6::Core Qt6::OpenGLWidgets Qt6::Widgets Qt6::Core Qt6::OpenGLWidgets Qt6::Widgets
) )
if(QTK_UPDATE_SUBMODULES OR NOT ASSIMP_NEW_INTERFACE) if(QTK_UPDATE_SUBMODULES OR NOT ASSIMP_NEW_INTERFACE)
target_link_libraries(qtk_library PUBLIC assimp) target_link_libraries(qtk-library PUBLIC assimp)
elseif(ASSIMP_NEW_INTERFACE) elseif(ASSIMP_NEW_INTERFACE)
target_link_libraries(qtk_library PUBLIC assimp::assimp) target_link_libraries(qtk-library PUBLIC assimp::assimp)
endif() endif()
if(WIN32) if(WIN32)
target_link_libraries(qtk_library PUBLIC OpenGL::GL) target_link_libraries(qtk-library PUBLIC OpenGL::GL)
endif() endif()
# System install for qtk_library # System install for qtk-library
install( install(
TARGETS qtk_library TARGETS qtk-library
# Associate qtk_library target with qtk-export # Associate qtk-library target with qtk-export
EXPORT qtk_export EXPORT qtk-export
FILE_SET HEADERS DESTINATION include FILE_SET HEADERS DESTINATION include
BUNDLE DESTINATION lib BUNDLE DESTINATION lib
LIBRARY DESTINATION lib LIBRARY DESTINATION lib
@ -92,9 +92,9 @@ install(
INCLUDES DESTINATION include INCLUDES DESTINATION include
) )
## Install qtk_library to Qt Designer to support widget plugins. ## Install qtk-library to Qt Designer to support widget plugins.
install( install(
TARGETS qtk_library TARGETS qtk-library
BUNDLE DESTINATION "${QTK_PLUGIN_LIBRARY_DIR}" BUNDLE DESTINATION "${QTK_PLUGIN_LIBRARY_DIR}"
LIBRARY DESTINATION "${QTK_PLUGIN_LIBRARY_DIR}" LIBRARY DESTINATION "${QTK_PLUGIN_LIBRARY_DIR}"
ARCHIVE DESTINATION "${QTK_PLUGIN_LIBRARY_DIR}" ARCHIVE DESTINATION "${QTK_PLUGIN_LIBRARY_DIR}"