From d295cb14d5d7d707ae52d6ac9e0fd10a0ac51c79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sun, 31 Dec 2023 15:57:34 +0100 Subject: [PATCH] rely on cmake BUILD_SHARED_LIBS variable instead of building both version --- CMakeLists.txt | 404 ++++++++++++++++++------------------------- external/glutess | 2 +- tests/CMakeLists.txt | 8 +- tests/gradient2.c | 15 +- vkh | 2 +- 5 files changed, 182 insertions(+), 249 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ca5d05b..1f79c296 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,8 @@ SET(CMAKE_${LANG}_EXTENSIONS on) SET(CMAKE_CXX_STANDARD 11) -OPTION (VKVG_BUILD_SHARED_LIB "Build using shared libraries" ON) +#OPTION (VKVG_BUILD_SHARED_LIB "Build using shared libraries" OFF) +#SET(BUILD_SHARED_LIBS ${VKVG_BUILD_SHARED_LIB}) PROJECT(vkvg VERSION 0.3.0 DESCRIPTION "Vulkan Vector Graphic") @@ -27,8 +28,13 @@ IF(NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE Release) ENDIF() + IF (UNIX) ADD_COMPILE_OPTIONS(-lm) + IF (BUILD_SHARED_LIBS) + #force PIC for all subproject, even static libs + ADD_COMPILE_OPTIONS(-fPIC) + ENDIF() ENDIF() if (CMAKE_BUILD_TYPE STREQUAL "Debug") @@ -53,7 +59,7 @@ ELSE() IF (ANDROID) ADD_COMPILE_OPTIONS(-O3 -w -pedantic) ELSEIF (UNIX) - ADD_COMPILE_OPTIONS(-O3 -w -pedantic -fvisibility=hidden -fno-rtti) + #ADD_COMPILE_OPTIONS(-O3 -w -pedantic -fvisibility=hidden -fno-rtti) #ADD_COMPILE_OPTIONS(-flto -pthread -lpthread -Wl,--no-as-needed) ELSEIF(MSVC) ADD_COMPILE_OPTIONS(/O2 /TC /W0 /Od) @@ -71,7 +77,7 @@ IF (ENABLE_PROFILING) -falign-loops -falign-labels) ENDIF() -OPTION(VKVG_RECORDING "enable experimental recording functions" ON) +OPTION(VKVG_RECORDING "enable experimental recording functions" OFF) OPTION(VKVG_PREMULT_ALPHA "use premultiplied alpha for internal rendering" ON) IF (VKVG_PREMULT_ALPHA) @@ -86,22 +92,7 @@ ENDIF () OPTION(VKVG_USE_GLUTESS "Fill non-zero with glu tesselator" ON) -CMAKE_DEPENDENT_OPTION(VKVG_SVG "render svg with vkvg-svg library" ON "UNIX" OFF) - -INCLUDE ("${CMAKE_CURRENT_SOURCE_DIR}/cmake/GitSubmoduleUpdate.cmake") - -IF(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") - OPTION(GIT_SUBMODULE "Check submodules during build" OFF) - IF(GIT_SUBMODULE) - updateGitSubmodule(vkh) - IF (VKVG_USE_GLUTESS) - updateGitSubmodule(external/glutess) - ENDIF () - IF (VKVG_SVG) - updateGitSubmodule(external/vkvg-svg) - ENDIF () - endif() -ENDIF () +CMAKE_DEPENDENT_OPTION(VKVG_SVG "render svg with vkvg-svg library" OFF "UNIX" OFF) IF (NOT TARGET vkh) ADD_SUBDIRECTORY (vkh) @@ -123,7 +114,6 @@ IF (VKVG_WIRED_FILL) ADD_DEFINITIONS (-DVKVG_WIRED_DEBUG) ENDIF () - FIND_PACKAGE(Vulkan REQUIRED) FIND_PACKAGE(Freetype QUIET) @@ -257,231 +247,173 @@ ENDIF() CONFIGURE_FILE(vkvg.pc.in vkvg.pc @ONLY) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/vkvg.pc DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig) +GET_DIRECTORY_PROPERTY (vkvg_has_root_project PARENT_DIRECTORY) -FUNCTION (setup_lib LibName) - LIST (APPEND VKVG_TARGETS ${LibName}) - SET_TARGET_PROPERTIES(${LibName} PROPERTIES - OUTPUT_NAME ${PROJECT_NAME} - VERSION ${vkvg_VERSION_MAJOR}.${vkvg_VERSION_MINOR} - SOVERSION ${vkvg_VERSION_MAJOR} - C_STANDARD 11 - LINKER_LANGUAGE C - PUBLIC_HEADER "${VKVG_PUBLIC_HEADERS}" - ) +LIST(APPEND VKVG_SRC ${SHADERS} ${SHADERS_H}) - TARGET_INCLUDE_DIRECTORIES("${LibName}" - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/src - ${CMAKE_CURRENT_SOURCE_DIR}/vkh/src - $<$:${FREETYPE_INCLUDE_DIRS}> - $<$:${HarfBuzz_INCLUDE_DIRS}> - $<$:${Fontconfig_INCLUDE_DIRS}> - $<$>:${CMAKE_CURRENT_SOURCE_DIR}/src/nsvg> - PUBLIC - ${Vulkan_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/vkh/include - ) +SOURCE_GROUP(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${VKVG_SRC}) - get_target_property(libtype "${LibName}" TYPE) +ADD_LIBRARY("${PROJECT_NAME}" ${VKVG_SRC}) - IF (UNIX)# AND ($libtype STREQUAL "SHARED_LIBRARY")) - TARGET_LINK_LIBRARIES("${LibName}" PUBLIC m) - ENDIF() +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES + OUTPUT_NAME ${PROJECT_NAME} + VERSION ${vkvg_VERSION_MAJOR}.${vkvg_VERSION_MINOR} + SOVERSION ${vkvg_VERSION_MAJOR} + C_STANDARD 11 + LINKER_LANGUAGE C + PUBLIC_HEADER "${VKVG_PUBLIC_HEADERS}" +) - IF(VKVG_USE_FREETYPE) - TARGET_LINK_LIBRARIES("${LibName}" PRIVATE ${FREETYPE_LIBRARIES}) - ENDIF() - IF(VKVG_USE_FONTCONFIG) - TARGET_LINK_LIBRARIES("${LibName}" PRIVATE ${Fontconfig_LIBRARIES}) - ENDIF() - IF(VKVG_USE_HARFBUZZ) - TARGET_LINK_LIBRARIES("${LibName}" PRIVATE ${HarfBuzz_LIBRARIES}) - ENDIF() - IF(VKVG_USE_GLUTESS) - TARGET_LINK_LIBRARIES("${LibName}" PRIVATE glutess) - ENDIF() +TARGET_INCLUDE_DIRECTORIES("${PROJECT_NAME}" + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/src + ${CMAKE_CURRENT_SOURCE_DIR}/vkh/src + $<$:${FREETYPE_INCLUDE_DIRS}> + $<$:${HarfBuzz_INCLUDE_DIRS}> + $<$:${Fontconfig_INCLUDE_DIRS}> + $<$>:${CMAKE_CURRENT_SOURCE_DIR}/src/nsvg> + PUBLIC + ${Vulkan_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/vkh/include +) - TARGET_LINK_LIBRARIES("${LibName}" - PUBLIC - ${Vulkan_LIBRARIES} - vkh - ) - IF (SHADERS_H) - ADD_DEPENDENCIES("${LibName}" BuildShadersHeader) - ENDIF() +IF (UNIX AND BUILD_SHARED_LIBS) + #make libm public for shared build to solve libm missing for common_test object lib linking even + #if -lm present on cc command. + TARGET_LINK_LIBRARIES("${PROJECT_NAME}" PUBLIC m) +ENDIF() -ENDFUNCTION(setup_lib) +IF(VKVG_USE_FREETYPE) + TARGET_LINK_LIBRARIES("${PROJECT_NAME}" PUBLIC ${FREETYPE_LIBRARY}) +ENDIF() +IF(VKVG_USE_FONTCONFIG) + TARGET_LINK_LIBRARIES("${PROJECT_NAME}" PRIVATE ${Fontconfig_LIBRARIES}) +ENDIF() +IF(VKVG_USE_HARFBUZZ) + TARGET_LINK_LIBRARIES("${PROJECT_NAME}" PRIVATE ${HarfBuzz_LIBRARIES}) +ENDIF() +IF(VKVG_USE_GLUTESS) + TARGET_LINK_LIBRARIES("${PROJECT_NAME}" PRIVATE glutess) +ENDIF() -GET_DIRECTORY_PROPERTY (vkvg_has_root_project PARENT_DIRECTORY) +TARGET_LINK_LIBRARIES("${PROJECT_NAME}" + PUBLIC + ${Vulkan_LIBRARIES} + vkh +) +IF (SHADERS_H) + ADD_DEPENDENCIES("${PROJECT_NAME}" BuildShadersHeader) +ENDIF() -# TARGET_INCLUDE_DIRECTORIES("${PROJECT_NAME}_obj" -# PRIVATE -# ${CMAKE_CURRENT_SOURCE_DIR}/src -# ${CMAKE_CURRENT_SOURCE_DIR}/vkh/src -# $<$:${FREETYPE_INCLUDE_DIRS}> -# $<$:${HarfBuzz_INCLUDE_DIRS}> -# $<$:${Fontconfig_INCLUDE_DIRS}> -# $<$>:${CMAKE_CURRENT_SOURCE_DIR}/src/nsvg> -# $<$:${CMAKE_CURRENT_SOURCE_DIR}/external/glutess/include> -# PUBLIC -# ${Vulkan_INCLUDE_DIRS} -# ${CMAKE_CURRENT_SOURCE_DIR}/include -# ${CMAKE_CURRENT_SOURCE_DIR}/vkh/include -# ) - -LIST(APPEND ${VKVG_SRC} ${SHADERS} ${SHADERS_H}) - -IF (vkvg_has_root_project) - IF (VKVG_BUILD_SHARED_LIB) - ADD_LIBRARY("${PROJECT_NAME}" SHARED ${VKVG_SRC}) - SET_PROPERTY(TARGET "${PROJECT_NAME}" PROPERTY POSITION_INDEPENDENT_CODE ON) - SET_PROPERTY(TARGET vkh PROPERTY POSITION_INDEPENDENT_CODE ON) - TARGET_COMPILE_DEFINITIONS("${PROJECT_NAME}" PUBLIC -DVKVG_SHARED_LINKING) - IF (TARGET glutess) - SET_PROPERTY(TARGET glutess PROPERTY POSITION_INDEPENDENT_CODE ON) - ENDIF() - setup_lib ("${PROJECT_NAME}") - ELSE() - ADD_LIBRARY("${PROJECT_NAME}" STATIC ${VKVG_SRC}) - SET_PROPERTY(TARGET "${PROJECT_NAME}" PROPERTY POSITION_INDEPENDENT_CODE OFF) - SET_PROPERTY(TARGET vkh PROPERTY POSITION_INDEPENDENT_CODE OFF) - IF (TARGET glutess) - SET_PROPERTY(TARGET glutess PROPERTY POSITION_INDEPENDENT_CODE OFF) - ENDIF() - setup_lib ("${PROJECT_NAME}") - ENDIF() -ELSE() - SET_PROPERTY(TARGET vkh PROPERTY POSITION_INDEPENDENT_CODE ON) - IF (TARGET glutess) - SET_PROPERTY(TARGET glutess PROPERTY POSITION_INDEPENDENT_CODE ON) - ENDIF() +INSTALL(TARGETS "${PROJECT_NAME}" "${PROJECT_NAME}" + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +IF (VKVG_BUILD_TESTS) + ADD_SUBDIRECTORY(tests) +ELSEIF (VKVG_BUILD_OFFSCREEN_TEST) + ADD_EXECUTABLE(test_offscreen "${CMAKE_CURRENT_SOURCE_DIR}/tests/offscreen.c") + TARGET_INCLUDE_DIRECTORIES(test_offscreen PRIVATE + ${Vulkan_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ) + TARGET_LINK_LIBRARIES(test_offscreen + vkvg + ${Vulkan_LIBRARIES} + ) +ENDIF (VKVG_BUILD_TESTS) + +IF (VKVG_BUILD_DOCS) + set(DOXYGEN_DIR ${CMAKE_CURRENT_SOURCE_DIR}/doc) + set(DOXYGEN_INPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include") + set(DOXYGEN_IMAGE_DIR "${DOXYGEN_DIR}/images") + set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doc) + set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/html/index.html) + + set(DOXYFILE_IN ${DOXYGEN_DIR}/Doxygen.in) + set(DOXYFILE_OUT ${DOXYGEN_OUTPUT_DIR}/Doxyfile) + + #configure_file(${DOXYGEN_DIR}/dox_layout.xml ${DOXYGEN_OUTPUT_DIR}/dox_layout.xml @ONLY) + + configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY) + + add_custom_target(copy-doc-files ALL + COMMAND ${CMAKE_COMMAND} -E copy_directory "${DOXYGEN_DIR}/doxy_theme" ${DOXYGEN_OUTPUT_DIR}) + + add_custom_command(OUTPUT ${DOXYGEN_INDEX_FILE} + DEPENDS "${VKVG_PUBLIC_HEADERS}" copy-doc-files + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT} + MAIN_DEPENDENCY ${DOXYFILE_OUT} ${DOXYFILE_IN} + COMMENT "Generating docs") + add_custom_target(doxygen ALL DEPENDS ${DOXYGEN_INDEX_FILE}) + + find_package(Sphinx) + + IF (Sphinx_FOUND) + + set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/doc) + set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/doc/sphinx) + set(SPHINX_INDEX_FILE ${SPHINX_BUILD}/index.html) + + add_custom_command(OUTPUT ${SPHINX_INDEX_FILE} + COMMAND + ${SPHINX_EXECUTABLE} -b html + -Dbreathe_projects.VKVG=${DOXYGEN_OUTPUT_DIR}/xml + ${SPHINX_SOURCE} ${SPHINX_BUILD} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS + doxygen + # Other docs files you want to track should go here (or in some variable) + ${SPHINX_SOURCE}/index.rst + ${DOXYGEN_INDEX_FILE} + MAIN_DEPENDENCY ${SPHINX_SOURCE}/conf.py + COMMENT "Generating documentation with Sphinx") + + add_custom_target(sphinx ALL DEPENDS ${SPHINX_INDEX_FILE}) + ENDIF () +ENDIF (VKVG_BUILD_DOCS) + +IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") + SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) + + SET(CPACK_PACKAGE_DESCRIPTION "Vulkan vector graphic library") + SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "2d vector drawing library using vulkan") + SET(CPACK_PACKAGE_VENDOR "jp Bruyere") + SET(CPACK_PACKAGE_CONTACT "jp_bruyere@hotmail.com") + + SET(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") + SET(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") + SET(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") + SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") + SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") + + SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md") + INCLUDE(InstallRequiredSystemLibraries) + #SET(CPACK_COMPONENTS_ALL Libraries ApplicationData) + #dependencies for this service menu + IF(UNIX) + SET(CPACK_PACKAGING_INSTALL_PREFIX "/tmp") + SET(CPACK_SET_DESTDIR "on") + SET(CPACK_ADD_LDCONFIG_CALL 1) + SET(CPACK_DEBIAN_PACKAGE_DEPENDS " libharfbuzz-gobject0 , libfontconfig1 , libfreetype6 ") + SET(CPACK_GENERATOR "DEB") + + SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") + SET(CPACK_DEBIAN_PACKAGE_SECTION "libraries") + SET(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR}) + + ELSEIF (MSVC) + SET(CPACK_GENERATOR NSIS) + SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY ${PROJECT_NAME}) + SET(CPACK_NSIS_MODIFY_PATH "ON") - ADD_LIBRARY("${PROJECT_NAME}_shared" SHARED ${VKVG_SRC}) - SET_PROPERTY(TARGET "${PROJECT_NAME}_shared" PROPERTY POSITION_INDEPENDENT_CODE ON) - TARGET_COMPILE_DEFINITIONS("${PROJECT_NAME}_shared" PUBLIC -DVKVG_SHARED_BUILD) - setup_lib ("${PROJECT_NAME}_shared") - - ADD_LIBRARY("${PROJECT_NAME}_static" STATIC ${VKVG_SRC}) - target_compile_definitions("${PROJECT_NAME}_static" PUBLIC -DVKVG_STATIC_BUILD) - SET_PROPERTY(TARGET "${PROJECT_NAME}_static" PROPERTY POSITION_INDEPENDENT_CODE OFF) - setup_lib ("${PROJECT_NAME}_static") - - INSTALL(TARGETS "${PROJECT_NAME}_shared" "${PROJECT_NAME}_static" - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - - IF (VKVG_BUILD_TESTS) - ADD_SUBDIRECTORY(tests) - ELSEIF (VKVG_BUILD_OFFSCREEN_TEST) - ADD_EXECUTABLE(test_offscreen "${CMAKE_CURRENT_SOURCE_DIR}/tests/offscreen.c") - TARGET_INCLUDE_DIRECTORIES(test_offscreen PRIVATE - ${Vulkan_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ) - TARGET_LINK_LIBRARIES(test_offscreen - ${Vulkan_LIBRARIES} - ) - IF (TARGET vkvg_static) - TARGET_LINK_LIBRARIES(${TEST_NAME} PUBLIC vkvg_static) - ELSEIF (TARGET vkvg_shared) - TARGET_LINK_LIBRARIES(${TEST_NAME} PUBLIC vkvg_shared) - ELSEIF (TARGET vkvg) - TARGET_LINK_LIBRARIES(${TEST_NAME} PUBLIC vkvg) - ENDIF() - ENDIF (VKVG_BUILD_TESTS) - - IF (VKVG_BUILD_DOCS) - set(DOXYGEN_DIR ${CMAKE_CURRENT_SOURCE_DIR}/doc) - set(DOXYGEN_INPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include") - set(DOXYGEN_IMAGE_DIR "${DOXYGEN_DIR}/images") - set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doc) - set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/html/index.html) - - set(DOXYFILE_IN ${DOXYGEN_DIR}/Doxygen.in) - set(DOXYFILE_OUT ${DOXYGEN_OUTPUT_DIR}/Doxyfile) - - #configure_file(${DOXYGEN_DIR}/dox_layout.xml ${DOXYGEN_OUTPUT_DIR}/dox_layout.xml @ONLY) - - configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY) - - add_custom_target(copy-doc-files ALL - COMMAND ${CMAKE_COMMAND} -E copy_directory "${DOXYGEN_DIR}/doxy_theme" ${DOXYGEN_OUTPUT_DIR}) - - add_custom_command(OUTPUT ${DOXYGEN_INDEX_FILE} - DEPENDS "${VKVG_PUBLIC_HEADERS}" copy-doc-files - COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT} - MAIN_DEPENDENCY ${DOXYFILE_OUT} ${DOXYFILE_IN} - COMMENT "Generating docs") - add_custom_target(doxygen ALL DEPENDS ${DOXYGEN_INDEX_FILE}) - - find_package(Sphinx) - - IF (Sphinx_FOUND) - - set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/doc) - set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/doc/sphinx) - set(SPHINX_INDEX_FILE ${SPHINX_BUILD}/index.html) - - add_custom_command(OUTPUT ${SPHINX_INDEX_FILE} - COMMAND - ${SPHINX_EXECUTABLE} -b html - -Dbreathe_projects.VKVG=${DOXYGEN_OUTPUT_DIR}/xml - ${SPHINX_SOURCE} ${SPHINX_BUILD} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS - doxygen - # Other docs files you want to track should go here (or in some variable) - ${SPHINX_SOURCE}/index.rst - ${DOXYGEN_INDEX_FILE} - MAIN_DEPENDENCY ${SPHINX_SOURCE}/conf.py - COMMENT "Generating documentation with Sphinx") - - add_custom_target(sphinx ALL DEPENDS ${SPHINX_INDEX_FILE}) - ENDIF () - ENDIF (VKVG_BUILD_DOCS) - - IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") - SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) - - SET(CPACK_PACKAGE_DESCRIPTION "Vulkan vector graphic library") - SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "2d vector drawing library using vulkan") - SET(CPACK_PACKAGE_VENDOR "jp Bruyere") - SET(CPACK_PACKAGE_CONTACT "jp_bruyere@hotmail.com") - - SET(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") - SET(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") - SET(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") - SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") - SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") - - SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md") - INCLUDE(InstallRequiredSystemLibraries) - #SET(CPACK_COMPONENTS_ALL Libraries ApplicationData) - #dependencies for this service menu - IF(UNIX) - SET(CPACK_PACKAGING_INSTALL_PREFIX "/tmp") - SET(CPACK_SET_DESTDIR "on") - SET(CPACK_ADD_LDCONFIG_CALL 1) - SET(CPACK_DEBIAN_PACKAGE_DEPENDS " libharfbuzz-gobject0 , libfontconfig1 , libfreetype6 ") - SET(CPACK_GENERATOR "DEB") - - SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") - SET(CPACK_DEBIAN_PACKAGE_SECTION "libraries") - SET(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR}) - - ELSEIF (MSVC) - SET(CPACK_GENERATOR NSIS) - SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY ${PROJECT_NAME}) - SET(CPACK_NSIS_MODIFY_PATH "ON") - - ENDIF () - - - INCLUDE(CPack) - ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") + ENDIF () + + + INCLUDE(CPack) +ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") -ENDIF() diff --git a/external/glutess b/external/glutess index 8869aa8c..bca91cb2 160000 --- a/external/glutess +++ b/external/glutess @@ -1 +1 @@ -Subproject commit 8869aa8c486dbe7b169674f0173ec25d9fe069c8 +Subproject commit bca91cb2ee1e3a3ad31d6fe01bfb8f3c9aaea7c1 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3911819f..9199a4ad 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -32,13 +32,7 @@ FUNCTION (buildtest TEST_FILE) ${GLFW3_LIBRARY} Threads::Threads ) - IF (TARGET vkvg_static) - TARGET_LINK_LIBRARIES(${TEST_NAME} PRIVATE vkvg_static) - ELSEIF (TARGET vkvg_shared) - TARGET_LINK_LIBRARIES(${TEST_NAME} PRIVATE vkvg_shared) - ELSEIF (TARGET vkvg) - TARGET_LINK_LIBRARIES(${TEST_NAME} PRIVATE vkvg) - ENDIF() + TARGET_LINK_LIBRARIES(${TEST_NAME} PRIVATE vkvg) ENDFUNCTION (buildtest) diff --git a/tests/gradient2.c b/tests/gradient2.c index 46439e63..1867f3b9 100644 --- a/tests/gradient2.c +++ b/tests/gradient2.c @@ -141,10 +141,17 @@ int main(int argc, char* argv[]) { vkengine_set_cursor_pos_callback(e, mouse_move_callback); vkengine_set_scroll_callback(e, scroll_callback); - bool deferredResolve = false; - - device = vkvg_device_create_from_vk_multisample(vkh_app_get_inst(e->app), r->dev->phy, r->dev->dev, r->qFam, 0, samples, deferredResolve); - surf = vkvg_surface_create(device, test_width, test_height); + vkvg_device_create_info_t info = { + samples, + false, + vkh_app_get_inst(e->app), + r->dev->phy, + r->dev->dev, + r->qFam, + 0 + }; + device = vkvg_device_create(&info); + surf = vkvg_surface_create(device, test_width, test_height); vkh_presenter_build_blit_cmd (r, vkvg_surface_get_vk_image(surf), test_width, test_height); diff --git a/vkh b/vkh index 3b64b87a..b93fc9f9 160000 --- a/vkh +++ b/vkh @@ -1 +1 @@ -Subproject commit 3b64b87a871cd7652a4b6abc97d26f766c532e82 +Subproject commit b93fc9f9d0c9c3e793ff5d2fdbeaf86009e0f905