Merge pull request 'Prefix cmake options' (#193) from cmake_prefixes into master

Reviewed-on: https://git.madvoxel.net/OpenVulkano/OpenVulkano/pulls/193
Reviewed-by: Georg Hagen <georg.hagen@madvoxel.com>
This commit is contained in:
Oleksii_Hyzha
2025-01-24 17:39:41 +01:00
7 changed files with 20 additions and 20 deletions

View File

@@ -37,14 +37,14 @@ add_subdirectory(moodycamel_concurrentqueue)
add_subdirectory(tinyusdz) add_subdirectory(tinyusdz)
add_subdirectory(dds_image) add_subdirectory(dds_image)
if (NOT IOS AND ENABLE_CURL) if (NOT IOS AND OPENVULKANO_ENABLE_CURL)
add_subdirectory(curl) add_subdirectory(curl)
endif() endif()
if (ENABLE_TEST) if (OPENVULKANO_ENABLE_TEST)
add_subdirectory(catch2) add_subdirectory(catch2)
endif () endif ()
if (ENABLE_KTX) if (OPENVULKANO_ENABLE_KTX)
add_subdirectory(ktx-software) add_subdirectory(ktx-software)
endif () endif ()

View File

@@ -7,7 +7,7 @@ if (NOT IOS)
endif () endif ()
if (assimp_FOUND OR ASSIMP_FOUND) if (assimp_FOUND OR ASSIMP_FOUND)
message("Using system assimp") message("Using system assimp")
elseif (ENABLE_ASSIMP) elseif (OPENVULKANO_ENABLE_ASSIMP)
message("Building assimp from sources") message("Building assimp from sources")
if(NOT DEFINED ASSIMP_REPO) if(NOT DEFINED ASSIMP_REPO)
set(ASSIMP_REPO https://github.com/assimp/assimp.git) set(ASSIMP_REPO https://github.com/assimp/assimp.git)

View File

@@ -1,4 +1,4 @@
if (ENABLE_MSDF) if (OPENVULKANO_ENABLE_MSDF)
include(FetchContent) include(FetchContent)
if(NOT DEFINED MSDFGEN_REPO) if(NOT DEFINED MSDFGEN_REPO)
@@ -96,7 +96,7 @@ if (ENABLE_MSDF)
endif() endif()
function(LinkMsdf TARGET) function(LinkMsdf TARGET)
if (ENABLE_MSDF) if (OPENVULKANO_ENABLE_MSDF)
target_link_libraries(${TARGET} PUBLIC msdfgen::msdfgen msdfgen::msdfgen-ext msdf-atlas-gen) target_link_libraries(${TARGET} PUBLIC msdfgen::msdfgen msdfgen::msdfgen-ext msdf-atlas-gen)
if (FREETYPE_BUILT_FROM_SOURCES) if (FREETYPE_BUILT_FROM_SOURCES)
target_include_directories(${TARGET} PUBLIC ${FREETYPE_INCLUDE_DIR}) target_include_directories(${TARGET} PUBLIC ${FREETYPE_INCLUDE_DIR})

View File

@@ -39,14 +39,14 @@ project (OpenVulkano VERSION 1.0 LANGUAGES C CXX)
SetOptimisationSettings() SetOptimisationSettings()
# ------------------------- CMAKE OPTIONS ------------------------- # ------------------------- CMAKE OPTIONS -------------------------
option(TRACY_ENABLE "Enable Tracy Profiler" OFF) option(OPENVULKANO_TRACY_ENABLE "Enable Tracy Profiler" OFF)
option(ENABLE_ASSIMP "If assimp should be used" ON) option(OPENVULKANO_ENABLE_ASSIMP "If assimp should be used" ON)
option(ENABLE_CURL "If curl should be used" ON) option(OPENVULKANO_ENABLE_CURL "If curl should be used" ON)
option(ENABLE_KTX "If ktx images should be supported" ON) option(OPENVULKANO_ENABLE_KTX "If ktx images should be supported" ON)
option(ENABLE_TEST "Enable testing" ON) option(OPENVULKANO_ENABLE_TEST "Enable testing" ON)
option(ENABLE_EXAMPLE "Enable examples" ON) option(OPENVULKANO_ENABLE_EXAMPLES "Enable examples" ON)
option(ENABLE_MSDF "Enable msdf library" ON) option(OPENVULKANO_ENABLE_MSDF "Enable msdf library" ON)
option(ENABLE_SHADERC "Enable runtime shader compiler" OFF) option(OPENVULKANO_ENABLE_SHADERC "Enable runtime shader compiler" OFF)
# ----------------------------------------------------------------- # -----------------------------------------------------------------
if (IOS) if (IOS)
@@ -63,13 +63,13 @@ add_subdirectory(3rdParty)
add_subdirectory(openVulkanoCpp) add_subdirectory(openVulkanoCpp)
LinkTinyUSDZ(openVulkanoCpp) LinkTinyUSDZ(openVulkanoCpp)
if(ENABLE_TEST AND NOT IOS) if(OPENVULKANO_ENABLE_TEST AND NOT IOS)
enable_testing() enable_testing()
add_subdirectory(tests) add_subdirectory(tests)
endif() endif()
# Finally generate the tests and examples # Finally generate the tests and examples
if(ENABLE_EXAMPLE) if(OPENVULKANO_ENABLE_EXAMPLES)
add_subdirectory(examples) add_subdirectory(examples)
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT OpenVulkano_Examples) set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT OpenVulkano_Examples)
endif() endif()

View File

@@ -5,7 +5,7 @@ function(SetupVulkan TARGET)
else () else ()
find_package(Vulkan REQUIRED) find_package(Vulkan REQUIRED)
target_link_libraries(${TARGET} PRIVATE Vulkan::Vulkan) target_link_libraries(${TARGET} PRIVATE Vulkan::Vulkan)
if (ENABLE_SHADERC) if (OPENVULKANO_ENABLE_SHADERC)
find_package(Vulkan OPTIONAL_COMPONENTS shaderc_combined) find_package(Vulkan OPTIONAL_COMPONENTS shaderc_combined)
if (Vulkan_shaderc_combined_FOUND) if (Vulkan_shaderc_combined_FOUND)
target_link_libraries(${TARGET} PRIVATE Vulkan::shaderc_combined) target_link_libraries(${TARGET} PRIVATE Vulkan::shaderc_combined)

View File

@@ -64,13 +64,13 @@ if (NOT ANDROID AND NOT IOS)
target_link_libraries(openVulkanoCpp PUBLIC fontconfig) target_link_libraries(openVulkanoCpp PUBLIC fontconfig)
endif() endif()
target_link_libraries(openVulkanoCpp PUBLIC glfw pugixml ftxui::screen ftxui::dom ftxui::component) target_link_libraries(openVulkanoCpp PUBLIC glfw pugixml ftxui::screen ftxui::dom ftxui::component)
if (ENABLE_CURL) if (OPENVULKANO_ENABLE_CURL)
LinkCurl(openVulkanoCpp) LinkCurl(openVulkanoCpp)
endif() endif()
endif() endif()
target_link_libraries(openVulkanoCpp PUBLIC magic_enum yaml-cpp fmt spdlog glm pugixml stb eigen utf8cpp imgui_internal TracyClient stud-uuid ryml unordered_dense concurrentqueue units dds_image) target_link_libraries(openVulkanoCpp PUBLIC magic_enum yaml-cpp fmt spdlog glm pugixml stb eigen utf8cpp imgui_internal TracyClient stud-uuid ryml unordered_dense concurrentqueue units dds_image)
if (ENABLE_KTX) if (OPENVULKANO_ENABLE_KTX)
target_link_libraries(openVulkanoCpp PUBLIC ktx) target_link_libraries(openVulkanoCpp PUBLIC ktx)
endif () endif ()
LinkAssimp(openVulkanoCpp) LinkAssimp(openVulkanoCpp)

View File

@@ -7,7 +7,7 @@ include(Filter)
cmake_path(GET CMAKE_CURRENT_SOURCE_DIR PARENT_PATH ROOT_FOLDER) cmake_path(GET CMAKE_CURRENT_SOURCE_DIR PARENT_PATH ROOT_FOLDER)
file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp") file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
FilterPlatformPaths(SOURCES) FilterPlatformPaths(SOURCES)
if (NOT ENABLE_CURL) if (NOT OPENVULKANO_ENABLE_CURL)
list(FILTER SOURCES EXCLUDE REGEX "WebResourceLoader") list(FILTER SOURCES EXCLUDE REGEX "WebResourceLoader")
endif() endif()