From d6dbb5c2ffbc796771aa34e0095dafc52e568bcd Mon Sep 17 00:00:00 2001
From: Shaun Reed <shaunrd0@gmail.com>
Date: Sun, 16 Mar 2025 14:53:52 -0400
Subject: [PATCH] Rename qtk_library target to qtk.

---
 .github/workflows/build.yml         |  4 ++--
 CMakeLists.txt                      |  4 ++--
 README.md                           | 10 +++++-----
 example-app/CMakeLists.txt          |  4 ++--
 src/CMakeLists.txt                  | 12 ++++++------
 src/designer-plugins/CMakeLists.txt |  4 ++--
 src/qtk/CMakeLists.txt              | 18 +++++++++---------
 7 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 9f3911a..ec6ca5d 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -198,13 +198,13 @@ jobs:
 
       - name: Build Qtk Library
         shell: bash
-        run: cmake --build build/ --config Release --target qtk_library -- ${{ matrix.flags }}
+        run: cmake --build build/ --config Release --target qtk -- ${{ matrix.flags }}
 
       # Packaging
 
       - name: Install Qtk Library
         shell: bash
-        run: cmake --install build/ --config Release --prefix=$(pwd)/install --component qtk_library
+        run: cmake --install build/ --config Release --prefix=$(pwd)/install --component qtk
 
       - name: Package Qtk Library
         shell: bash
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a6d5061..2c64a3b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -189,8 +189,8 @@ endif()
 add_subdirectory(src)
 
 if(QTK_EXAMPLE)
-  # Create a namespaced alias for linking with qtk_library in the example.
-  add_library(${PROJECT_NAME}::qtk_library ALIAS qtk_library)
+  # Create a namespaced alias for linking with libqtk in the example.
+  add_library(${PROJECT_NAME}::qtk ALIAS qtk)
   add_subdirectory(example-app EXCLUDE_FROM_ALL)
 endif()
 
diff --git a/README.md b/README.md
index da15daa..df4870d 100644
--- a/README.md
+++ b/README.md
@@ -97,7 +97,7 @@ Qtk is composed of three separate components.
 * The shared library [libqtk](./src/qtk) provides classes that leverage QOpenGL functionality
 while still using lower-level OpenGL APIs to customize the rendering process.
 Many of these classes can be further expanded, such as [Qtk::Scene](./src/qtk/scene.h).
-This taget, `qtk_library` in cmake, is always selected to build and install as
+This taget, `qtk` in cmake, is always selected to build and install as
 it is required by all other components in this project.
 * The [Qtk desktop application](./src/app) is built using libqtk within a Qt application.
 This target, `qtk_gui` in cmake, is optional and can be controlled using the `QTK_GUI` option below.
@@ -174,14 +174,14 @@ Here we will install to the `/usr/local/` path.
 
 ```bash
 # Install libqtk only
-cmake --build build-all/ --target qtk_library -- -j $(nproc)
-cmake --install build-all/ --component qtk_library --prefix=/usr/local
+cmake --build build-all/ --target qtk -- -j $(nproc)
+cmake --install build-all/ --component qtk --prefix=/usr/local
 -- Install configuration: "Release"
 -- Installing: /usr/local/lib/cmake/Qtk/QtkConfig.cmake
 -- Installing: /usr/local/lib/cmake/Qtk/QtkConfigVersion.cmake
 -- Installing: /usr/local/lib/cmake/Qtk/QtkTargets.cmake
 -- Installing: /usr/local/lib/cmake/Qtk/QtkTargets-release.cmake
--- Installing: /usr/local/lib/static/libqtk_library.a
+-- Installing: /usr/local/lib/static/libqtk.a
 -- Installing: /usr/local/include/qtk/camera3d.h
 -- Installing: /usr/local/include/qtk/input.h
 -- Installing: /usr/local/include/qtk/meshrenderer.h
@@ -238,7 +238,7 @@ cmake --build build-all/ --target qtk_plugins -- -j $(nproc)
 # The path here should be initialized during build configuration, so no need for --prefix
 cmake --install build-all/ --component qtk_plugins
 -- Install configuration: "Release"
--- Up-to-date: /home/shaun/Qt/6.6.0/gcc_64/../../Tools/QtCreator/lib/Qt/lib/libqtk_library.a
+-- Up-to-date: /home/shaun/Qt/6.6.0/gcc_64/../../Tools/QtCreator/lib/Qt/lib/libqtk.a
 -- Up-to-date: /home/shaun/Qt/6.6.0/gcc_64/../../Tools/QtCreator/lib/Qt/lib/libqtk_plugin_library.a
 -- Up-to-date: /home/shaun/Qt/6.6.0/gcc_64/../../Tools/QtCreator/lib/Qt/plugins/designer/libqtk_collection.so
 ```
diff --git a/example-app/CMakeLists.txt b/example-app/CMakeLists.txt
index 6b19e5c..71d7565 100644
--- a/example-app/CMakeLists.txt
+++ b/example-app/CMakeLists.txt
@@ -56,7 +56,7 @@ endif()
 
 # Allow add_subdirectory on this project to use target ALIAS if available.
 # If this example project is opened standalone we will use find_package.
-if(NOT TARGET Qtk::qtk_library)
+if(NOT TARGET Qtk::qtk)
   find_package(Qtk 0.2 REQUIRED)
 endif()
 
@@ -77,7 +77,7 @@ configure_file(
 
 qt_add_executable(qtk_example ${EXAMPLE_SOURCES})
 target_link_libraries(qtk_example PUBLIC Qt6::Widgets Qt6::OpenGLWidgets Qt6::Core)
-target_link_libraries(qtk_example PUBLIC Qtk::qtk_library)
+target_link_libraries(qtk_example PUBLIC Qtk::qtk)
 target_include_directories(qtk_example PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
 
 install(
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 071757e..12fa140 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -13,22 +13,22 @@ install(
     FILES
     "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
     "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
-    COMPONENT qtk_library
+    COMPONENT qtk
     DESTINATION lib/cmake/${PROJECT_NAME}
 )
 install(
     EXPORT qtk_export
     FILE ${PROJECT_NAME}Targets.cmake
     NAMESPACE ${PROJECT_NAME}::
-    COMPONENT qtk_library
+    COMPONENT qtk
     DESTINATION lib/cmake/${PROJECT_NAME}
 )
-# System install for qtk_library
+# System install for libqtk
 install(
-    TARGETS qtk_library
-    # Associate qtk_library target with qtk-export
+    TARGETS qtk
+    # Associate libqtk target with qtk-export
     EXPORT qtk_export
-    COMPONENT qtk_library
+    COMPONENT qtk
     FILE_SET HEADERS DESTINATION include
     INCLUDES DESTINATION include
     LIBRARY DESTINATION lib
diff --git a/src/designer-plugins/CMakeLists.txt b/src/designer-plugins/CMakeLists.txt
index 92cf2bb..cab504f 100644
--- a/src/designer-plugins/CMakeLists.txt
+++ b/src/designer-plugins/CMakeLists.txt
@@ -29,7 +29,7 @@ target_sources(
     "${QTK_PLUGIN_LIBRARY_SOURCES}"
     "${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)
 
 ################################################################################
 # Qtk Widget Plugins
@@ -47,7 +47,7 @@ target_link_libraries(qtk_plugins PUBLIC qtk_plugin_library)
 # Otherwise, we just use them for building the Qtk desktop application.
 if(QTK_PLUGINS)
   install(
-      TARGETS qtk_plugins qtk_library qtk_plugin_library
+      TARGETS qtk_plugins qtk qtk_plugin_library
       COMPONENT qtk_plugins
       LIBRARY DESTINATION "${QTK_PLUGIN_INSTALL_DIR}"
       ARCHIVE DESTINATION "${QTK_PLUGIN_INSTALL_DIR}"
diff --git a/src/qtk/CMakeLists.txt b/src/qtk/CMakeLists.txt
index 6865fc8..25ca8bc 100644
--- a/src/qtk/CMakeLists.txt
+++ b/src/qtk/CMakeLists.txt
@@ -44,10 +44,10 @@ set(
 )
 
 qt6_add_big_resources(QTK_LIBRARY_SOURCES "${QTK_RESOURCES}/resources.qrc")
-qt_add_library(qtk_library STATIC EXCLUDE_FROM_ALL)
-target_sources(qtk_library PRIVATE ${QTK_LIBRARY_SOURCES})
+qt_add_library(qtk STATIC EXCLUDE_FROM_ALL)
+target_sources(qtk PRIVATE ${QTK_LIBRARY_SOURCES})
 target_sources(
-    qtk_library PUBLIC
+    qtk PUBLIC
     FILE_SET HEADERS
       BASE_DIRS $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
       BASE_DIRS $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>
@@ -55,25 +55,25 @@ target_sources(
 )
 
 if(QTK_DEBUG)
-  target_compile_definitions(qtk_library PUBLIC QTK_DEBUG)
+  target_compile_definitions(qtk PUBLIC QTK_DEBUG)
 endif()
 
 set_target_properties(
-    qtk_library PROPERTIES
+    qtk PROPERTIES
       VERSION ${PROJECT_VERSION}
 )
 
 target_link_libraries(
-    qtk_library PUBLIC
+    qtk PUBLIC
     Qt6::Core Qt6::OpenGLWidgets Qt6::Widgets
 )
 
 if(QTK_SUBMODULES OR NOT QTK_ASSIMP_NEW_INTERFACE)
-  target_link_libraries(qtk_library PUBLIC assimp)
+  target_link_libraries(qtk PUBLIC assimp)
 elseif(QTK_ASSIMP_NEW_INTERFACE)
-  target_link_libraries(qtk_library PUBLIC assimp::assimp)
+  target_link_libraries(qtk PUBLIC assimp::assimp)
 endif()
 
 if(WIN32)
-  target_link_libraries(qtk_library PUBLIC OpenGL::GL)
+  target_link_libraries(qtk PUBLIC OpenGL::GL)
 endif()