123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- diff --git a/AssetLoader/CMakeLists.txt b/AssetLoader/CMakeLists.txt
- index 2d147c2..540ad49 100644
- --- a/AssetLoader/CMakeLists.txt
- +++ b/AssetLoader/CMakeLists.txt
- @@ -28,6 +28,8 @@ PUBLIC
- interface
- PRIVATE
- include
- + ${diligentcore_INCLUDEDIR}
- + ${tinygltf_INCLUDEDIR}
- )
-
- source_group("source" FILES ${SOURCE})
- @@ -46,38 +48,14 @@ PRIVATE
- Diligent-JSON
- )
-
- -if (TARGET draco OR TARGET draco_static)
- - if(TARGET draco)
- - set(DRACO_TARGET draco)
- - else()
- - set(DRACO_TARGET draco_static)
- - endif()
- - target_link_libraries(Diligent-AssetLoader PRIVATE ${DRACO_TARGET})
- - get_target_property(DRACO_SOURCE_DIR ${DRACO_TARGET} SOURCE_DIR)
- +if (DILIGENT_ENABLE_DRACO)
- + target_link_libraries(Diligent-AssetLoader PRIVATE ${draco_LINK_LIBRARIES})
- target_compile_definitions(Diligent-AssetLoader PRIVATE TINYGLTF_ENABLE_DRACO)
- - target_include_directories(Diligent-AssetLoader PRIVATE "${DRACO_SOURCE_DIR}/src" "${CMAKE_BINARY_DIR}")
- -elseif (DRACO_PATH)
- - find_library(DRACO_LIBRARY NAMES draco draco_static PATHS "${DRACO_PATH}/lib")
- - if(DRACO_LIBRARY)
- - target_link_libraries(Diligent-AssetLoader PRIVATE ${DRACO_LIBRARY})
- - target_include_directories(Diligent-AssetLoader PRIVATE "${DRACO_PATH}/include")
- - target_compile_definitions(Diligent-AssetLoader PRIVATE TINYGLTF_ENABLE_DRACO)
- - else()
- - message(WARNING "Unable to find draco library. Draco support will be disabled")
- - endif()
- + target_include_directories(Diligent-AssetLoader PRIVATE "${draco_INCLUDEDIR}")
- endif()
-
- if(DILIGENT_USE_RAPIDJSON)
- - FetchContent_DeclareShallowGit(
- - rapidjson
- - GIT_REPOSITORY https://github.com/Tencent/rapidjson
- - GIT_TAG ab1842a2dae061284c0a62dca1cc6d5e7e37e346
- - )
- - set(RAPIDJSON_BUILD_DOC OFF)
- - set(RAPIDJSON_BUILD_EXAMPLES OFF)
- - set(RAPIDJSON_BUILD_TESTS OFF)
- - FetchContent_MakeAvailable(rapidjson)
- - target_include_directories(Diligent-AssetLoader PRIVATE ${rapidjson_SOURCE_DIR}/include/rapidjson)
- + target_include_directories(Diligent-AssetLoader PRIVATE ${rapidjson_INCLUDEDIR}/rapidjson)
- target_compile_definitions(Diligent-AssetLoader PRIVATE TINYGLTF_USE_RAPIDJSON TINYGLTF_USE_RAPIDJSON_CRTALLOCATOR)
- endif()
-
- diff --git a/Imgui/CMakeLists.txt b/Imgui/CMakeLists.txt
- index 73b412c..d38827c 100644
- --- a/Imgui/CMakeLists.txt
- +++ b/Imgui/CMakeLists.txt
- @@ -52,8 +52,9 @@ add_library(Diligent-Imgui STATIC
- ${IMGUIZMO_QUAT_SOURCE}
- )
-
- -if(TARGET imgui)
- - target_link_libraries(Diligent-Imgui PRIVATE imgui)
- +if(1)
- + target_link_libraries(Diligent-Imgui PRIVATE ${imgui_LINK_LIBRARIES})
- + target_include_directories(Diligent-Imgui PRIVATE ${imgui_INCLUDEDIR} ${diligentcore_INCLUDEDIR})
- else()
- set(DEAR_IMGUI_INTERFACE
- ${DILIGENT_DEAR_IMGUI_PATH}/imgui.h
- diff --git a/NativeApp/CMakeLists.txt b/NativeApp/CMakeLists.txt
- index 8a183d4..8297947 100644
- --- a/NativeApp/CMakeLists.txt
- +++ b/NativeApp/CMakeLists.txt
- @@ -462,6 +462,8 @@ if(PLATFORM_WIN32)
- target_include_directories(Diligent-NativeAppBase
- PUBLIC
- include/Win32
- + PRIVATE
- + ${diligentcore_INCLUDEDIR}
- )
-
- elseif(PLATFORM_UNIVERSAL_WINDOWS)
- @@ -495,6 +497,8 @@ elseif(PLATFORM_LINUX)
- target_include_directories(Diligent-NativeAppBase
- PUBLIC
- include/Linux
- + PRIVATE
- + ${diligentcore_INCLUDEDIR}
- )
- if(VULKAN_SUPPORTED)
- find_library(XCB_LIBRARY xcb)
- @@ -507,6 +511,8 @@ elseif(PLATFORM_MACOS)
- target_include_directories(Diligent-NativeAppBase PUBLIC
- src/MacOS
- include/MacOS
- + PRIVATE
- + ${diligentcore_INCLUDEDIR}
- )
- elseif(PLATFORM_IOS)
- target_include_directories(Diligent-NativeAppBase PUBLIC
- @@ -528,3 +534,7 @@ source_group("include" FILES ${INCLUDE})
- set_target_properties(Diligent-NativeAppBase PROPERTIES
- FOLDER DiligentTools
- )
- +
- +if(DILIGENT_INSTALL_TOOLS)
- + install_tools_lib(Diligent-NativeAppBase)
- +endif()
- diff --git a/RenderStateNotation/CMakeLists.txt b/RenderStateNotation/CMakeLists.txt
- index 2f76ec8..6129db8 100644
- --- a/RenderStateNotation/CMakeLists.txt
- +++ b/RenderStateNotation/CMakeLists.txt
- @@ -2,6 +2,7 @@ cmake_minimum_required (VERSION 3.6)
-
- project(Diligent-RenderStateNotation CXX)
-
- +set(Diligent-GraphicsEngine_SOURCE_DIR ${diligentcore_INCLUDEDIR}/DiligentCore/Graphics/GraphicsEngine)
- set(REFLECTED
- ${Diligent-GraphicsEngine_SOURCE_DIR}/interface/BlendState.h
- ${Diligent-GraphicsEngine_SOURCE_DIR}/interface/DepthStencilState.h
- @@ -26,8 +27,8 @@ file(COPY ../.clang-format DESTINATION "${RSN_PARSER_GENERATED_HEADERS_DIR}")
-
- find_package(Python3 REQUIRED)
-
- -set(LIBCLANG_INSTALL_CMD ${Python3_EXECUTABLE} -m pip install libclang==16.0.6)
- -set(JINJA2_INSTALL_CMD ${Python3_EXECUTABLE} -m pip install jinja2)
- +set(LIBCLANG_INSTALL_CMD ${Python3_EXECUTABLE} -m pip install --user libclang==16.0.6)
- +set(JINJA2_INSTALL_CMD ${Python3_EXECUTABLE} -m pip install --user jinja2)
-
- if(${Python3_VERSION} VERSION_GREATER_EQUAL "3.12")
- set(LIBCLANG_INSTALL_CMD ${LIBCLANG_INSTALL_CMD} --break-system-packages)
- @@ -65,15 +66,9 @@ source_group("generated" FILES ${GENERATED})
- source_group("source" FILES ${SOURCE})
- source_group("scripts" FILES ${SCRIPTS})
-
- -if (EXISTS "${CLANG_FORMAT_EXECUTABLE}")
- - set(FORMATTING_COMMAND "${CLANG_FORMAT_EXECUTABLE}" -i *.hpp --verbose)
- -else()
- - set(FORMATTING_COMMAND "${CMAKE_COMMAND}" -E echo "clang-format executable is not found: RSN parser headers will not be formatted")
- -endif()
-
- add_custom_command(OUTPUT ${GENERATED}
- COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/scripts/cxx_generator.py" --dir "." --files ${REFLECTED}
- - COMMAND ${FORMATTING_COMMAND}
- WORKING_DIRECTORY "${RSN_PARSER_GENERATED_HEADERS_DIR}"
- DEPENDS ${REFLECTED}
- COMMENT "Generating RSN Parser Headers...")
- @@ -91,7 +86,10 @@ PUBLIC
- interface
- PRIVATE
- include
- - ../../DiligentCore/Graphics/Archiver/interface
- + ${diligentcore_INCLUDEDIR}
- + ${diligentcore_INCLUDEDIR}/DiligentCore/Graphics/GraphicsEngine/interface
- + ${diligentcore_INCLUDEDIR}/DiligentCore/Graphics/Archiver/interface
- + ${nlohmann_json_INCLUDEDIR}
- ${RSN_PARSER_HEADERS_DIR}
- )
-
- diff --git a/RenderStatePackager/CMakeLists.txt b/RenderStatePackager/CMakeLists.txt
- index ab34ffa..87cadb3 100644
- --- a/RenderStatePackager/CMakeLists.txt
- +++ b/RenderStatePackager/CMakeLists.txt
- @@ -22,6 +22,12 @@ add_library(Diligent-RenderStatePackagerLib STATIC
- target_include_directories(Diligent-RenderStatePackagerLib
- PUBLIC
- include
- +PRIVATE
- + ${diligentcore_INCLUDEDIR}
- +)
- +target_link_directories(Diligent-RenderStatePackagerLib
- +PRIVATE
- + ${diligentcore_LIBDIR}
- )
-
- target_link_libraries(Diligent-RenderStatePackagerLib
- @@ -35,29 +41,6 @@ PUBLIC
-
- set_common_target_properties(Diligent-RenderStatePackagerLib)
-
- -add_executable(Diligent-RenderStatePackager
- - src/main.cpp
- - README.md
- -)
- -set_common_target_properties(Diligent-RenderStatePackager)
- -
- -target_link_libraries(Diligent-RenderStatePackager
- -PRIVATE
- - Diligent-BuildSettings
- - Diligent-Common
- - Diligent-RenderStatePackagerLib
- -)
- -target_include_directories(Diligent-RenderStatePackager
- -PRIVATE
- - include
- - ${DILIGENT_ARGS_DIR}
- -)
- -
- -if (DILIGENT_INSTALL_TOOLS)
- - install(TARGETS Diligent-RenderStatePackager RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/${DILIGENT_TOOLS_DIR}/$<CONFIG>" OPTIONAL)
- +if(DILIGENT_INSTALL_TOOLS)
- + install_tools_lib(Diligent-RenderStatePackagerLib)
- endif()
- -
- -
- -set_target_properties(Diligent-RenderStatePackagerLib Diligent-RenderStatePackager PROPERTIES
- - FOLDER DiligentTools
- -)
- diff --git a/TextureLoader/CMakeLists.txt b/TextureLoader/CMakeLists.txt
- index eb1150b..9ffcd31 100644
- --- a/TextureLoader/CMakeLists.txt
- +++ b/TextureLoader/CMakeLists.txt
- @@ -34,17 +34,18 @@ set(SOURCE
- add_library(Diligent-TextureLoader STATIC ${SOURCE} ${INCLUDE} ${INTERFACE})
- set_common_target_properties(Diligent-TextureLoader)
-
- -set_property(SOURCE src/PNGCodec.c src/Image.cpp
- -APPEND PROPERTY INCLUDE_DIRECTORIES
- - "${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/libpng" # png_static target does not define any public include directories
- - "${CMAKE_CURRENT_BINARY_DIR}/../ThirdParty/libpng" # pnglibconf.h is generated in the binary directory
- -)
-
- target_include_directories(Diligent-TextureLoader
- PUBLIC
- interface
- PRIVATE
- include
- + ${diligentcore_INCLUDEDIR}
- + ${stb_INCLUDEDIR}
- + ${libpng_INCLUDEDIR}
- + ${libtiff_INCLUDEDIR}
- + ${libjpeg_INCLUDEDIR}
- + ${zlib_INCLUDEDIR}
- )
-
- source_group("source" FILES ${SOURCE})
- @@ -59,15 +60,15 @@ PRIVATE
- Diligent-GraphicsEngineInterface
- Diligent-GraphicsAccessories
- Diligent-GraphicsTools
- - PNG::PNG
- - TIFF::TIFF
- - ZLIB::ZLIB
- + ${libpng_LINK_LIBRARIES}
- + ${libtiff_LINK_LIBRARIES}
- + ${zlib_LINK_LIBRARIES}
- )
-
- -if (NOT DILIGENT_EXTERNAL_LIBJPEG)
- +if (1)
- target_link_libraries(Diligent-TextureLoader
- PRIVATE
- - JPEG::JPEG
- + ${libjpeg_LINK_LIBRARIES}
- )
- else()
- target_link_libraries(Diligent-TextureLoader
|