Rename qtk_library target to qtk.
This commit is contained in:
parent
dab3fdc9bd
commit
d6dbb5c2ff
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@ -198,13 +198,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Qtk Library
|
- name: Build Qtk Library
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cmake --build build/ --config Release --target qtk_library -- ${{ matrix.flags }}
|
run: cmake --build build/ --config Release --target qtk -- ${{ matrix.flags }}
|
||||||
|
|
||||||
# Packaging
|
# Packaging
|
||||||
|
|
||||||
- name: Install Qtk Library
|
- name: Install Qtk Library
|
||||||
shell: bash
|
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
|
- name: Package Qtk Library
|
||||||
shell: bash
|
shell: bash
|
||||||
|
@ -189,8 +189,8 @@ endif()
|
|||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
if(QTK_EXAMPLE)
|
if(QTK_EXAMPLE)
|
||||||
# Create a namespaced alias for linking with qtk_library in the example.
|
# Create a namespaced alias for linking with libqtk in the example.
|
||||||
add_library(${PROJECT_NAME}::qtk_library ALIAS qtk_library)
|
add_library(${PROJECT_NAME}::qtk ALIAS qtk)
|
||||||
add_subdirectory(example-app EXCLUDE_FROM_ALL)
|
add_subdirectory(example-app EXCLUDE_FROM_ALL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
10
README.md
10
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
|
* The shared library [libqtk](./src/qtk) provides classes that leverage QOpenGL functionality
|
||||||
while still using lower-level OpenGL APIs to customize the rendering process.
|
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).
|
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.
|
it is required by all other components in this project.
|
||||||
* The [Qtk desktop application](./src/app) is built using libqtk within a Qt application.
|
* 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.
|
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
|
```bash
|
||||||
# Install libqtk only
|
# Install libqtk only
|
||||||
cmake --build build-all/ --target qtk_library -- -j $(nproc)
|
cmake --build build-all/ --target qtk -- -j $(nproc)
|
||||||
cmake --install build-all/ --component qtk_library --prefix=/usr/local
|
cmake --install build-all/ --component qtk --prefix=/usr/local
|
||||||
-- Install configuration: "Release"
|
-- Install configuration: "Release"
|
||||||
-- Installing: /usr/local/lib/cmake/Qtk/QtkConfig.cmake
|
-- Installing: /usr/local/lib/cmake/Qtk/QtkConfig.cmake
|
||||||
-- Installing: /usr/local/lib/cmake/Qtk/QtkConfigVersion.cmake
|
-- Installing: /usr/local/lib/cmake/Qtk/QtkConfigVersion.cmake
|
||||||
-- Installing: /usr/local/lib/cmake/Qtk/QtkTargets.cmake
|
-- Installing: /usr/local/lib/cmake/Qtk/QtkTargets.cmake
|
||||||
-- Installing: /usr/local/lib/cmake/Qtk/QtkTargets-release.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/camera3d.h
|
||||||
-- Installing: /usr/local/include/qtk/input.h
|
-- Installing: /usr/local/include/qtk/input.h
|
||||||
-- Installing: /usr/local/include/qtk/meshrenderer.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
|
# The path here should be initialized during build configuration, so no need for --prefix
|
||||||
cmake --install build-all/ --component qtk_plugins
|
cmake --install build-all/ --component qtk_plugins
|
||||||
-- Install configuration: "Release"
|
-- 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/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
|
-- Up-to-date: /home/shaun/Qt/6.6.0/gcc_64/../../Tools/QtCreator/lib/Qt/plugins/designer/libqtk_collection.so
|
||||||
```
|
```
|
||||||
|
@ -56,7 +56,7 @@ endif()
|
|||||||
|
|
||||||
# Allow add_subdirectory on this project to use target ALIAS if available.
|
# 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 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)
|
find_package(Qtk 0.2 REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ configure_file(
|
|||||||
|
|
||||||
qt_add_executable(qtk_example ${EXAMPLE_SOURCES})
|
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 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}")
|
target_include_directories(qtk_example PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
|
|
||||||
install(
|
install(
|
||||||
|
@ -13,22 +13,22 @@ install(
|
|||||||
FILES
|
FILES
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||||
COMPONENT qtk_library
|
COMPONENT qtk
|
||||||
DESTINATION lib/cmake/${PROJECT_NAME}
|
DESTINATION lib/cmake/${PROJECT_NAME}
|
||||||
)
|
)
|
||||||
install(
|
install(
|
||||||
EXPORT qtk_export
|
EXPORT qtk_export
|
||||||
FILE ${PROJECT_NAME}Targets.cmake
|
FILE ${PROJECT_NAME}Targets.cmake
|
||||||
NAMESPACE ${PROJECT_NAME}::
|
NAMESPACE ${PROJECT_NAME}::
|
||||||
COMPONENT qtk_library
|
COMPONENT qtk
|
||||||
DESTINATION lib/cmake/${PROJECT_NAME}
|
DESTINATION lib/cmake/${PROJECT_NAME}
|
||||||
)
|
)
|
||||||
# System install for qtk_library
|
# System install for libqtk
|
||||||
install(
|
install(
|
||||||
TARGETS qtk_library
|
TARGETS qtk
|
||||||
# Associate qtk_library target with qtk-export
|
# Associate libqtk target with qtk-export
|
||||||
EXPORT qtk_export
|
EXPORT qtk_export
|
||||||
COMPONENT qtk_library
|
COMPONENT qtk
|
||||||
FILE_SET HEADERS DESTINATION include
|
FILE_SET HEADERS DESTINATION include
|
||||||
INCLUDES DESTINATION include
|
INCLUDES DESTINATION include
|
||||||
LIBRARY DESTINATION lib
|
LIBRARY DESTINATION lib
|
||||||
|
@ -29,7 +29,7 @@ target_sources(
|
|||||||
"${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)
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Qtk Widget Plugins
|
# 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.
|
# Otherwise, we just use them for building the Qtk desktop application.
|
||||||
if(QTK_PLUGINS)
|
if(QTK_PLUGINS)
|
||||||
install(
|
install(
|
||||||
TARGETS qtk_plugins qtk_library qtk_plugin_library
|
TARGETS qtk_plugins qtk qtk_plugin_library
|
||||||
COMPONENT qtk_plugins
|
COMPONENT qtk_plugins
|
||||||
LIBRARY DESTINATION "${QTK_PLUGIN_INSTALL_DIR}"
|
LIBRARY DESTINATION "${QTK_PLUGIN_INSTALL_DIR}"
|
||||||
ARCHIVE DESTINATION "${QTK_PLUGIN_INSTALL_DIR}"
|
ARCHIVE DESTINATION "${QTK_PLUGIN_INSTALL_DIR}"
|
||||||
|
@ -44,10 +44,10 @@ 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 EXCLUDE_FROM_ALL)
|
qt_add_library(qtk STATIC EXCLUDE_FROM_ALL)
|
||||||
target_sources(qtk_library PRIVATE ${QTK_LIBRARY_SOURCES})
|
target_sources(qtk PRIVATE ${QTK_LIBRARY_SOURCES})
|
||||||
target_sources(
|
target_sources(
|
||||||
qtk_library PUBLIC
|
qtk PUBLIC
|
||||||
FILE_SET HEADERS
|
FILE_SET HEADERS
|
||||||
BASE_DIRS $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
|
BASE_DIRS $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
|
||||||
BASE_DIRS $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>
|
BASE_DIRS $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>
|
||||||
@ -55,25 +55,25 @@ target_sources(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if(QTK_DEBUG)
|
if(QTK_DEBUG)
|
||||||
target_compile_definitions(qtk_library PUBLIC QTK_DEBUG)
|
target_compile_definitions(qtk PUBLIC QTK_DEBUG)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_target_properties(
|
set_target_properties(
|
||||||
qtk_library PROPERTIES
|
qtk PROPERTIES
|
||||||
VERSION ${PROJECT_VERSION}
|
VERSION ${PROJECT_VERSION}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
qtk_library PUBLIC
|
qtk PUBLIC
|
||||||
Qt6::Core Qt6::OpenGLWidgets Qt6::Widgets
|
Qt6::Core Qt6::OpenGLWidgets Qt6::Widgets
|
||||||
)
|
)
|
||||||
|
|
||||||
if(QTK_SUBMODULES OR NOT QTK_ASSIMP_NEW_INTERFACE)
|
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)
|
elseif(QTK_ASSIMP_NEW_INTERFACE)
|
||||||
target_link_libraries(qtk_library PUBLIC assimp::assimp)
|
target_link_libraries(qtk PUBLIC assimp::assimp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_link_libraries(qtk_library PUBLIC OpenGL::GL)
|
target_link_libraries(qtk PUBLIC OpenGL::GL)
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user