From 15b882b77f1828839ebbb00d779019992a17cf9b Mon Sep 17 00:00:00 2001 From: GrosSlava <> Date: Tue, 3 Dec 2024 03:17:34 +0300 Subject: [PATCH 1/2] BuildSystem fix: fix engine build from source - fix targets export includes - fix small bugs in targets dependencies - clean install for simpler use with editor build: -- make flat lib dir -- make flat bin dir -- structure install dir --- .gitignore | 1 + CMakeLists.txt | 143 ++++++--- CMakePresets.json | 1 - cmake/NauCommon.cmake | 24 +- cmake/NauModule.cmake | 4 +- cmake/defaults/UsdPackages.cmake | 28 +- cmake/for_build/CMakeLists.txt | 257 ++++++++------- cmake/for_build/CMakePresets.json | 1 - engine/3rdparty_libs/CMakeLists.txt | 1 + .../3rdparty_libs/JoltPhysics/CMakeLists.txt | 16 +- engine/3rdparty_libs/fmt/CMakeLists.txt | 22 +- .../3rdparty_libs/gainput/lib/CMakeLists.txt | 13 - engine/3rdparty_libs/lua/CMakeLists.txt | 4 +- .../3rdparty_libs/lua/{src => include}/lapi.h | 0 .../lua/{src => include}/lauxlib.h | 0 .../lua/{src => include}/lcode.h | 0 .../lua/{src => include}/lctype.h | 0 .../lua/{src => include}/ldebug.h | 0 .../3rdparty_libs/lua/{src => include}/ldo.h | 0 .../lua/{src => include}/lfunc.h | 0 .../3rdparty_libs/lua/{src => include}/lgc.h | 0 .../lua/{src => include}/ljumptab.h | 0 .../3rdparty_libs/lua/{src => include}/llex.h | 0 .../lua/{src => include}/llimits.h | 0 .../3rdparty_libs/lua/{src => include}/lmem.h | 0 .../lua/{src => include}/lobject.h | 0 .../lua/{src => include}/lopcodes.h | 0 .../lua/{src => include}/lopnames.h | 0 .../lua/{src => include}/lparser.h | 0 .../lua/{src => include}/lprefix.h | 0 .../lua/{src => include}/lstate.h | 0 .../lua/{src => include}/lstring.h | 0 .../lua/{src => include}/ltable.h | 0 .../3rdparty_libs/lua/{src => include}/ltm.h | 0 .../3rdparty_libs/lua/{src => include}/lua.h | 0 .../lua/{src => include}/lua.hpp | 0 .../lua/{src => include}/luaconf.h | 0 .../lua/{src => include}/lualib.h | 0 .../lua/{src => include}/lundump.h | 0 .../3rdparty_libs/lua/{src => include}/lvm.h | 0 .../3rdparty_libs/lua/{src => include}/lzio.h | 0 .../ozz/extern/jsoncpp/CMakeLists.txt | 13 +- .../ozz/src/animation/offline/CMakeLists.txt | 2 +- .../src/animation/offline/gltf/CMakeLists.txt | 2 +- .../animation/offline/tools/CMakeLists.txt | 2 +- .../ozz/src/animation/runtime/CMakeLists.txt | 2 - .../3rdparty_libs/ozz/src/base/CMakeLists.txt | 2 - .../ozz/src/geometry/runtime/CMakeLists.txt | 2 +- .../ozz/src/options/CMakeLists.txt | 2 +- engine/3rdparty_libs/stb/CMakeLists.txt | 8 + engine/3rdparty_libs/tinydds/CMakeLists.txt | 9 +- engine/3rdparty_libs/tinygltf/CMakeLists.txt | 14 +- engine/core/modules/physics/CMakeLists.txt | 2 +- engine/core/modules/scene/src/CMakeLists.txt | 13 +- .../lua_toolkit/src/CMakeLists.txt | 3 +- .../external/freetype2/CMakeLists.txt | 4 +- .../ui/cocos2d-x/external/jpeg/CMakeLists.txt | 4 +- .../vfx/src/components/vfx_component.cpp | 2 +- project_templates/empty/CMakeLists.txt | 300 +++++++++++------- project_templates/empty/CMakePresets.json | 1 - samples/sceneBase/CMakeLists.txt | 1 + tools/3rd_party/CMakeLists.txt | 11 +- tools/asset_pack_tool/CMakeLists.txt | 7 +- tools/asset_tools/tool/CMakeLists.txt | 11 +- tools/build_tools/cmd/CMakeLists.txt | 4 +- tools/build_tools/tool/CMakeLists.txt | 7 +- tools/material_creation_tool/CMakeLists.txt | 2 + tools/project_tools/cmd/CMakeLists.txt | 4 +- tools/project_tools/tool/CMakeLists.txt | 15 +- tools/shared/CMakeLists.txt | 23 +- .../plugins/anim_schema/CMakeLists.txt | 17 +- .../plugins/asset_metadata/CMakeLists.txt | 30 +- .../plugins/audio_schema/CMakeLists.txt | 16 +- .../plugins/component_schema/CMakeLists.txt | 14 +- .../plugins/gui_schema/CMakeLists.txt | 15 +- .../plugins/input_schema/CMakeLists.txt | 17 +- .../plugins/nau_usd_format/CMakeLists.txt | 24 +- .../plugins/physics_schema/CMakeLists.txt | 17 +- .../usd_translator_wrapper/CMakeLists.txt | 16 +- .../plugins/usd_uid_lookup/CMakeLists.txt | 16 +- .../plugins/vfx_schema/CMakeLists.txt | 17 +- tools/usd_tools/usd_helpers/CMakeLists.txt | 7 +- tools/usd_tools/usd_meta_tools/CMakeLists.txt | 11 +- tools/usd_tools/usd_proxy/CMakeLists.txt | 15 +- tools/usd_tools/usd_translator/CMakeLists.txt | 14 +- 85 files changed, 789 insertions(+), 444 deletions(-) rename engine/3rdparty_libs/lua/{src => include}/lapi.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lauxlib.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lcode.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lctype.h (100%) rename engine/3rdparty_libs/lua/{src => include}/ldebug.h (100%) rename engine/3rdparty_libs/lua/{src => include}/ldo.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lfunc.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lgc.h (100%) rename engine/3rdparty_libs/lua/{src => include}/ljumptab.h (100%) rename engine/3rdparty_libs/lua/{src => include}/llex.h (100%) rename engine/3rdparty_libs/lua/{src => include}/llimits.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lmem.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lobject.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lopcodes.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lopnames.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lparser.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lprefix.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lstate.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lstring.h (100%) rename engine/3rdparty_libs/lua/{src => include}/ltable.h (100%) rename engine/3rdparty_libs/lua/{src => include}/ltm.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lua.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lua.hpp (100%) rename engine/3rdparty_libs/lua/{src => include}/luaconf.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lualib.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lundump.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lvm.h (100%) rename engine/3rdparty_libs/lua/{src => include}/lzio.h (100%) diff --git a/.gitignore b/.gitignore index 8e831c79..e6d1f1dd 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .idea build output +dist ninjabuild **/node_modules/** diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a174238..9d914997 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,31 +3,76 @@ # cmake_minimum_required (VERSION 3.20) -add_compile_options($<$:/MP>) - project(NauEngine) + # TODO: set enviroment variables for other platforms if (WIN32) - execute_process( COMMAND "${CMAKE_SOURCE_DIR}/cmake/platformSpec/set_env.bat") -endif(WIN32) + execute_process(COMMAND "${CMAKE_SOURCE_DIR}/cmake/platformSpec/set_env.bat") +endif() -if(POLICY CMP0091) +if (POLICY CMP0091) cmake_policy(SET CMP0091 NEW) endif() -if(NOT DEFINED ${NauEngineFolder}) - set(NauEngineFolder "NauEngine") -endif(NOT DEFINED ${NauEngineFolder}) - -set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/output CACHE PATH "" FORCE) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} # ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/cmake/defaults ) + +# Compiler config +set(CMAKE_CXX_STANDARD 20) +# TODO: define C standard + +add_compile_options($<$:/MP>) + +# Enable Hot Reload for MSVC compilers if supported. +if (POLICY CMP0141) + cmake_policy(SET CMP0141 NEW) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") +endif() + + +# Required packages +find_package(Python REQUIRED) + + +# Global config +if (NOT DEFINED NauEngineFolder) + set(NauEngineFolder "NauEngine") +endif() + +if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/output CACHE PATH "" FORCE) + message(STATUS "Use default install folder: ${CMAKE_INSTALL_PREFIX}") +else() + message(STATUS "Defined install folder: ${CMAKE_INSTALL_PREFIX}") +endif() + +if (DEFINED CMAKE_BUILD_TYPE) + message(STATUS "Build configuration: ${CMAKE_BUILD_TYPE}") +else() + if (DEFINED CMAKE_CONFIGURATION_TYPES) + message(STATUS "Use multi-configuration. Allowed configurations at build time: ${CMAKE_CONFIGURATION_TYPES}") + else() + set(CMAKE_BUILD_TYPE "Debug") + message(STATUS "Use default build configuration: ${CMAKE_BUILD_TYPE}") + endif() +endif() + +if (NOT DEFINED CMAKE_TOOLCHAIN_FILE) + message(FATAL_ERROR "Toolchain not selected! Please define -DCMAKE_TOOLCHAIN_FILE") +else() + message(STATUS "Toolchain file: ${CMAKE_TOOLCHAIN_FILE}") +endif() + +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/$) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/$) + + +# Nau options option(NAU_ENGINE_KERNEL "Build kernel" ON) option(NAU_ENGINE_MODULES "Build modules" ON) option(NAU_ENGINE_FRAMEWORK "Build framework" ON) @@ -41,55 +86,45 @@ option(NAU_FORCE_ENABLE_SHADER_COMPILER_TOOL "Enable build for ShaderCompilerToo option(NAU_PACKAGE_BUILD "Enabled for packaged build" OFF) option(NAU_MATH_USE_DOUBLE_PRECISION "Enable double precision for math" OFF) +# Global options option(BUILD_SHARED_LIBS "Build shared libs" ON) + +# Process options if (BUILD_SHARED_LIBS) - message (STATUS "Configure for dynamic (DLL) runtime") + message(STATUS "Configure for dynamic (DLL) runtime") else() - message (STATUS "Configure for static (monolith) runtime") + message(STATUS "Configure for static (monolith) runtime") endif() if (NAU_PACKAGE_BUILD) add_definitions(-DNAU_PACKAGE_BUILD) endif() -set(CMAKE_CXX_STANDARD 20) - -find_package(Python - REQUIRED -) - include(NauCommon) include(NauModule) include(NauGenFunctions) include(platformSpec/NauPlatformSetup) -if(BUILD_SHARED_LIBS) - message (STATUS "Adding UsdPackages") +if (BUILD_SHARED_LIBS) + message(STATUS "Adding UsdPackages") include(UsdPackages) else() - message (STATUS "Skipping UsdPackages") + message(STATUS "Skipping UsdPackages") endif() include(CTest) -nau_check_python() - -enable_testing() - - -# Enable Hot Reload for MSVC compilers if supported. -if (POLICY CMP0141) - cmake_policy(SET CMP0141 NEW) - set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") -endif() - -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - include(cmake/NauGitVersion.cmake) + +nau_check_python() git_check_version() file (STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/.nauversion NAU_VERSION_STRING) nau_set_version("${NAU_VERSION_STRING}") +message(STATUS "NAU core version: ${NAU_VERSION_MAJOR}.${NAU_VERSION_MINOR}.${NAU_VERSION_PATCH}") + +enable_testing() + +configure_file("run_tests.bat.in" "${CMAKE_SOURCE_DIR}/run_tests.bat") add_subdirectory(engine) add_subdirectory(tools) @@ -97,21 +132,33 @@ add_subdirectory(samples) nau_generate_es_targets() -configure_file("run_tests.bat.in" "${CMAKE_SOURCE_DIR}/run_tests.bat") -install(DIRECTORY cmake - DESTINATION ${CMAKE_INSTALL_PREFIX} - FILES_MATCHING - PATTERN "*.cmake" - PATTERN "*.bat" +# Install +foreach(_folder cmake/defaults cmake/platformSpec) + install(DIRECTORY ${_folder} + DESTINATION ${CMAKE_INSTALL_PREFIX}/cmake + FILES_MATCHING + PATTERN "*.cmake" + PATTERN "*.bat" + ) +endforeach() +install(FILES + cmake/NauCommon.cmake + cmake/NauGenFunctions.cmake + cmake/NauGitVersion.cmake + cmake/NauModule.cmake + DESTINATION ${CMAKE_INSTALL_PREFIX}/cmake ) install(DIRECTORY cmake/for_build/ - DESTINATION ${CMAKE_INSTALL_PREFIX} + DESTINATION ${CMAKE_INSTALL_PREFIX} +) +install(DIRECTORY project_templates + DESTINATION ${CMAKE_INSTALL_PREFIX} ) -install(CODE " - message(STATUS \"Installing USD plugins from ${CMAKE_BINARY_DIR}/bin/$/plugins to ${CMAKE_INSTALL_PREFIX}/bin/$/plugins\") - execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/bin/$/plugins ${CMAKE_INSTALL_PREFIX}/bin/$/plugins) -") - +install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/$/plugins) +install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/$/plugins/ + DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/$/plugins + OPTIONAL +) diff --git a/CMakePresets.json b/CMakePresets.json index f4b7a5e4..f724908b 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -10,7 +10,6 @@ "CMAKE_EXPORT_COMPILE_COMMANDS": true, "CMAKE_SYSTEM_VERSION": "10.0", "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", - "NAU_BUILD_SDK": true, "BUILD_SHARED_LIBS": false, "EASTL_BUILD_BENCHMARK": false, "EASTL_BUILD_TESTS": false, diff --git a/cmake/NauCommon.cmake b/cmake/NauCommon.cmake index 03bebd96..dc9e058b 100644 --- a/cmake/NauCommon.cmake +++ b/cmake/NauCommon.cmake @@ -223,14 +223,30 @@ function(nau_install target subPath) install(TARGETS ${target} EXPORT ${target} RUNTIME DESTINATION "bin/$" - ARCHIVE DESTINATION "lib/$/${subPath}/${target}" - LIBRARY DESTINATION "lib/$/${subPath}/${target}" + ARCHIVE DESTINATION "lib/$" + LIBRARY DESTINATION "lib/$" PUBLIC_HEADER DESTINATION "include/${subPath}/${target}" ) - + get_target_property(Target_BINARY_DIR ${target} BINARY_DIR) + get_target_property(Target_SOURCE_DIR ${target} SOURCE_DIR) foreach(include ${ARGN}) get_filename_component(dir ${include} DIRECTORY) - INSTALL(FILES ${include} DESTINATION "include/${subPath}/${target}/${dir}") + cmake_path(IS_ABSOLUTE dir isDirAbs) + if(${isDirAbs}) + cmake_path(IS_PREFIX Target_BINARY_DIR ${dir} isBinDir) + cmake_path(IS_PREFIX Target_SOURCE_DIR ${dir} isSourceDir) + if(${isBinDir}) + cmake_path(RELATIVE_PATH dir BASE_DIRECTORY ${Target_BINARY_DIR}) + INSTALL(FILES ${include} DESTINATION "include/${subPath}/${target}/${dir}") + elseif(${isSourceDir}) + cmake_path(RELATIVE_PATH dir BASE_DIRECTORY ${Target_SOURCE_DIR}) + INSTALL(FILES ${include} DESTINATION "include/${subPath}/${target}/${dir}") + else() + message(FATAL_ERROR "Unsupported install directory!") + endif() + else() + INSTALL(FILES ${include} DESTINATION "include/${subPath}/${target}/${dir}") + endif() endforeach(include) install(EXPORT ${target} diff --git a/cmake/NauModule.cmake b/cmake/NauModule.cmake index 39380635..5f2ec6fa 100644 --- a/cmake/NauModule.cmake +++ b/cmake/NauModule.cmake @@ -113,14 +113,14 @@ macro(nau_generate_module_config_file targetName) ) target_include_directories(${targetName} PUBLIC - $/include/${targetName}/generated> + $/include/generated/${targetName}> ) target_compile_definitions(${targetName} PUBLIC "NAU_${moduleUpper}_EXPORT=" ) - install(FILES ${GEN_PATH} DESTINATION "include/${targetName}/generated") + install(FILES ${GEN_PATH} DESTINATION "include/generated/${targetName}") message(NOTICE "nau_generate_module_config_file finished") endmacro() diff --git a/cmake/defaults/UsdPackages.cmake b/cmake/defaults/UsdPackages.cmake index 003846c8..c0e73abb 100644 --- a/cmake/defaults/UsdPackages.cmake +++ b/cmake/defaults/UsdPackages.cmake @@ -1,14 +1,21 @@ # file to find packages include(FetchContent) -FetchContent_Declare( - Usd - URL https://cdn.nauengine.org/s3/naungn-portal-prod/documents/usd24.08_no_Hydra.zip - SOURCE_DIR exdeps/usd -) -FetchContent_MakeAvailable(Usd) -FetchContent_GetProperties(Usd SOURCE_DIR UsdDir) -cmake_path(SET pxr_DIR NORMALIZE "${UsdDir}") +if(DEFINED pxr_DIR) + message(STATUS "Defined pxr directory: ${pxr_DIR}") + cmake_path(SET pxr_DIR NORMALIZE "${pxr_DIR}") +else() + message(STATUS "Fetching pxr OpenUSD...") + FetchContent_Declare( + Usd + URL https://cdn.nauengine.org/s3/naungn-portal-prod/documents/usd24.08_no_Hydra.zip + SOURCE_DIR exdeps/usd + ) + FetchContent_MakeAvailable(Usd) + FetchContent_GetProperties(Usd SOURCE_DIR UsdDir) + + cmake_path(SET pxr_DIR NORMALIZE "${UsdDir}") +endif() set(Python3_EXECUTABLE "${pxr_DIR}/python/python.exe") set(Python3_LIBRARY "${pxr_DIR}/python/libs/python310.lib") @@ -55,7 +62,10 @@ function(nau_process_usd_schema target shemaFile output_files) WORKING_DIRECTORY "${OUTPUT_DIR}" ) endif() - target_include_directories(${target} PUBLIC ${OUTPUT_BASE}) + target_include_directories(${target} PUBLIC + $ + $/include/generated_src/schema_plugins> + ) nau_collect_files(${output_files} DIRECTORIES ${OUTPUT_DIR} MASK "*.cpp" "*.h" "*.usda" "*.json" diff --git a/cmake/for_build/CMakeLists.txt b/cmake/for_build/CMakeLists.txt index 478a08a0..987b8715 100644 --- a/cmake/for_build/CMakeLists.txt +++ b/cmake/for_build/CMakeLists.txt @@ -11,146 +11,187 @@ if (WIN32) execute_process( COMMAND "${CMAKE_SOURCE_DIR}/cmake/platformSpec/set_env.bat") endif(WIN32) -if(POLICY CMP0091) +if (POLICY CMP0091) cmake_policy(SET CMP0091 NEW) endif() -if(NOT DEFINED ${NauEngineFolder}) - set(NauEngineFolder "NauEngineSDK") -endif(NOT DEFINED ${NauEngineFolder}) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/cmake/defaults ) -option(NAU_RTTI "Enable rtti support" OFF) -option(NAU_EXCEPTIONS "Enable exception support" OFF) -option(NAU_VERBOSE_LOG "Enable verbose messages for logger" OFF) -option(NAU_MATH_USE_DOUBLE_PRECISION "Enable double precision for math" OFF) -option(BUILD_SHARED_LIBS "Build shared libs" OFF) +# Compiler config +set(CMAKE_CXX_STANDARD 20) +# TODO: define C standard -if (BUILD_SHARED_LIBS) - message (STATUS "Configure for dynamic (DLL) runtime") -else() - message (STATUS "Configure for static (monolith) runtime") +# Enable Hot Reload for MSVC compilers if supported. +if (POLICY CMP0141) + cmake_policy(SET CMP0141 NEW) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") endif() -set(NauSDKIncludes ${CMAKE_CURRENT_SOURCE_DIR}/include) -set(NauSDKLibraries ${CMAKE_CURRENT_SOURCE_DIR}/lib) - -set(CMAKE_CXX_STANDARD 20) -find_package(Python - REQUIRED -) +# Global config +if (NOT DEFINED NauEngineFolder) + set(NauEngineFolder "NauEngineSDK") +endif() -include(NauCommon) -include(NauModule) -include(platformSpec/NauPlatformSetup) +set(NauSDKIncludes ${CMAKE_CURRENT_SOURCE_DIR}/include) +set(NauSDKLibraries ${CMAKE_CURRENT_SOURCE_DIR}/lib) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin) -file(GLOB DLLS "bin/*.dll") -if(EXISTS bin/Debug) +file(GLOB DLLS "${CMAKE_CURRENT_SOURCE_DIR}/bin/*.dll") +if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/bin/Debug) file(COPY ${DLLS} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin/Debug) endif() -if(EXISTS bin/Release) +if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/bin/Release) file(COPY ${DLLS} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin/Release) endif() -# Enable Hot Reload for MSVC compilers if supported. -if (POLICY CMP0141) - cmake_policy(SET CMP0141 NEW) - set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") -endif() -find_package(Threads REQUIRED) +function(try_inc_lib target cmakeName) + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${cmakeName}) + message(STATUS "include ${cmakeName} from NAU sdk") + include(${CMAKE_CURRENT_SOURCE_DIR}/${cmakeName}) + if (BUILD_SHARED_LIBS) + set_target_properties(${target} PROPERTIES + IMPORTED_LOCATION_Debug "${CMAKE_CURRENT_SOURCE_DIR}/bin/Debug/${target}.dll" + IMPORTED_LOCATION_Release "${CMAKE_CURRENT_SOURCE_DIR}/bin/Release/${target}.dll" + IMPORTED_IMPLIB_Debug "${CMAKE_CURRENT_SOURCE_DIR}/lib/Debug/${target}.lib" + IMPORTED_IMPLIB_Release "${CMAKE_CURRENT_SOURCE_DIR}/lib/Release/${target}.lib" + IMPORTED_GLOBAL TRUE + ) + else() + set_target_properties(${target} PROPERTIES + IMPORTED_LOCATION_Debug "${CMAKE_CURRENT_SOURCE_DIR}/bin/Debug/${target}.lib" + IMPORTED_LOCATION_Release "${CMAKE_CURRENT_SOURCE_DIR}/bin/Release/${target}.lib" + IMPORTED_GLOBAL TRUE + ) + endif() + endif() +endfunction() -function(try_inc cmakeName) - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${cmakeName}) +function(try_inc_exe target cmakeName) + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${cmakeName}) + message(STATUS "include ${cmakeName} from NAU sdk") include(${CMAKE_CURRENT_SOURCE_DIR}/${cmakeName}) + set_target_properties(${target} PROPERTIES + IMPORTED_LOCATION_Debug "${CMAKE_CURRENT_SOURCE_DIR}/bin/Debug/${target}.exe" + IMPORTED_LOCATION_Release "${CMAKE_CURRENT_SOURCE_DIR}/bin/Release/${target}.exe" + IMPORTED_GLOBAL TRUE + ) endif() endfunction() function(try_add subdir) - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}) + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}) + message(STATUS "add ${subdir} from NAU sdk") add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${subdir}) endif() endfunction() -try_inc(cmake/3rdPartyLibs/asio/asio-config.cmake) -try_inc(cmake/3rdPartyLibs/brotli/brotli-config.cmake) -try_inc(cmake/3rdPartyLibs/EABase/EABase-config.cmake) -try_inc(cmake/3rdPartyLibs/EASTL/EASTL-config.cmake) -try_inc(cmake/3rdPartyLibs/fast_float/fast_float-config.cmake) -try_inc(cmake/3rdPartyLibs/jsoncpp/jsoncpp-config.cmake) -try_inc(cmake/3rdPartyLibs/lzma-9.20/lzma-9.20-config.cmake) -try_inc(cmake/3rdPartyLibs/md5/md5-config.cmake) -try_inc(cmake/3rdPartyLibs/vectormath/vectormath-config.cmake) -try_inc(cmake/3rdPartyLibs/wyhash/wyhash-config.cmake) -try_inc(cmake/3rdPartyLibs/zlib-ng/zlib-ng-config.cmake) -try_inc(cmake/3rdPartyLibs/zstd-1.4.5/zstd-1.4.5-config.cmake) -try_inc(cmake/3rdPartyLibs/fmt/fmt-config.cmake) -try_inc(cmake/3rdPartyLibs/tinyutf8/tinyutf8-config.cmake) -try_inc(cmake/3rdPartyLibs/utf8cpp/utf8cpp-config.cmake) -try_inc(cmake/3rdPartyLibs/tinyimageformat/tinyimageformat-config.cmake) -try_inc(cmake/3rdPartyLibs/gainputstatic/gainputstatic-config.cmake) -try_inc(cmake/3rdPartyLibs/imgui/imgui-config.cmake) -try_inc(cmake/3rdPartyLibs/RenderDoc/RenderDoc-config.cmake) -try_inc(cmake/3rdPartyLibs/adlSdk/adlSdk-config.cmake) -try_inc(cmake/3rdPartyLibs/dxc/dxc-config.cmake) -try_inc(cmake/3rdPartyLibs/ska_hash_map/ska_hash_map-config.cmake) -try_inc(cmake/3rdPartyLibs/xxHash/xxHash-config.cmake) -try_inc(cmake/3rdPartyLibs/ozz_base/ozz_base-config.cmake) -try_inc(cmake/3rdPartyLibs/ozz_animation/ozz_animation-config.cmake) -try_inc(cmake/3rdPartyLibs/stb/stb-config.cmake) -try_inc(cmake/3rdPartyLibs/ispc_texcomp/ispc_texcomp-config.cmake) -try_inc(cmake/3rdPartyLibs/tinydds/tinydds-config.cmake) -try_inc(cmake/3rdPartyLibs/Jolt/Jolt-config.cmake) -try_inc(cmake/3rdPartyLibs/uriparser/uriparser-config.cmake) - -#try_inc(share/Tracy/TracyConfig.cmake) - -try_inc(cmake/core/NauKernel/NauKernel-config.cmake) - -try_inc(cmake/3rdPartyLibs/binPack2D/binPack2D-config.cmake) - -try_inc(cmake/core/NauKernel/NauKernel-config.cmake) - -try_inc(cmake/core/CoreAssets/CoreAssets-config.cmake) -try_inc(cmake/core/CoreScene/CoreScene-config.cmake) -try_inc(cmake/core/PlatformAppApi/PlatformAppApi-config.cmake) -try_inc(cmake/core/PlatformApp/PlatformApp-config.cmake) -try_inc(cmake/core/CoreInput/CoreInput-config.cmake) -try_inc(cmake/core/Render/Render-config.cmake) -try_inc(cmake/core/Render/Render-config.cmake) -try_inc(cmake/core/GraphicsAssets/GraphicsAssets-config.cmake) -try_inc(cmake/core/CoreInput/CoreInput-config.cmake) -try_inc(cmake/core/Animation/Animation-config.cmake) -try_inc(cmake/core/ext_tinyxml2/ext_tinyxml2-config.cmake) -try_inc(cmake/core/ext_clipper/ext_clipper-config.cmake) -try_inc(cmake/core/ext_edtaa3func/ext_edtaa3func-config.cmake) -try_inc(cmake/core/ext_convertUTF/ext_convertUTF-config.cmake) -try_inc(cmake/core/ext_poly2tri/ext_poly2tri-config.cmake) -try_inc(cmake/core/png/png-config.cmake) -try_inc(cmake/core/external/external-config.cmake) -try_inc(cmake/core/cocos2d/cocos2d-config.cmake) -try_inc(cmake/core/ui/ui-config.cmake) -try_inc(cmake/core/DebugRenderer/DebugRenderer-config.cmake) -try_inc(cmake/core/VFX/VFX-config.cmake) -try_inc(cmake/core/Graphics/Graphics-config.cmake) -try_inc(cmake/core/CoreAssetFormats/CoreAssetFormats-config.cmake) -try_inc(cmake/core/NauFramework/NauFramework-config.cmake) -try_inc(cmake/core/Physics/Physics-config.cmake) -try_inc(cmake/core/PhysicsJolt/PhysicsJolt-config.cmake) -try_inc(cmake/core/Network/Network-config.cmake) -try_inc(cmake/core/Audio/Audio-config.cmake) - -try_inc(cmake/tools/ShaderCompilerTool/ShaderCompilerTool-config.cmake) - +try_inc_lib(adlSdk cmake/3rdPartyLibs/adlSdk/adlSdk-config.cmake) +try_inc_lib(asio cmake/3rdPartyLibs/asio/asio-config.cmake) +try_inc_lib(brotli cmake/3rdPartyLibs/brotli/brotli-config.cmake) +try_inc_lib(dxc cmake/3rdPartyLibs/dxc/dxc-config.cmake) +try_inc_lib(EABase cmake/3rdPartyLibs/EABase/EABase-config.cmake) +try_inc_lib(EASTL cmake/3rdPartyLibs/EASTL/EASTL-config.cmake) +try_inc_lib(fast_float cmake/3rdPartyLibs/fast_float/fast_float-config.cmake) +try_inc_lib(fmt cmake/3rdPartyLibs/fmt/fmt-config.cmake) +try_inc_lib(gainput cmake/3rdPartyLibs/gainput/gainput-config.cmake) +try_inc_lib(imgui cmake/3rdPartyLibs/imgui/imgui-config.cmake) +try_inc_lib(ispc_texcomp cmake/3rdPartyLibs/ispc_texcomp/ispc_texcomp-config.cmake) +try_inc_lib(Jolt cmake/3rdPartyLibs/Jolt/Jolt-config.cmake) +try_inc_lib(json cmake/3rdPartyLibs/json/json-config.cmake) +try_inc_lib(jsoncpp cmake/3rdPartyLibs/jsoncpp/jsoncpp-config.cmake) +try_inc_lib(lua cmake/3rdPartyLibs/lua/lua-config.cmake) +try_inc_lib(lzma-9.20 cmake/3rdPartyLibs/lzma-9.20/lzma-9.20-config.cmake) +try_inc_lib(md5 cmake/3rdPartyLibs/md5/md5-config.cmake) +try_inc_lib(ozz_base cmake/3rdPartyLibs/ozz_base/ozz_base-config.cmake) +try_inc_lib(ozz_options cmake/3rdPartyLibs/ozz_options/ozz_options-config.cmake) +try_inc_lib(ozz_animation cmake/3rdPartyLibs/ozz_animation/ozz_animation-config.cmake) +try_inc_lib(ozz_animation_offline cmake/3rdPartyLibs/ozz_animation_offline/ozz_animation_offline-config.cmake) +try_inc_lib(ozz_animation_tools cmake/3rdPartyLibs/ozz_animation_tools/ozz_animation_tools-config.cmake) +try_inc_lib(ozz_geometry cmake/3rdPartyLibs/ozz_geometry/ozz_geometry-config.cmake) +try_inc_lib(RenderDoc cmake/3rdPartyLibs/RenderDoc/RenderDoc-config.cmake) +try_inc_lib(ska_hash_map cmake/3rdPartyLibs/ska_hash_map/ska_hash_map-config.cmake) +try_inc_lib(stb cmake/3rdPartyLibs/stb/stb-config.cmake) +try_inc_lib(tinydds cmake/3rdPartyLibs/tinydds/tinydds-config.cmake) +try_inc_lib(tinygltf cmake/3rdPartyLibs/tinygltf/tinygltf-config.cmake) +try_inc_lib(tinyimageformat cmake/3rdPartyLibs/tinyimageformat/tinyimageformat-config.cmake) +try_inc_lib(tinyutf8 cmake/3rdPartyLibs/tinyutf8/tinyutf8-config.cmake) +try_inc_lib(uriparser cmake/3rdPartyLibs/uriparser/uriparser-config.cmake) +try_inc_lib(utf8cpp cmake/3rdPartyLibs/utf8cpp/utf8cpp-config.cmake) +try_inc_lib(vectormath cmake/3rdPartyLibs/vectormath/vectormath-config.cmake) +try_inc_lib(wyhash cmake/3rdPartyLibs/wyhash/wyhash-config.cmake) +try_inc_lib(xxHash cmake/3rdPartyLibs/xxHash/xxHash-config.cmake) +try_inc_lib(zlib-ng cmake/3rdPartyLibs/zlib-ng/zlib-ng-config.cmake) +try_inc_lib(zstd-1.4.5 cmake/3rdPartyLibs/zstd-1.4.5/zstd-1.4.5-config.cmake) + +try_inc_lib(NauKernel cmake/core/NauKernel/NauKernel-config.cmake) +try_inc_lib(binPack2D cmake/3rdPartyLibs/binPack2D/binPack2D-config.cmake) + +#try_inc_lib(Tracy share/Tracy/TracyConfig.cmake) + +try_inc_lib(ext_clipper cmake/core/ext_clipper/ext_clipper-config.cmake) +try_inc_lib(ext_convertUTF cmake/core/ext_convertUTF/ext_convertUTF-config.cmake) +try_inc_lib(ext_edtaa3func cmake/core/ext_edtaa3func/ext_edtaa3func-config.cmake) +try_inc_lib(ext_poly2tri cmake/core/ext_poly2tri/ext_poly2tri-config.cmake) +try_inc_lib(ext_tinyxml2 cmake/core/ext_tinyxml2/ext_tinyxml2-config.cmake) +try_inc_lib(png cmake/core/png/png-config.cmake) +try_inc_lib(external cmake/core/external/external-config.cmake) +try_inc_lib(CoreAssetFormats cmake/core/CoreAssetFormats/CoreAssetFormats-config.cmake) +try_inc_lib(CoreAssets cmake/core/CoreAssets/CoreAssets-config.cmake) +try_inc_lib(CoreInput cmake/core/CoreInput/CoreInput-config.cmake) +try_inc_lib(CoreScene cmake/core/CoreScene/CoreScene-config.cmake) +try_inc_lib(Animation cmake/core/Animation/Animation-config.cmake) +try_inc_lib(PlatformAppApi cmake/core/PlatformAppApi/PlatformAppApi-config.cmake) +try_inc_lib(PlatformApp cmake/core/PlatformApp/PlatformApp-config.cmake) +try_inc_lib(Render cmake/core/Render/Render-config.cmake) +try_inc_lib(GraphicsAssets cmake/core/GraphicsAssets/GraphicsAssets-config.cmake) +try_inc_lib(Audio cmake/core/Audio/Audio-config.cmake) +try_inc_lib(cocos2d cmake/core/cocos2d/cocos2d-config.cmake) +try_inc_lib(DebugRenderer cmake/core/DebugRenderer/DebugRenderer-config.cmake) +try_inc_lib(Graphics cmake/core/Graphics/Graphics-config.cmake) +try_inc_lib(LuaToolkit cmake/core/LuaToolkit/LuaToolkit-config.cmake) +try_inc_lib(Network cmake/core/Network/Network-config.cmake) +try_inc_lib(Physics cmake/core/Physics/Physics-config.cmake) +try_inc_lib(PhysicsJolt cmake/core/PhysicsJolt/PhysicsJolt-config.cmake) +try_inc_lib(ScriptsLua cmake/core/ScriptsLua/ScriptsLua-config.cmake) +try_inc_lib(ui cmake/core/ui/ui-config.cmake) +try_inc_lib(VFX cmake/core/VFX/VFX-config.cmake) +try_inc_lib(NauFramework cmake/core/NauFramework/NauFramework-config.cmake) + +try_inc_lib(nlohmann_json cmake/tools/nlohmann_json/nlohmann_json-config.cmake) +try_inc_lib(Shared cmake/tools/Shared/Shared-config.cmake) +try_inc_lib(UsdHelpers cmake/tools/UsdHelpers/UsdHelpers-config.cmake) +try_inc_lib(UsdProxy cmake/tools/UsdProxy/UsdProxy-config.cmake) +try_inc_lib(UsdMetaTools cmake/tools/UsdMetaTools/UsdMetaTools-config.cmake) +try_inc_lib(AssetPackTool cmake/tools/AssetPackTool/AssetPackTool-config.cmake) +try_inc_lib(AssetTool cmake/tools/AssetTool/AssetTool-config.cmake) +try_inc_lib(BuildTool cmake/tools/BuildTool/BuildTool-config.cmake) +try_inc_exe(BuildToolCmd cmake/tools/BuildToolCmd/BuildToolCmd-config.cmake) +try_inc_exe(MaterialCreationTool cmake/tools/MaterialCreationTool/MaterialCreationTool-config.cmake) +try_inc_lib(ProjectTool cmake/tools/ProjectTool/ProjectTool-config.cmake) +try_inc_exe(ProjectToolCmd cmake/tools/ProjectToolCmd/ProjectToolCmd-config.cmake) +try_inc_exe(ShaderCompilerTool cmake/tools/ShaderCompilerTool/ShaderCompilerTool-config.cmake) + +try_inc_lib(NauAnimationClipAsset cmake/tools/plugins/NauAnimationClipAsset/NauAnimationClipAsset-config.cmake) +try_inc_lib(NauAssetMetadata cmake/tools/plugins/NauAssetMetadata/NauAssetMetadata-config.cmake) +try_inc_lib(NauAudioSchema cmake/tools/plugins/NauAudioSchema/NauAudioSchema-config.cmake) +try_inc_lib(NauComponentSchema cmake/tools/plugins/NauComponentSchema/NauComponentSchema-config.cmake) +try_inc_lib(NauGuiSchema cmake/tools/plugins/NauGuiSchema/NauGuiSchema-config.cmake) +try_inc_lib(NauInputSchema cmake/tools/plugins/NauInputSchema/NauInputSchema-config.cmake) +try_inc_lib(NauPhysicsSchema cmake/tools/plugins/NauPhysicsSchema/NauPhysicsSchema-config.cmake) +try_inc_lib(NauUsdFormat cmake/tools/plugins/NauUsdFormat/NauUsdFormat-config.cmake) +try_inc_lib(NauVFXSchema cmake/tools/plugins/NauVFXSchema/NauVFXSchema-config.cmake) +try_inc_lib(UsdUidLookup cmake/tools/plugins/UsdUidLookup/UsdUidLookup-config.cmake) + +try_inc_lib(UsdTranslator cmake/tools/UsdTranslator/UsdTranslator-config.cmake) +try_inc_lib(UsdTranslatorWrapper cmake/tools/plugins/UsdTranslatorWrapper/UsdTranslatorWrapper-config.cmake) + +try_add(samples/sample_common) try_add(samples/all3rdpartyBuild) try_add(samples/inputDemo) try_add(samples/kernelBuild) diff --git a/cmake/for_build/CMakePresets.json b/cmake/for_build/CMakePresets.json index 08e40f19..71eac2e5 100644 --- a/cmake/for_build/CMakePresets.json +++ b/cmake/for_build/CMakePresets.json @@ -10,7 +10,6 @@ "CMAKE_EXPORT_COMPILE_COMMANDS": true, "CMAKE_SYSTEM_VERSION": "10.0", "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", - "NAU_BUILD_SDK": true, "BUILD_SHARED_LIBS": false, "EASTL_BUILD_BENCHMARK": false, "EASTL_BUILD_TESTS": false diff --git a/engine/3rdparty_libs/CMakeLists.txt b/engine/3rdparty_libs/CMakeLists.txt index b1081b9c..18864137 100644 --- a/engine/3rdparty_libs/CMakeLists.txt +++ b/engine/3rdparty_libs/CMakeLists.txt @@ -127,6 +127,7 @@ if (NAU_CORE_TESTS) set(gtest_force_shared_crt OFF CACHE BOOL "" FORCE) set(BUILD_GTEST ON CACHE BOOL "" FORCE) set(BUILD_GMOCK ON CACHE BOOL "" FORCE) + set(INSTALL_GTEST OFF CACHE BOOL "" FORCE) add_subdirectory(googletest) nau_target_add_compile_options(TARGETS gtest gmock) diff --git a/engine/3rdparty_libs/JoltPhysics/CMakeLists.txt b/engine/3rdparty_libs/JoltPhysics/CMakeLists.txt index 0e8dc8b3..98e7858d 100644 --- a/engine/3rdparty_libs/JoltPhysics/CMakeLists.txt +++ b/engine/3rdparty_libs/JoltPhysics/CMakeLists.txt @@ -235,14 +235,14 @@ if (XCODE) endif() # Install Jolt library and includes -install(TARGETS Jolt DESTINATION lib) -foreach(SRC_FILE ${JOLT_PHYSICS_SRC_FILES}) - string(REPLACE ${PHYSICS_REPO_ROOT} "" RELATIVE_SRC_FILE ${SRC_FILE}) - get_filename_component(DESTINATION_PATH ${RELATIVE_SRC_FILE} DIRECTORY) - if (NOT RELATIVE_SRC_FILE MATCHES "\.cpp") - install(FILES ${SRC_FILE} DESTINATION include/${DESTINATION_PATH}) - endif() -endforeach() +#install(TARGETS Jolt DESTINATION lib) +#foreach(SRC_FILE ${JOLT_PHYSICS_SRC_FILES}) +# string(REPLACE ${PHYSICS_REPO_ROOT} "" RELATIVE_SRC_FILE ${SRC_FILE}) +# get_filename_component(DESTINATION_PATH ${RELATIVE_SRC_FILE} DIRECTORY) +# if (NOT RELATIVE_SRC_FILE MATCHES "\.cpp") +# install(FILES ${SRC_FILE} DESTINATION include/${DESTINATION_PATH}) +# endif() +#endforeach() # Check if we're the root CMakeLists.txt, if not we are included by another CMake file and we should disable everything except for the main library if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) diff --git a/engine/3rdparty_libs/fmt/CMakeLists.txt b/engine/3rdparty_libs/fmt/CMakeLists.txt index 45313376..86857b80 100644 --- a/engine/3rdparty_libs/fmt/CMakeLists.txt +++ b/engine/3rdparty_libs/fmt/CMakeLists.txt @@ -391,11 +391,11 @@ if (FMT_INSTALL_DISABLED) set(INSTALL_TARGETS fmt fmt-header-only) # Install the library and headers. - install(TARGETS ${INSTALL_TARGETS} EXPORT ${targets_export_name} - LIBRARY DESTINATION ${FMT_LIB_DIR} - ARCHIVE DESTINATION ${FMT_LIB_DIR} - PUBLIC_HEADER DESTINATION "${FMT_INC_DIR}/fmt" - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #install(TARGETS ${INSTALL_TARGETS} EXPORT ${targets_export_name} + # LIBRARY DESTINATION ${FMT_LIB_DIR} + # ARCHIVE DESTINATION ${FMT_LIB_DIR} + # PUBLIC_HEADER DESTINATION "${FMT_INC_DIR}/fmt" + # RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) # Use a namespace because CMake provides better diagnostics for namespaced # imported targets. @@ -403,13 +403,13 @@ if (FMT_INSTALL_DISABLED) FILE ${PROJECT_BINARY_DIR}/${targets_export_name}.cmake) # Install version, config and target files. - install( - FILES ${project_config} ${version_config} - DESTINATION ${FMT_CMAKE_DIR}) - install(EXPORT ${targets_export_name} DESTINATION ${FMT_CMAKE_DIR} - NAMESPACE fmt::) + #install( + # FILES ${project_config} ${version_config} + # DESTINATION ${FMT_CMAKE_DIR}) + #install(EXPORT ${targets_export_name} DESTINATION ${FMT_CMAKE_DIR} + # NAMESPACE fmt::) - install(FILES "${pkgconfig}" DESTINATION "${FMT_PKGCONFIG_DIR}") + #install(FILES "${pkgconfig}" DESTINATION "${FMT_PKGCONFIG_DIR}") endif () if (FMT_DOC) diff --git a/engine/3rdparty_libs/gainput/lib/CMakeLists.txt b/engine/3rdparty_libs/gainput/lib/CMakeLists.txt index 823586d8..519113ec 100644 --- a/engine/3rdparty_libs/gainput/lib/CMakeLists.txt +++ b/engine/3rdparty_libs/gainput/lib/CMakeLists.txt @@ -84,19 +84,6 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR) endif(NOT DEFINED CMAKE_INSTALL_LIBDIR) set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) -install( - DIRECTORY "include/gainput" - DESTINATION "include" - FILES_MATCHING PATTERN "*.h" -) - -install( - TARGETS ${install_libs} - LIBRARY DESTINATION "${libdir}" - ARCHIVE DESTINATION "${libdir}" - RUNTIME DESTINATION "bin" -) - nau_collect_files(HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORIES diff --git a/engine/3rdparty_libs/lua/CMakeLists.txt b/engine/3rdparty_libs/lua/CMakeLists.txt index 63e4ada7..49160589 100644 --- a/engine/3rdparty_libs/lua/CMakeLists.txt +++ b/engine/3rdparty_libs/lua/CMakeLists.txt @@ -19,8 +19,8 @@ nau_collect_files(Sources add_library(${TargetName} ${Sources}) -target_include_directories(${TargetName} INTERFACE - $ +target_include_directories(${TargetName} PUBLIC + $ $/include/3rdPartyLibs/lua/include> ) diff --git a/engine/3rdparty_libs/lua/src/lapi.h b/engine/3rdparty_libs/lua/include/lapi.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lapi.h rename to engine/3rdparty_libs/lua/include/lapi.h diff --git a/engine/3rdparty_libs/lua/src/lauxlib.h b/engine/3rdparty_libs/lua/include/lauxlib.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lauxlib.h rename to engine/3rdparty_libs/lua/include/lauxlib.h diff --git a/engine/3rdparty_libs/lua/src/lcode.h b/engine/3rdparty_libs/lua/include/lcode.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lcode.h rename to engine/3rdparty_libs/lua/include/lcode.h diff --git a/engine/3rdparty_libs/lua/src/lctype.h b/engine/3rdparty_libs/lua/include/lctype.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lctype.h rename to engine/3rdparty_libs/lua/include/lctype.h diff --git a/engine/3rdparty_libs/lua/src/ldebug.h b/engine/3rdparty_libs/lua/include/ldebug.h similarity index 100% rename from engine/3rdparty_libs/lua/src/ldebug.h rename to engine/3rdparty_libs/lua/include/ldebug.h diff --git a/engine/3rdparty_libs/lua/src/ldo.h b/engine/3rdparty_libs/lua/include/ldo.h similarity index 100% rename from engine/3rdparty_libs/lua/src/ldo.h rename to engine/3rdparty_libs/lua/include/ldo.h diff --git a/engine/3rdparty_libs/lua/src/lfunc.h b/engine/3rdparty_libs/lua/include/lfunc.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lfunc.h rename to engine/3rdparty_libs/lua/include/lfunc.h diff --git a/engine/3rdparty_libs/lua/src/lgc.h b/engine/3rdparty_libs/lua/include/lgc.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lgc.h rename to engine/3rdparty_libs/lua/include/lgc.h diff --git a/engine/3rdparty_libs/lua/src/ljumptab.h b/engine/3rdparty_libs/lua/include/ljumptab.h similarity index 100% rename from engine/3rdparty_libs/lua/src/ljumptab.h rename to engine/3rdparty_libs/lua/include/ljumptab.h diff --git a/engine/3rdparty_libs/lua/src/llex.h b/engine/3rdparty_libs/lua/include/llex.h similarity index 100% rename from engine/3rdparty_libs/lua/src/llex.h rename to engine/3rdparty_libs/lua/include/llex.h diff --git a/engine/3rdparty_libs/lua/src/llimits.h b/engine/3rdparty_libs/lua/include/llimits.h similarity index 100% rename from engine/3rdparty_libs/lua/src/llimits.h rename to engine/3rdparty_libs/lua/include/llimits.h diff --git a/engine/3rdparty_libs/lua/src/lmem.h b/engine/3rdparty_libs/lua/include/lmem.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lmem.h rename to engine/3rdparty_libs/lua/include/lmem.h diff --git a/engine/3rdparty_libs/lua/src/lobject.h b/engine/3rdparty_libs/lua/include/lobject.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lobject.h rename to engine/3rdparty_libs/lua/include/lobject.h diff --git a/engine/3rdparty_libs/lua/src/lopcodes.h b/engine/3rdparty_libs/lua/include/lopcodes.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lopcodes.h rename to engine/3rdparty_libs/lua/include/lopcodes.h diff --git a/engine/3rdparty_libs/lua/src/lopnames.h b/engine/3rdparty_libs/lua/include/lopnames.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lopnames.h rename to engine/3rdparty_libs/lua/include/lopnames.h diff --git a/engine/3rdparty_libs/lua/src/lparser.h b/engine/3rdparty_libs/lua/include/lparser.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lparser.h rename to engine/3rdparty_libs/lua/include/lparser.h diff --git a/engine/3rdparty_libs/lua/src/lprefix.h b/engine/3rdparty_libs/lua/include/lprefix.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lprefix.h rename to engine/3rdparty_libs/lua/include/lprefix.h diff --git a/engine/3rdparty_libs/lua/src/lstate.h b/engine/3rdparty_libs/lua/include/lstate.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lstate.h rename to engine/3rdparty_libs/lua/include/lstate.h diff --git a/engine/3rdparty_libs/lua/src/lstring.h b/engine/3rdparty_libs/lua/include/lstring.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lstring.h rename to engine/3rdparty_libs/lua/include/lstring.h diff --git a/engine/3rdparty_libs/lua/src/ltable.h b/engine/3rdparty_libs/lua/include/ltable.h similarity index 100% rename from engine/3rdparty_libs/lua/src/ltable.h rename to engine/3rdparty_libs/lua/include/ltable.h diff --git a/engine/3rdparty_libs/lua/src/ltm.h b/engine/3rdparty_libs/lua/include/ltm.h similarity index 100% rename from engine/3rdparty_libs/lua/src/ltm.h rename to engine/3rdparty_libs/lua/include/ltm.h diff --git a/engine/3rdparty_libs/lua/src/lua.h b/engine/3rdparty_libs/lua/include/lua.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lua.h rename to engine/3rdparty_libs/lua/include/lua.h diff --git a/engine/3rdparty_libs/lua/src/lua.hpp b/engine/3rdparty_libs/lua/include/lua.hpp similarity index 100% rename from engine/3rdparty_libs/lua/src/lua.hpp rename to engine/3rdparty_libs/lua/include/lua.hpp diff --git a/engine/3rdparty_libs/lua/src/luaconf.h b/engine/3rdparty_libs/lua/include/luaconf.h similarity index 100% rename from engine/3rdparty_libs/lua/src/luaconf.h rename to engine/3rdparty_libs/lua/include/luaconf.h diff --git a/engine/3rdparty_libs/lua/src/lualib.h b/engine/3rdparty_libs/lua/include/lualib.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lualib.h rename to engine/3rdparty_libs/lua/include/lualib.h diff --git a/engine/3rdparty_libs/lua/src/lundump.h b/engine/3rdparty_libs/lua/include/lundump.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lundump.h rename to engine/3rdparty_libs/lua/include/lundump.h diff --git a/engine/3rdparty_libs/lua/src/lvm.h b/engine/3rdparty_libs/lua/include/lvm.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lvm.h rename to engine/3rdparty_libs/lua/include/lvm.h diff --git a/engine/3rdparty_libs/lua/src/lzio.h b/engine/3rdparty_libs/lua/include/lzio.h similarity index 100% rename from engine/3rdparty_libs/lua/src/lzio.h rename to engine/3rdparty_libs/lua/include/lzio.h diff --git a/engine/3rdparty_libs/ozz/extern/jsoncpp/CMakeLists.txt b/engine/3rdparty_libs/ozz/extern/jsoncpp/CMakeLists.txt index 9bf89b2e..37f8c783 100644 --- a/engine/3rdparty_libs/ozz/extern/jsoncpp/CMakeLists.txt +++ b/engine/3rdparty_libs/ozz/extern/jsoncpp/CMakeLists.txt @@ -1,7 +1,11 @@ +set(HEADERS + dist/json/json-forwards.h + dist/json/json.h +) + add_library(json dist/jsoncpp.cpp - dist/json/json.h - dist/json/json-forwards.h) + ${HEADERS}) set_target_properties(json PROPERTIES FOLDER "NauEngine/3rdparty/ozz/extern") @@ -20,4 +24,7 @@ target_compile_options(json PUBLIC $<$:/wd4275>) target_include_directories(json PUBLIC - $) + $ + $) + +nau_install(json 3rdPartyLibs ${HEADERS}) \ No newline at end of file diff --git a/engine/3rdparty_libs/ozz/src/animation/offline/CMakeLists.txt b/engine/3rdparty_libs/ozz/src/animation/offline/CMakeLists.txt index f19b16fc..03d803d2 100644 --- a/engine/3rdparty_libs/ozz/src/animation/offline/CMakeLists.txt +++ b/engine/3rdparty_libs/ozz/src/animation/offline/CMakeLists.txt @@ -31,7 +31,7 @@ target_link_libraries(ozz_animation_offline ozz_animation) set_target_properties(ozz_animation_offline PROPERTIES FOLDER "NauEngine/3rdparty/ozz") -install(TARGETS ozz_animation_offline DESTINATION lib) +nau_install(ozz_animation_offline 3rdPartyLibs) fuse_target("ozz_animation_offline") diff --git a/engine/3rdparty_libs/ozz/src/animation/offline/gltf/CMakeLists.txt b/engine/3rdparty_libs/ozz/src/animation/offline/gltf/CMakeLists.txt index 7e59532c..1df8329a 100644 --- a/engine/3rdparty_libs/ozz/src/animation/offline/gltf/CMakeLists.txt +++ b/engine/3rdparty_libs/ozz/src/animation/offline/gltf/CMakeLists.txt @@ -11,4 +11,4 @@ target_copy_shared_libraries(gltf2ozz) set_target_properties(gltf2ozz PROPERTIES FOLDER "NauEngine/3rdparty/ozz/tools") -install(TARGETS gltf2ozz DESTINATION bin/tools) +install(TARGETS gltf2ozz DESTINATION bin/$) diff --git a/engine/3rdparty_libs/ozz/src/animation/offline/tools/CMakeLists.txt b/engine/3rdparty_libs/ozz/src/animation/offline/tools/CMakeLists.txt index 90589b9c..3c609081 100644 --- a/engine/3rdparty_libs/ozz/src/animation/offline/tools/CMakeLists.txt +++ b/engine/3rdparty_libs/ozz/src/animation/offline/tools/CMakeLists.txt @@ -27,7 +27,7 @@ target_link_libraries(ozz_animation_tools set_target_properties(ozz_animation_tools PROPERTIES FOLDER "NauEngine/3rdparty/ozz/tools") -install(TARGETS ozz_animation_tools DESTINATION lib) +nau_install(ozz_animation_tools 3rdPartyLibs) fuse_target("ozz_animation_tools") diff --git a/engine/3rdparty_libs/ozz/src/animation/runtime/CMakeLists.txt b/engine/3rdparty_libs/ozz/src/animation/runtime/CMakeLists.txt index 2fc766ef..6e06d662 100644 --- a/engine/3rdparty_libs/ozz/src/animation/runtime/CMakeLists.txt +++ b/engine/3rdparty_libs/ozz/src/animation/runtime/CMakeLists.txt @@ -37,8 +37,6 @@ target_link_libraries(ozz_animation set_target_properties(ozz_animation PROPERTIES FOLDER "NauEngine/3rdparty/ozz") -install(TARGETS ozz_animation DESTINATION lib) - fuse_target("ozz_animation") nau_collect_files(HEADERS diff --git a/engine/3rdparty_libs/ozz/src/base/CMakeLists.txt b/engine/3rdparty_libs/ozz/src/base/CMakeLists.txt index a1617fbd..7314bf10 100644 --- a/engine/3rdparty_libs/ozz/src/base/CMakeLists.txt +++ b/engine/3rdparty_libs/ozz/src/base/CMakeLists.txt @@ -69,8 +69,6 @@ target_include_directories(ozz_base PUBLIC set_target_properties(ozz_base PROPERTIES FOLDER "NauEngine/3rdparty/ozz") -install(TARGETS ozz_base DESTINATION lib) - fuse_target("ozz_base") nau_collect_files(HEADERS diff --git a/engine/3rdparty_libs/ozz/src/geometry/runtime/CMakeLists.txt b/engine/3rdparty_libs/ozz/src/geometry/runtime/CMakeLists.txt index 1fd4e944..97991e68 100644 --- a/engine/3rdparty_libs/ozz/src/geometry/runtime/CMakeLists.txt +++ b/engine/3rdparty_libs/ozz/src/geometry/runtime/CMakeLists.txt @@ -7,6 +7,6 @@ target_compile_definitions(ozz_geometry PRIVATE $<$:O target_link_libraries(ozz_geometry ozz_base) set_target_properties(ozz_geometry PROPERTIES FOLDER "NauEngine/3rdparty/ozz") -install(TARGETS ozz_geometry DESTINATION lib) +nau_install(ozz_geometry 3rdPartyLibs) fuse_target("ozz_geometry") diff --git a/engine/3rdparty_libs/ozz/src/options/CMakeLists.txt b/engine/3rdparty_libs/ozz/src/options/CMakeLists.txt index ac9be50a..52bca552 100644 --- a/engine/3rdparty_libs/ozz/src/options/CMakeLists.txt +++ b/engine/3rdparty_libs/ozz/src/options/CMakeLists.txt @@ -8,6 +8,6 @@ target_compile_definitions(ozz_options PRIVATE $<$:OZ set_target_properties(ozz_options PROPERTIES FOLDER "NauEngine/3rdparty/ozz") -install(TARGETS ozz_options DESTINATION lib) +nau_install(ozz_options 3rdPartyLibs) fuse_target("ozz_options") diff --git a/engine/3rdparty_libs/stb/CMakeLists.txt b/engine/3rdparty_libs/stb/CMakeLists.txt index 3561e427..e31bcb24 100644 --- a/engine/3rdparty_libs/stb/CMakeLists.txt +++ b/engine/3rdparty_libs/stb/CMakeLists.txt @@ -4,8 +4,16 @@ project(stb LANGUAGES CXX) set(TargetName stb) +nau_collect_files(HEADERS + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + DIRECTORIES + ${CMAKE_CURRENT_SOURCE_DIR} + MASK "*.h" "*.hpp" +) + add_library(${TargetName} INTERFACE + ${HEADERS} ) target_include_directories(${TargetName} INTERFACE diff --git a/engine/3rdparty_libs/tinydds/CMakeLists.txt b/engine/3rdparty_libs/tinydds/CMakeLists.txt index 70cb2e6d..ba820c72 100644 --- a/engine/3rdparty_libs/tinydds/CMakeLists.txt +++ b/engine/3rdparty_libs/tinydds/CMakeLists.txt @@ -4,8 +4,15 @@ project(tinydds LANGUAGES CXX) set(TargetName tinydds) +nau_collect_files(HEADERS + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} + MASK "*.h" "*.hpp" +) + add_library(${TargetName} INTERFACE + ${HEADERS} ) target_include_directories(${TargetName} INTERFACE @@ -13,4 +20,4 @@ target_include_directories(${TargetName} INTERFACE $/include/3rdPartyLibs/tinydds> ) -nau_install(${TargetName} 3rdPartyLibs) \ No newline at end of file +nau_install(${TargetName} 3rdPartyLibs ${HEADERS}) \ No newline at end of file diff --git a/engine/3rdparty_libs/tinygltf/CMakeLists.txt b/engine/3rdparty_libs/tinygltf/CMakeLists.txt index f3a6b560..5ee7eed2 100644 --- a/engine/3rdparty_libs/tinygltf/CMakeLists.txt +++ b/engine/3rdparty_libs/tinygltf/CMakeLists.txt @@ -4,8 +4,20 @@ project(tinygltf LANGUAGES CXX) set(TargetName tinygltf) +nau_collect_files(HEADERS + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} + MASK "*.h" "*.hpp" +) + add_library(${TargetName} INTERFACE + ${HEADERS} +) + +target_include_directories(${TargetName} INTERFACE + $ + $/include/3rdPartyLibs/tinygltf> ) -target_include_directories(${TargetName} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/) \ No newline at end of file +nau_install(${TargetName} 3rdPartyLibs ${HEADERS}) \ No newline at end of file diff --git a/engine/core/modules/physics/CMakeLists.txt b/engine/core/modules/physics/CMakeLists.txt index 74f2a543..9f7c484b 100644 --- a/engine/core/modules/physics/CMakeLists.txt +++ b/engine/core/modules/physics/CMakeLists.txt @@ -28,7 +28,7 @@ target_include_directories(${TargetName} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src target_include_directories(${TargetName} PUBLIC $ - $/include/core/modules/physics//include> + $/include/core/modules/physics/include> ) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX Source FILES ${Sources}) diff --git a/engine/core/modules/scene/src/CMakeLists.txt b/engine/core/modules/scene/src/CMakeLists.txt index e4b8cd11..f79ba411 100644 --- a/engine/core/modules/scene/src/CMakeLists.txt +++ b/engine/core/modules/scene/src/CMakeLists.txt @@ -33,15 +33,12 @@ target_compile_definitions(${TargetName} PRIVATE NAU_CORESCENE_BUILD) target_precompile_headers(${TargetName} PRIVATE pch.h) target_include_directories(${TargetName} PRIVATE - $ - $/include/core/modules/scene/src> + ${CMAKE_CURRENT_SOURCE_DIR} ) target_include_directories(${TargetName} PUBLIC $ - $ $/include/core/modules/scene/include> -# $/include/core/modules/scene/include/nau/generated> ) target_link_libraries(${TargetName} PUBLIC @@ -59,12 +56,4 @@ install(DIRECTORY ${ModuleRoot}/include PATTERN "*.ipp" ) -install(DIRECTORY ${ModuleRoot}/include/nau/generated - DESTINATION ${CMAKE_INSTALL_PREFIX}/include/core/modules/scene - FILES_MATCHING - PATTERN "*.h" - PATTERN "*.hpp" - PATTERN "*.ipp" -) - nau_install(${TargetName} core) \ No newline at end of file diff --git a/engine/core/modules/scripts_lua/lua_toolkit/src/CMakeLists.txt b/engine/core/modules/scripts_lua/lua_toolkit/src/CMakeLists.txt index 8332ddf8..8b8168cc 100644 --- a/engine/core/modules/scripts_lua/lua_toolkit/src/CMakeLists.txt +++ b/engine/core/modules/scripts_lua/lua_toolkit/src/CMakeLists.txt @@ -34,6 +34,7 @@ target_include_directories(${TargetName} PRIVATE target_include_directories(${TargetName} PUBLIC $ + $/include/core/modules/lua_toolkit/include> # $ # $ ) @@ -47,7 +48,7 @@ source_group(TREE ${moduleRoot}/src PREFIX Sources FILES ${Sources}) source_group(TREE ${moduleRoot}/include PREFIX Headers FILES ${Headers}) install(DIRECTORY ${moduleRoot}/include - DESTINATION ${CMAKE_INSTALL_PREFIX}/include/core/lua_toolkit + DESTINATION ${CMAKE_INSTALL_PREFIX}/include/core/modules/lua_toolkit FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" diff --git a/engine/core/modules/ui/cocos2d-x/external/freetype2/CMakeLists.txt b/engine/core/modules/ui/cocos2d-x/external/freetype2/CMakeLists.txt index d44b7e38..87afe641 100644 --- a/engine/core/modules/ui/cocos2d-x/external/freetype2/CMakeLists.txt +++ b/engine/core/modules/ui/cocos2d-x/external/freetype2/CMakeLists.txt @@ -17,13 +17,13 @@ if(WINDOWS) set_target_properties(${target_name} PROPERTIES IMPORTED_LOCATION "${platform_spec_path}/${lib_name}.lib") install(FILES "${platform_spec_path}/${lib_name}.lib" - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/$ RENAME ${target_name}.lib) else() set_target_properties(${target_name} PROPERTIES IMPORTED_LOCATION "${platform_spec_path}/lib${lib_name}.a") install(FILES "${platform_spec_path}/lib${lib_name}.a" - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/$ RENAME ${target_name}.a) endif() diff --git a/engine/core/modules/ui/cocos2d-x/external/jpeg/CMakeLists.txt b/engine/core/modules/ui/cocos2d-x/external/jpeg/CMakeLists.txt index ecea4d49..52abd446 100644 --- a/engine/core/modules/ui/cocos2d-x/external/jpeg/CMakeLists.txt +++ b/engine/core/modules/ui/cocos2d-x/external/jpeg/CMakeLists.txt @@ -16,12 +16,12 @@ if(WINDOWS) set_target_properties(${target_name} PROPERTIES IMPORTED_LOCATION "${platform_spec_path}/lib${lib_name}.lib") install(FILES "${platform_spec_path}/lib${lib_name}.lib" - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/$ RENAME ${target_name}.lib) else() set_target_properties(${target_name} PROPERTIES IMPORTED_LOCATION "${platform_spec_path}/lib${lib_name}.a") install(FILES "${platform_spec_path}/lib${lib_name}.a" - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/$ RENAME ${target_name}.a) endif() diff --git a/engine/core/modules/vfx/src/components/vfx_component.cpp b/engine/core/modules/vfx/src/components/vfx_component.cpp index ae36fac0..cbb8347f 100644 --- a/engine/core/modules/vfx/src/components/vfx_component.cpp +++ b/engine/core/modules/vfx/src/components/vfx_component.cpp @@ -3,7 +3,7 @@ #include "vfx_component.h" #include "nau/vfx_manager.h" -#include "../scene/scene_manager.h" +#include "nau/scene/scene_manager.h" #include "nau/io/virtual_file_system.h" namespace nau::vfx diff --git a/project_templates/empty/CMakeLists.txt b/project_templates/empty/CMakeLists.txt index de5e0ae8..9bbe6b2c 100644 --- a/project_templates/empty/CMakeLists.txt +++ b/project_templates/empty/CMakeLists.txt @@ -5,24 +5,20 @@ cmake_minimum_required(VERSION 3.20) project(%%(ProjectName:no_space)%%) -# TODO: set enviroment variables for other platforms -if(WIN32) - execute_process(COMMAND "${CMAKE_SOURCE_DIR}/cmake/platformSpec/set_env.bat") -endif(WIN32) if(POLICY CMP0091) cmake_policy(SET CMP0091 NEW) endif() -if(NOT DEFINED ${NauEngineFolder}) +if(NOT DEFINED NauEngineFolder) file(TO_CMAKE_PATH "$ENV{NAU_ENGINE_SDK_DIR}" ENV_NAU_ENGINE_SDK_DIR) set(NauEngineFolder "${ENV_NAU_ENGINE_SDK_DIR}") -endif(NOT DEFINED ${NauEngineFolder}) +endif() +cmake_path(SET NauEngineFolder NORMALIZE "${NauEngineFolder}") message(NOTICE "SDK folder ${NauEngineFolder}") -if(NOT EXISTS ${NauEngineFolder}/CMakeLists.txt - OR NOT EXISTS ${NauEngineFolder}/cmake +if(NOT EXISTS ${NauEngineFolder}/cmake OR NOT EXISTS ${NauEngineFolder}/lib OR NOT EXISTS ${NauEngineFolder}/include ) @@ -34,6 +30,58 @@ set(CMAKE_MODULE_PATH ${NauEngineFolder} ${NauEngineFolder}/cmake/defaults ) +# TODO: set enviroment variables for other platforms +if(WIN32) + execute_process(COMMAND "${CMAKE_SOURCE_DIR}/cmake/platformSpec/set_env.bat") +endif(WIN32) + + +# Compiler config +set(CMAKE_CXX_STANDARD 20) +# TODO: define C standard + +# Enable Hot Reload for MSVC compilers if supported. +if(POLICY CMP0141) + cmake_policy(SET CMP0141 NEW) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") +endif() + +add_compile_options($<$:/MP>) + + +# Global config +if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/output CACHE PATH "" FORCE) + message(STATUS "Use default install folder: ${CMAKE_INSTALL_PREFIX}") +else() + message(STATUS "Defined install folder: ${CMAKE_INSTALL_PREFIX}") +endif() + +if (DEFINED CMAKE_BUILD_TYPE) + message(STATUS "Build configuration: ${CMAKE_BUILD_TYPE}") +else() + if (DEFINED CMAKE_CONFIGURATION_TYPES) + message(STATUS "Use multi-configuration. Allowed configurations at build time: ${CMAKE_CONFIGURATION_TYPES}") + else() + set(CMAKE_BUILD_TYPE "Debug") + message(STATUS "Use default build configuration: ${CMAKE_BUILD_TYPE}") + endif() +endif() + +if (NOT DEFINED CMAKE_TOOLCHAIN_FILE) + message(FATAL_ERROR "Toolchain not selected! Please define -DCMAKE_TOOLCHAIN_FILE") +else() + message(STATUS "Toolchain file: ${CMAKE_TOOLCHAIN_FILE}") +endif() + +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib/$) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin/$) + +set(NauSDKIncludes ${NauEngineFolder}/include) +set(NauSDKLibraries ${NauEngineFolder}/lib) + + +# Nau options option(NAU_RTTI "Enable rtti support" OFF) option(NAU_EXCEPTIONS "Enable exception support" OFF) option(NAU_VERBOSE_LOG "Enable verbose messages for logger" OFF) @@ -41,120 +89,162 @@ option(NAU_MATH_USE_DOUBLE_PRECISION "Enable double precision for math" OFF) option(BUILD_SHARED_LIBS "Build shared libs" ON) + +# Process options if(BUILD_SHARED_LIBS) message(STATUS "Configure for dynamic (DLL) runtime") else() message(STATUS "Configure for static (monolith) runtime") endif() -set(NauSDKIncludes ${NauEngineFolder}/include) -set(NauSDKLibraries ${NauEngineFolder}/lib) - -set(CMAKE_CXX_STANDARD 20) - -find_package(Python - REQUIRED -) include(NauCommon) include(NauModule) include(NauGenFunctions) include(platformSpec/NauPlatformSetup) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin) - -# Enable Hot Reload for MSVC compilers if supported. -if(POLICY CMP0141) - cmake_policy(SET CMP0141 NEW) - set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") -endif() -find_package(Threads REQUIRED) +function(try_inc_lib target cmakeName) + if (EXISTS ${NauEngineFolder}/${cmakeName}) + message(STATUS "include ${cmakeName} from NAU sdk") + include(${NauEngineFolder}/${cmakeName}) + if (BUILD_SHARED_LIBS) + set_target_properties(${target} PROPERTIES + IMPORTED_LOCATION_Debug "${NauEngineFolder}/bin/Debug/${target}.dll" + IMPORTED_LOCATION_Release "${NauEngineFolder}/bin/Release/${target}.dll" + IMPORTED_IMPLIB_Debug "${NauEngineFolder}/lib/Debug/${target}.lib" + IMPORTED_IMPLIB_Release "${NauEngineFolder}/lib/Release/${target}.lib" + IMPORTED_GLOBAL TRUE + ) + else() + set_target_properties(${target} PROPERTIES + IMPORTED_LOCATION_Debug "${NauEngineFolder}/bin/Debug/${target}.lib" + IMPORTED_LOCATION_Release "${NauEngineFolder}/bin/Release/${target}.lib" + IMPORTED_GLOBAL TRUE + ) + endif() + endif() +endfunction() -function(try_inc cmakeName) - if(EXISTS ${NauEngineFolder}/${cmakeName}) +function(try_inc_exe target cmakeName) + if (EXISTS ${NauEngineFolder}/${cmakeName}) + message(STATUS "include ${cmakeName} from NAU sdk") include(${NauEngineFolder}/${cmakeName}) - message(STATUS "${NauEngineFolder}/${cmakeName}") + set_target_properties(${target} PROPERTIES + IMPORTED_LOCATION_Debug "${NauEngineFolder}/bin/Debug/${target}.exe" + IMPORTED_LOCATION_Release "${NauEngineFolder}/bin/Release/${target}.exe" + IMPORTED_GLOBAL TRUE + ) endif() endfunction() function(try_add subdir) - if(EXISTS ${NauEngineFolder}/${subdir}) + if (EXISTS ${NauEngineFolder}/${subdir}) + message(STATUS "add ${subdir} from NAU sdk") add_subdirectory(${NauEngineFolder}/${subdir}) - message(STATUS "${NauEngineFolder}/${subdir}") endif() endfunction() -try_inc(cmake/3rdPartyLibs/asio/asio-config.cmake) -try_inc(cmake/3rdPartyLibs/brotli/brotli-config.cmake) -try_inc(cmake/3rdPartyLibs/EABase/EABase-config.cmake) -try_inc(cmake/3rdPartyLibs/EASTL/EASTL-config.cmake) -try_inc(cmake/3rdPartyLibs/fast_float/fast_float-config.cmake) -try_inc(cmake/3rdPartyLibs/jsoncpp/jsoncpp-config.cmake) -try_inc(cmake/3rdPartyLibs/lzma-9.20/lzma-9.20-config.cmake) -try_inc(cmake/3rdPartyLibs/md5/md5-config.cmake) -try_inc(cmake/3rdPartyLibs/vectormath/vectormath-config.cmake) -try_inc(cmake/3rdPartyLibs/wyhash/wyhash-config.cmake) -try_inc(cmake/3rdPartyLibs/zlib-ng/zlib-ng-config.cmake) -try_inc(cmake/3rdPartyLibs/zstd-1.4.5/zstd-1.4.5-config.cmake) -try_inc(cmake/3rdPartyLibs/fmt/fmt-config.cmake) -try_inc(cmake/3rdPartyLibs/tinyutf8/tinyutf8-config.cmake) -try_inc(cmake/3rdPartyLibs/utf8cpp/utf8cpp-config.cmake) -try_inc(cmake/3rdPartyLibs/tinyimageformat/tinyimageformat-config.cmake) -try_inc(cmake/3rdPartyLibs/gainputstatic/gainputstatic-config.cmake) -try_inc(cmake/3rdPartyLibs/imgui/imgui-config.cmake) -try_inc(cmake/3rdPartyLibs/RenderDoc/RenderDoc-config.cmake) -try_inc(cmake/3rdPartyLibs/adlSdk/adlSdk-config.cmake) -try_inc(cmake/3rdPartyLibs/dxc/dxc-config.cmake) -try_inc(cmake/3rdPartyLibs/ska_hash_map/ska_hash_map-config.cmake) -try_inc(cmake/3rdPartyLibs/xxHash/xxHash-config.cmake) -try_inc(cmake/3rdPartyLibs/ozz_base/ozz_base-config.cmake) -try_inc(cmake/3rdPartyLibs/ozz_animation/ozz_animation-config.cmake) -try_inc(cmake/3rdPartyLibs/stb/stb-config.cmake) -try_inc(cmake/3rdPartyLibs/ispc_texcomp/ispc_texcomp-config.cmake) -try_inc(cmake/3rdPartyLibs/tinydds/tinydds-config.cmake) -try_inc(cmake/3rdPartyLibs/Jolt/Jolt-config.cmake) -try_inc(cmake/3rdPartyLibs/uriparser/uriparser-config.cmake) - -## try_inc(share/Tracy/TracyConfig.cmake) - -try_inc(cmake/core/NauKernel/NauKernel-config.cmake) - -try_inc(cmake/3rdPartyLibs/binPack2D/binPack2D-config.cmake) - -try_inc(cmake/core/NauKernel/NauKernel-config.cmake) - -try_inc(cmake/core/CoreAssets/CoreAssets-config.cmake) -try_inc(cmake/core/CoreScene/CoreScene-config.cmake) -try_inc(cmake/core/PlatformAppApi/PlatformAppApi-config.cmake) -try_inc(cmake/core/PlatformApp/PlatformApp-config.cmake) -try_inc(cmake/core/CoreInput/CoreInput-config.cmake) -try_inc(cmake/core/Render/Render-config.cmake) -try_inc(cmake/core/Render/Render-config.cmake) -try_inc(cmake/core/GraphicsAssets/GraphicsAssets-config.cmake) -try_inc(cmake/core/CoreInput/CoreInput-config.cmake) -try_inc(cmake/core/Animation/Animation-config.cmake) -try_inc(cmake/core/ext_tinyxml2/ext_tinyxml2-config.cmake) -try_inc(cmake/core/ext_clipper/ext_clipper-config.cmake) -try_inc(cmake/core/ext_edtaa3func/ext_edtaa3func-config.cmake) -try_inc(cmake/core/ext_convertUTF/ext_convertUTF-config.cmake) -try_inc(cmake/core/ext_poly2tri/ext_poly2tri-config.cmake) -try_inc(cmake/core/png/png-config.cmake) -try_inc(cmake/core/external/external-config.cmake) -try_inc(cmake/core/cocos2d/cocos2d-config.cmake) -try_inc(cmake/core/ui/ui-config.cmake) -try_inc(cmake/core/DebugRenderer/DebugRenderer-config.cmake) -try_inc(cmake/core/VFX/VFX-config.cmake) -try_inc(cmake/core/Graphics/Graphics-config.cmake) -try_inc(cmake/core/CoreAssetFormats/CoreAssetFormats-config.cmake) -try_inc(cmake/core/NauFramework/NauFramework-config.cmake) -try_inc(cmake/core/Physics/Physics-config.cmake) -try_inc(cmake/core/PhysicsJolt/PhysicsJolt-config.cmake) -try_inc(cmake/core/Network/Network-config.cmake) -try_inc(cmake/core/Audio/Audio-config.cmake) - -try_inc(cmake/tools/ShaderCompilerTool/ShaderCompilerTool-config.cmake) +try_inc_lib(adlSdk cmake/3rdPartyLibs/adlSdk/adlSdk-config.cmake) +try_inc_lib(asio cmake/3rdPartyLibs/asio/asio-config.cmake) +try_inc_lib(brotli cmake/3rdPartyLibs/brotli/brotli-config.cmake) +try_inc_lib(dxc cmake/3rdPartyLibs/dxc/dxc-config.cmake) +try_inc_lib(EABase cmake/3rdPartyLibs/EABase/EABase-config.cmake) +try_inc_lib(EASTL cmake/3rdPartyLibs/EASTL/EASTL-config.cmake) +try_inc_lib(fast_float cmake/3rdPartyLibs/fast_float/fast_float-config.cmake) +try_inc_lib(fmt cmake/3rdPartyLibs/fmt/fmt-config.cmake) +try_inc_lib(gainput cmake/3rdPartyLibs/gainput/gainput-config.cmake) +try_inc_lib(imgui cmake/3rdPartyLibs/imgui/imgui-config.cmake) +try_inc_lib(ispc_texcomp cmake/3rdPartyLibs/ispc_texcomp/ispc_texcomp-config.cmake) +try_inc_lib(Jolt cmake/3rdPartyLibs/Jolt/Jolt-config.cmake) +try_inc_lib(json cmake/3rdPartyLibs/json/json-config.cmake) +try_inc_lib(jsoncpp cmake/3rdPartyLibs/jsoncpp/jsoncpp-config.cmake) +try_inc_lib(lua cmake/3rdPartyLibs/lua/lua-config.cmake) +try_inc_lib(lzma-9.20 cmake/3rdPartyLibs/lzma-9.20/lzma-9.20-config.cmake) +try_inc_lib(md5 cmake/3rdPartyLibs/md5/md5-config.cmake) +try_inc_lib(ozz_base cmake/3rdPartyLibs/ozz_base/ozz_base-config.cmake) +try_inc_lib(ozz_options cmake/3rdPartyLibs/ozz_options/ozz_options-config.cmake) +try_inc_lib(ozz_animation cmake/3rdPartyLibs/ozz_animation/ozz_animation-config.cmake) +try_inc_lib(ozz_animation_offline cmake/3rdPartyLibs/ozz_animation_offline/ozz_animation_offline-config.cmake) +try_inc_lib(ozz_animation_tools cmake/3rdPartyLibs/ozz_animation_tools/ozz_animation_tools-config.cmake) +try_inc_lib(ozz_geometry cmake/3rdPartyLibs/ozz_geometry/ozz_geometry-config.cmake) +try_inc_lib(RenderDoc cmake/3rdPartyLibs/RenderDoc/RenderDoc-config.cmake) +try_inc_lib(ska_hash_map cmake/3rdPartyLibs/ska_hash_map/ska_hash_map-config.cmake) +try_inc_lib(stb cmake/3rdPartyLibs/stb/stb-config.cmake) +try_inc_lib(tinydds cmake/3rdPartyLibs/tinydds/tinydds-config.cmake) +try_inc_lib(tinygltf cmake/3rdPartyLibs/tinygltf/tinygltf-config.cmake) +try_inc_lib(tinyimageformat cmake/3rdPartyLibs/tinyimageformat/tinyimageformat-config.cmake) +try_inc_lib(tinyutf8 cmake/3rdPartyLibs/tinyutf8/tinyutf8-config.cmake) +try_inc_lib(uriparser cmake/3rdPartyLibs/uriparser/uriparser-config.cmake) +try_inc_lib(utf8cpp cmake/3rdPartyLibs/utf8cpp/utf8cpp-config.cmake) +try_inc_lib(vectormath cmake/3rdPartyLibs/vectormath/vectormath-config.cmake) +try_inc_lib(wyhash cmake/3rdPartyLibs/wyhash/wyhash-config.cmake) +try_inc_lib(xxHash cmake/3rdPartyLibs/xxHash/xxHash-config.cmake) +try_inc_lib(zlib-ng cmake/3rdPartyLibs/zlib-ng/zlib-ng-config.cmake) +try_inc_lib(zstd-1.4.5 cmake/3rdPartyLibs/zstd-1.4.5/zstd-1.4.5-config.cmake) + +try_inc_lib(NauKernel cmake/core/NauKernel/NauKernel-config.cmake) +try_inc_lib(binPack2D cmake/3rdPartyLibs/binPack2D/binPack2D-config.cmake) + +#try_inc_lib(Tracy share/Tracy/TracyConfig.cmake) + +try_inc_lib(ext_clipper cmake/core/ext_clipper/ext_clipper-config.cmake) +try_inc_lib(ext_convertUTF cmake/core/ext_convertUTF/ext_convertUTF-config.cmake) +try_inc_lib(ext_edtaa3func cmake/core/ext_edtaa3func/ext_edtaa3func-config.cmake) +try_inc_lib(ext_poly2tri cmake/core/ext_poly2tri/ext_poly2tri-config.cmake) +try_inc_lib(ext_tinyxml2 cmake/core/ext_tinyxml2/ext_tinyxml2-config.cmake) +try_inc_lib(png cmake/core/png/png-config.cmake) +try_inc_lib(external cmake/core/external/external-config.cmake) +try_inc_lib(CoreAssetFormats cmake/core/CoreAssetFormats/CoreAssetFormats-config.cmake) +try_inc_lib(CoreAssets cmake/core/CoreAssets/CoreAssets-config.cmake) +try_inc_lib(CoreInput cmake/core/CoreInput/CoreInput-config.cmake) +try_inc_lib(CoreScene cmake/core/CoreScene/CoreScene-config.cmake) +try_inc_lib(Animation cmake/core/Animation/Animation-config.cmake) +try_inc_lib(PlatformAppApi cmake/core/PlatformAppApi/PlatformAppApi-config.cmake) +try_inc_lib(PlatformApp cmake/core/PlatformApp/PlatformApp-config.cmake) +try_inc_lib(Render cmake/core/Render/Render-config.cmake) +try_inc_lib(GraphicsAssets cmake/core/GraphicsAssets/GraphicsAssets-config.cmake) +try_inc_lib(Audio cmake/core/Audio/Audio-config.cmake) +try_inc_lib(cocos2d cmake/core/cocos2d/cocos2d-config.cmake) +try_inc_lib(DebugRenderer cmake/core/DebugRenderer/DebugRenderer-config.cmake) +try_inc_lib(Graphics cmake/core/Graphics/Graphics-config.cmake) +try_inc_lib(LuaToolkit cmake/core/LuaToolkit/LuaToolkit-config.cmake) +try_inc_lib(Network cmake/core/Network/Network-config.cmake) +try_inc_lib(Physics cmake/core/Physics/Physics-config.cmake) +try_inc_lib(PhysicsJolt cmake/core/PhysicsJolt/PhysicsJolt-config.cmake) +try_inc_lib(ScriptsLua cmake/core/ScriptsLua/ScriptsLua-config.cmake) +try_inc_lib(ui cmake/core/ui/ui-config.cmake) +try_inc_lib(VFX cmake/core/VFX/VFX-config.cmake) +try_inc_lib(NauFramework cmake/core/NauFramework/NauFramework-config.cmake) + +try_inc_lib(nlohmann_json cmake/tools/nlohmann_json/nlohmann_json-config.cmake) +try_inc_lib(Shared cmake/tools/Shared/Shared-config.cmake) +try_inc_lib(UsdHelpers cmake/tools/UsdHelpers/UsdHelpers-config.cmake) +try_inc_lib(UsdProxy cmake/tools/UsdProxy/UsdProxy-config.cmake) +try_inc_lib(UsdMetaTools cmake/tools/UsdMetaTools/UsdMetaTools-config.cmake) +try_inc_lib(AssetPackTool cmake/tools/AssetPackTool/AssetPackTool-config.cmake) +try_inc_lib(AssetTool cmake/tools/AssetTool/AssetTool-config.cmake) +try_inc_lib(BuildTool cmake/tools/BuildTool/BuildTool-config.cmake) +try_inc_exe(BuildToolCmd cmake/tools/BuildToolCmd/BuildToolCmd-config.cmake) +try_inc_exe(MaterialCreationTool cmake/tools/MaterialCreationTool/MaterialCreationTool-config.cmake) +try_inc_lib(ProjectTool cmake/tools/ProjectTool/ProjectTool-config.cmake) +try_inc_exe(ProjectToolCmd cmake/tools/ProjectToolCmd/ProjectToolCmd-config.cmake) +try_inc_exe(ShaderCompilerTool cmake/tools/ShaderCompilerTool/ShaderCompilerTool-config.cmake) + +try_inc_lib(NauAnimationClipAsset cmake/tools/plugins/NauAnimationClipAsset/NauAnimationClipAsset-config.cmake) +try_inc_lib(NauAssetMetadata cmake/tools/plugins/NauAssetMetadata/NauAssetMetadata-config.cmake) +try_inc_lib(NauAudioSchema cmake/tools/plugins/NauAudioSchema/NauAudioSchema-config.cmake) +try_inc_lib(NauComponentSchema cmake/tools/plugins/NauComponentSchema/NauComponentSchema-config.cmake) +try_inc_lib(NauGuiSchema cmake/tools/plugins/NauGuiSchema/NauGuiSchema-config.cmake) +try_inc_lib(NauInputSchema cmake/tools/plugins/NauInputSchema/NauInputSchema-config.cmake) +try_inc_lib(NauPhysicsSchema cmake/tools/plugins/NauPhysicsSchema/NauPhysicsSchema-config.cmake) +try_inc_lib(NauUsdFormat cmake/tools/plugins/NauUsdFormat/NauUsdFormat-config.cmake) +try_inc_lib(NauVFXSchema cmake/tools/plugins/NauVFXSchema/NauVFXSchema-config.cmake) +try_inc_lib(UsdUidLookup cmake/tools/plugins/UsdUidLookup/UsdUidLookup-config.cmake) + +try_inc_lib(UsdTranslator cmake/tools/UsdTranslator/UsdTranslator-config.cmake) +try_inc_lib(UsdTranslatorWrapper cmake/tools/plugins/UsdTranslatorWrapper/UsdTranslatorWrapper-config.cmake) + include(source/game/%%(ProjectName:no_space)%%.cmake) @@ -208,24 +298,12 @@ nau_target_link_modules(${TargetName} PhysicsJolt ) -add_custom_command(TARGET ${TargetName} PRE_BUILD - COMMAND ${CMAKE_COMMAND} - -DFileToCheck=${NauEngineFolder}/lib/$ - -P ${NauEngineFolder}/cmake/for_build/check.cmake - COMMENT "Checking if ${NauEngineFolder}/lib/$ exists...") - add_custom_command(TARGET ${TargetName} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory "${NauEngineFolder}/bin/$" $ ) -## add_custom_command(TARGET ${TargetName} POST_BUILD -## COMMAND ${CMAKE_COMMAND} -E copy -## "${NauEngineFolder}/bin/TracyClient.dll" -## $ -## ) - install(TARGETS ${TargetName} DESTINATION bin ) \ No newline at end of file diff --git a/project_templates/empty/CMakePresets.json b/project_templates/empty/CMakePresets.json index 08e40f19..71eac2e5 100644 --- a/project_templates/empty/CMakePresets.json +++ b/project_templates/empty/CMakePresets.json @@ -10,7 +10,6 @@ "CMAKE_EXPORT_COMPILE_COMMANDS": true, "CMAKE_SYSTEM_VERSION": "10.0", "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", - "NAU_BUILD_SDK": true, "BUILD_SHARED_LIBS": false, "EASTL_BUILD_BENCHMARK": false, "EASTL_BUILD_TESTS": false diff --git a/samples/sceneBase/CMakeLists.txt b/samples/sceneBase/CMakeLists.txt index 824d1653..040960ee 100644 --- a/samples/sceneBase/CMakeLists.txt +++ b/samples/sceneBase/CMakeLists.txt @@ -11,6 +11,7 @@ add_executable(${TargetName} ) target_link_libraries(${TargetName} PRIVATE + NauFramework SampleCommonLib Animation Physics diff --git a/tools/3rd_party/CMakeLists.txt b/tools/3rd_party/CMakeLists.txt index ae8a8062..50c5b3af 100644 --- a/tools/3rd_party/CMakeLists.txt +++ b/tools/3rd_party/CMakeLists.txt @@ -5,5 +5,14 @@ cmake_minimum_required (VERSION 3.8) set(CMAKE_CXX_STANDARD 20) +option(JSON_Install "" OFF) + add_subdirectory(json) -add_subdirectory(argparse) \ No newline at end of file +add_subdirectory(argparse) + +nau_collect_files(nlohmann_json_Headers + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/json/include/nlohmann + MASK "*.h" "*.hpp" +) +nau_install(nlohmann_json tools ${nlohmann_json_Headers}) \ No newline at end of file diff --git a/tools/asset_pack_tool/CMakeLists.txt b/tools/asset_pack_tool/CMakeLists.txt index 3531a7c7..983fbd8f 100644 --- a/tools/asset_pack_tool/CMakeLists.txt +++ b/tools/asset_pack_tool/CMakeLists.txt @@ -26,9 +26,12 @@ target_precompile_headers(${TargetName} PRIVATE src/pch.h) target_include_directories(${TargetName} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) -target_include_directories(${TargetName} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/${TargetName}/include> +) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX Source FILES ${Sources}) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include PREFIX Headers FILES ${PublicHeaders}) -install(TARGETS ${TargetName} DESTINATION bin/$ PUBLIC_HEADER DESTINATION include/${TargetName}) \ No newline at end of file +nau_install(${TargetName} tools ${PublicHeaders}) \ No newline at end of file diff --git a/tools/asset_tools/tool/CMakeLists.txt b/tools/asset_tools/tool/CMakeLists.txt index 35149b72..d5731685 100644 --- a/tools/asset_tools/tool/CMakeLists.txt +++ b/tools/asset_tools/tool/CMakeLists.txt @@ -1,13 +1,13 @@ set(TargetName AssetTool) nau_collect_files(Sources - ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR} + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} MASK "*.cpp" ) nau_collect_files(Headers - ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR} + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} MASK "*.h" ) @@ -66,6 +66,9 @@ add_dependencies(${TargetName} nau_add_compile_options(${TargetName}) -target_include_directories(${TargetName} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/${TargetName}/include> +) -install(TARGETS ${TargetName} DESTINATION bin/$ PUBLIC_HEADER DESTINATION include/${TargetName}) \ No newline at end of file +nau_install(${TargetName} tools ${Headers}) \ No newline at end of file diff --git a/tools/build_tools/cmd/CMakeLists.txt b/tools/build_tools/cmd/CMakeLists.txt index fa8d3816..cf3a44a6 100644 --- a/tools/build_tools/cmd/CMakeLists.txt +++ b/tools/build_tools/cmd/CMakeLists.txt @@ -39,6 +39,4 @@ endif() nau_add_compile_options(${TargetName}) -install(TARGETS ${TargetName} - DESTINATION bin/$ -) +nau_install(${TargetName} tools) diff --git a/tools/build_tools/tool/CMakeLists.txt b/tools/build_tools/tool/CMakeLists.txt index 032ab0ef..a9d2614e 100644 --- a/tools/build_tools/tool/CMakeLists.txt +++ b/tools/build_tools/tool/CMakeLists.txt @@ -63,7 +63,10 @@ nau_target_link_modules(${TargetName} nau_add_compile_options(${TargetName}) -target_include_directories(${TargetName} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/${TargetName}/include> +) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${Sources}) @@ -74,4 +77,4 @@ set(PUBLIC_HEADERS set_target_properties(${TargetName} PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") -install(TARGETS ${TargetName} DESTINATION bin/$ PUBLIC_HEADER DESTINATION include/${TargetName}) \ No newline at end of file +nau_install(${TargetName} tools ${PUBLIC_HEADERS}) \ No newline at end of file diff --git a/tools/material_creation_tool/CMakeLists.txt b/tools/material_creation_tool/CMakeLists.txt index e1f77c43..b2e609bb 100644 --- a/tools/material_creation_tool/CMakeLists.txt +++ b/tools/material_creation_tool/CMakeLists.txt @@ -23,3 +23,5 @@ source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${Sources}) set_target_properties(${TargetName} PROPERTIES FOLDER "${NauEngineFolder}/tools" ) + +nau_install(${TargetName} tools) \ No newline at end of file diff --git a/tools/project_tools/cmd/CMakeLists.txt b/tools/project_tools/cmd/CMakeLists.txt index ab922340..f364d9b7 100644 --- a/tools/project_tools/cmd/CMakeLists.txt +++ b/tools/project_tools/cmd/CMakeLists.txt @@ -34,6 +34,4 @@ endif() nau_add_compile_options(${TargetName}) -install(TARGETS ${TargetName} - DESTINATION bin/$ -) +nau_install(${TargetName} tools) diff --git a/tools/project_tools/tool/CMakeLists.txt b/tools/project_tools/tool/CMakeLists.txt index a6ea049b..b2dbcf0b 100644 --- a/tools/project_tools/tool/CMakeLists.txt +++ b/tools/project_tools/tool/CMakeLists.txt @@ -1,13 +1,13 @@ set(TargetName "ProjectTool") nau_collect_files(Sources - ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR} + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} MASK "*.cpp" ) nau_collect_files(Public - ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR} + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} MASK "*.h" ) @@ -32,14 +32,11 @@ set_target_properties( target_sources(${TargetName} PRIVATE ${Sources} ${Public}) target_link_libraries(${TargetName} PRIVATE nlohmann_json::nlohmann_json NauKernel Shared) -target_include_directories(${TargetName} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) - -set(PUBLIC_HEADERS - "include/nau/project_tools/project_api.h" - "include/nau/project_tools/project_info.h" +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/${TargetName}/include> ) -set_target_properties(${TargetName} PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") nau_add_compile_options(${TargetName}) -install(TARGETS ${TargetName} DESTINATION bin/$ PUBLIC_HEADER DESTINATION include/${TargetName}) \ No newline at end of file +nau_install(${TargetName} tools ${Public}) \ No newline at end of file diff --git a/tools/shared/CMakeLists.txt b/tools/shared/CMakeLists.txt index 1830e84f..b825b7da 100644 --- a/tools/shared/CMakeLists.txt +++ b/tools/shared/CMakeLists.txt @@ -1,13 +1,13 @@ set(TargetName Shared) nau_collect_files(Sources - ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR} + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} MASK "*.cpp" ) nau_collect_files(Headers - ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR} + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} MASK "*.h" ) @@ -31,23 +31,14 @@ target_link_libraries(${TargetName} PRIVATE nau_add_compile_options(${TargetName}) -target_include_directories(${TargetName} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/Shared/include> +) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${Sources}) set_target_properties(${TargetName} PROPERTIES FOLDER "${NauEngineFolder}/tools" ) -set(PUBLIC_HEADERS - "include/nau/shared/args.h" - "include/nau/shared/error_codes.h" - "include/nau/shared/file_system.h" - "include/nau/shared/logger.h" - "include/nau/shared/macro.h" - "include/nau/shared/util.h" - "include/nau/shared/version.h" -) - -set_target_properties(${TargetName} PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") - -install(TARGETS ${TargetName} DESTINATION bin/$ PUBLIC_HEADER DESTINATION include/${TargetName}) \ No newline at end of file +nau_install(${TargetName} tools ${Headers}) \ No newline at end of file diff --git a/tools/usd_tools/plugins/anim_schema/CMakeLists.txt b/tools/usd_tools/plugins/anim_schema/CMakeLists.txt index 9a4d955f..4e9e0615 100644 --- a/tools/usd_tools/plugins/anim_schema/CMakeLists.txt +++ b/tools/usd_tools/plugins/anim_schema/CMakeLists.txt @@ -16,9 +16,9 @@ cmake_path(GET CMAKE_CURRENT_SOURCE_DIR PARENT_PATH SOURCE_BASE_DIR) target_compile_definitions(${TargetName} PUBLIC NOMINMAX $<$:TBB_USE_DEBUG=0> ) target_link_options(${TargetName} PUBLIC $<$:${PXR_NODEFAULTLIBS}>) target_compile_definitions(${TargetName} PRIVATE NAUANIMATIONASSETLIB_EXPORTS) # exports from api.h -target_include_directories(${TargetName} - PUBLIC $ - PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/generated_src/schema_plugins" +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/plugins> ) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/Debug/plugins) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/Release/plugins) @@ -33,4 +33,13 @@ set(CONFIG_PLUGIN_PATH "$<$:${CMAKE_BINARY_DIR}/bin/Debug>$<$:TBB_USE_DEBUG=0> ) target_link_options(${TargetName} PUBLIC $<$:${PXR_NODEFAULTLIBS}>) target_compile_definitions(${TargetName} PRIVATE NAUASSETMETADATA_EXPORTS) -target_include_directories(${TargetName} PUBLIC $) +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/plugins> +) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/Debug/plugins) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/Release/plugins) @@ -49,4 +56,13 @@ set(CONFIG_PLUGIN_PATH "$<$:${CMAKE_BINARY_DIR}/bin/Debug>$<$:TBB_USE_DEBUG=0> ) target_link_options(${TargetName} PUBLIC $<$:${PXR_NODEFAULTLIBS}>) target_compile_definitions(${TargetName} PRIVATE TESTLIB_EXPORTS) -target_include_directories(${TargetName} PUBLIC $) +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/plugins> +) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/Debug/plugins) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/Release/plugins) @@ -34,4 +37,13 @@ set(CONFIG_PLUGIN_PATH "$<$:${CMAKE_BINARY_DIR}/bin/Debug>$<$:TBB_USE_DEBUG=0>) target_link_options(${TargetName} PUBLIC $<$:${PXR_NODEFAULTLIBS}>) target_compile_definitions(${TargetName} PRIVATE NAUCOMPONENTLIB_EXPORTS) -target_include_directories(${TargetName} PUBLIC $) +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/plugins> +) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/Debug/plugins) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/Release/plugins) @@ -40,3 +43,12 @@ add_custom_command(TARGET ${TargetName} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/generated_src/schema_plugins/nau/${TargetName}/plugInfo.json" "${CONFIG_PLUGIN_PATH}/plugins/${TargetName}/resources/plugInfo.json" COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/generated_src/schema_plugins/nau/${TargetName}/generatedSchema.usda" "${CONFIG_PLUGIN_PATH}/plugins/${TargetName}/resources/generatedSchema.usda" ) + +nau_collect_files(GenFilesHeaders + DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/generated_src/schema_plugins/nau/${TargetName} + ABSOLUTE ${CMAKE_CURRENT_BINARY_DIR}/generated_src/schema_plugins/nau/${TargetName} + MASK "*.h" +) + +nau_install(${TargetName} tools/plugins) +install(FILES ${GenFilesHeaders} DESTINATION "include/generated_src/schema_plugins/nau/${TargetName}") \ No newline at end of file diff --git a/tools/usd_tools/plugins/gui_schema/CMakeLists.txt b/tools/usd_tools/plugins/gui_schema/CMakeLists.txt index edb5bc8e..cca01f9d 100644 --- a/tools/usd_tools/plugins/gui_schema/CMakeLists.txt +++ b/tools/usd_tools/plugins/gui_schema/CMakeLists.txt @@ -16,9 +16,9 @@ cmake_path(GET CMAKE_CURRENT_SOURCE_DIR PARENT_PATH SOURCE_BASE_DIR) target_compile_definitions(${TargetName} PUBLIC NOMINMAX $<$:TBB_USE_DEBUG=0> ) target_link_options(${TargetName} PUBLIC $<$:${PXR_NODEFAULTLIBS}>) target_compile_definitions(${TargetName} PRIVATE TESTLIB_EXPORTS) -target_include_directories(${TargetName} PUBLIC -$ -${CMAKE_CURRENT_BINARY_DIR}/generated_src/schema_plugins +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/plugins> ) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/Debug/plugins) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/Release/plugins) @@ -38,3 +38,12 @@ add_custom_command(TARGET ${TargetName} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/generated_src/schema_plugins/nau/${TargetName}/plugInfo.json" "${CONFIG_PLUGIN_PATH}/plugins/${TargetName}/resources/plugInfo.json" COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/generated_src/schema_plugins/nau/${TargetName}/generatedSchema.usda" "${CONFIG_PLUGIN_PATH}/plugins/${TargetName}/resources/generatedSchema.usda" ) + +nau_collect_files(GenFilesHeaders + DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/generated_src/schema_plugins/nau/${TargetName} + ABSOLUTE ${CMAKE_CURRENT_BINARY_DIR}/generated_src/schema_plugins/nau/${TargetName} + MASK "*.h" +) + +nau_install(${TargetName} tools/plugins) +install(FILES ${GenFilesHeaders} DESTINATION "include/generated_src/schema_plugins/nau/${TargetName}") \ No newline at end of file diff --git a/tools/usd_tools/plugins/input_schema/CMakeLists.txt b/tools/usd_tools/plugins/input_schema/CMakeLists.txt index 1aa7c4cb..0e03b785 100644 --- a/tools/usd_tools/plugins/input_schema/CMakeLists.txt +++ b/tools/usd_tools/plugins/input_schema/CMakeLists.txt @@ -16,9 +16,9 @@ cmake_path(GET CMAKE_CURRENT_SOURCE_DIR PARENT_PATH SOURCE_BASE_DIR) target_compile_definitions(${TargetName} PUBLIC NOMINMAX $<$:TBB_USE_DEBUG=0> ) target_link_options(${TargetName} PUBLIC $<$:${PXR_NODEFAULTLIBS}>) target_compile_definitions(${TargetName} PRIVATE TESTLIB_EXPORTS) -target_include_directories(${TargetName} PUBLIC -$ -${CMAKE_CURRENT_BINARY_DIR}/generated_src/schema_plugins +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/plugins> ) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/Debug/plugins) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/Release/plugins) @@ -37,4 +37,13 @@ set(CONFIG_PLUGIN_PATH "$<$:${CMAKE_BINARY_DIR}/bin/Debug>$<$:TBB_USE_DEBUG=0> ) target_link_options(${TargetName} PUBLIC $<$:${PXR_NODEFAULTLIBS}>) target_compile_definitions(${TargetName} PRIVATE USD_FORMAT_EXPORT) -target_include_directories(${TargetName} PUBLIC $) +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/plugins> +) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/Debug/plugins) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/Release/plugins) @@ -45,4 +51,6 @@ set(CONFIG_PLUGIN_PATH "$<$:${CMAKE_BINARY_DIR}/bin/Debug>$<$:TBB_U target_link_options(${TargetName} PUBLIC $<$:${PXR_NODEFAULTLIBS}>) target_compile_definitions(${TargetName} PRIVATE TESTLIB_EXPORTS) target_include_directories(${TargetName} PUBLIC - $ - ${CMAKE_CURRENT_BINARY_DIR}/generated_src/schema_plugins - ) + $ + $/include/tools/plugins> +) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/Debug/plugins) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/Release/plugins) @@ -39,4 +39,13 @@ set(CONFIG_PLUGIN_PATH "$<$:${CMAKE_BINARY_DIR}/bin/Debug>$<$:TBB_USE_DEBUG=0> ) target_link_options(${TargetName} PUBLIC $<$:${PXR_NODEFAULTLIBS}>) target_compile_definitions(${TargetName} PRIVATE USD_TRANSLATOR_WRAPPER_EXPORT) -target_include_directories(${TargetName} PUBLIC $) +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/plugins> +) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/Debug) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/Release) target_compile_options(${TargetName} PRIVATE /Zc:preprocessor) @@ -30,3 +36,5 @@ target_link_libraries(${TargetName} add_dependencies(${TargetName} usd-plugins ) + +nau_install(${TargetName} tools/plugins ${Headers}) \ No newline at end of file diff --git a/tools/usd_tools/plugins/usd_uid_lookup/CMakeLists.txt b/tools/usd_tools/plugins/usd_uid_lookup/CMakeLists.txt index 509c75c8..1b3a6f5d 100644 --- a/tools/usd_tools/plugins/usd_uid_lookup/CMakeLists.txt +++ b/tools/usd_tools/plugins/usd_uid_lookup/CMakeLists.txt @@ -1,12 +1,15 @@ set(TargetName UsdUidLookup) -set(Sources - usd_uid_lookup.cpp +set(Headers usd_uid_lookup.h usd_uid_lookup_api.h ) -add_library(${TargetName} SHARED ${Sources}) +set(Sources + usd_uid_lookup.cpp +) + +add_library(${TargetName} SHARED ${Sources} ${Headers}) set(PLUG_INFO_ROOT "..") set(PLUG_INFO_RESOURCE_PATH "resources") @@ -16,7 +19,10 @@ cmake_path(GET CMAKE_CURRENT_SOURCE_DIR PARENT_PATH SOURCE_BASE_DIR) target_compile_definitions(${TargetName} PUBLIC NOMINMAX $<$:TBB_USE_DEBUG=0>) target_link_options(${TargetName} PUBLIC $<$:${PXR_NODEFAULTLIBS}>) target_compile_definitions(${TargetName} PRIVATE USD_UID_LOOKUP_EXPORT) -target_include_directories(${TargetName} PUBLIC $) +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/plugins> +) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/Debug/plugins) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/Release/plugins) @@ -45,3 +51,5 @@ add_custom_command(TARGET ${TargetName} POST_BUILD if (NAU_CORE_TESTS) #add_subdirectory(tests) endif() + +nau_install(${TargetName} tools/plugins ${Headers}) \ No newline at end of file diff --git a/tools/usd_tools/plugins/vfx_schema/CMakeLists.txt b/tools/usd_tools/plugins/vfx_schema/CMakeLists.txt index 3e560d74..2fcff734 100644 --- a/tools/usd_tools/plugins/vfx_schema/CMakeLists.txt +++ b/tools/usd_tools/plugins/vfx_schema/CMakeLists.txt @@ -16,9 +16,9 @@ cmake_path(GET CMAKE_CURRENT_SOURCE_DIR PARENT_PATH SOURCE_BASE_DIR) target_compile_definitions(${TargetName} PUBLIC NOMINMAX $<$:TBB_USE_DEBUG=0> ) target_link_options(${TargetName} PUBLIC $<$:${PXR_NODEFAULTLIBS}>) target_compile_definitions(${TargetName} PRIVATE TESTLIB_EXPORTS) -target_include_directories(${TargetName} PUBLIC -$ -${CMAKE_CURRENT_BINARY_DIR}/generated_src/schema_plugins +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/plugins> ) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/Debug/plugins) set_target_properties(${TargetName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/Release/plugins) @@ -37,4 +37,13 @@ set(CONFIG_PLUGIN_PATH "$<$:${CMAKE_BINARY_DIR}/bin/Debug>$<$:TBB_U target_link_options(${TargetName} PUBLIC $<$:${PXR_NODEFAULTLIBS}>) target_compile_definitions(${TargetName} PRIVATE USD_HELPERS_BUILD) target_include_directories(${TargetName} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) -target_include_directories(${TargetName} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/${TargetName}/include> +) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX Source FILES ${Sources}) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include PREFIX Headers FILES ${PublicHeaders}) @@ -40,3 +43,5 @@ target_link_libraries(${TargetName} PRIVATE if (NAU_CORE_TESTS) add_subdirectory(tests) endif() + +nau_install(${TargetName} tools ${PublicHeaders}) \ No newline at end of file diff --git a/tools/usd_tools/usd_meta_tools/CMakeLists.txt b/tools/usd_tools/usd_meta_tools/CMakeLists.txt index 5bdc5565..8e0f7533 100644 --- a/tools/usd_tools/usd_meta_tools/CMakeLists.txt +++ b/tools/usd_tools/usd_meta_tools/CMakeLists.txt @@ -1,13 +1,13 @@ set(TargetName UsdMetaTools) nau_collect_files(Sources - ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR} + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} MASK "*.cpp" ) nau_collect_files(Headers - ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR} + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} MASK "*.h" ) @@ -36,6 +36,9 @@ target_link_libraries(${TargetName} Shared NauKernel ) -target_include_directories(${TargetName} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) +target_include_directories(${TargetName} PUBLIC + $ + $/include/tools/${TargetName}/include> +) -install(TARGETS ${TargetName} DESTINATION bin/$ PUBLIC_HEADER DESTINATION include/${TargetName}) \ No newline at end of file +nau_install(${TargetName} tools ${Headers}) \ No newline at end of file diff --git a/tools/usd_tools/usd_proxy/CMakeLists.txt b/tools/usd_tools/usd_proxy/CMakeLists.txt index 6b58b388..a86b6e91 100644 --- a/tools/usd_tools/usd_proxy/CMakeLists.txt +++ b/tools/usd_tools/usd_proxy/CMakeLists.txt @@ -23,7 +23,10 @@ cmake_path(GET CMAKE_CURRENT_SOURCE_DIR PARENT_PATH SOURCE_BASE_DIR) target_compile_definitions(UsdProxy PUBLIC NOMINMAX $<$:TBB_USE_DEBUG=0> ) target_link_options(UsdProxy PUBLIC $<$:${PXR_NODEFAULTLIBS}>) target_compile_definitions(UsdProxy PRIVATE USD_PROXY_EXPORT) -target_include_directories(UsdProxy PUBLIC $) +target_include_directories(UsdProxy PUBLIC + $ + $/include/tools> +) target_link_libraries(UsdProxy usd @@ -40,3 +43,13 @@ endif() # COMMAND ${CMAKE_COMMAND} -E copy_directory ${PXR_LIB_DIR}/$ ${CMAKE_BINARY_DIR}/bin/$ # COMMAND ${CMAKE_COMMAND} -E copy ${PXR_CMAKE_DIR}/Python/python310.dll ${PXR_LIB_DIR}/boost_python310-vc143-mt-x64-1_85.dll ${PXR_LIB_DIR}/boost_python310-vc143-mt-gd-x64-1_85.dll ${PXR_CMAKE_DIR}/bin/tbb.dll ${CMAKE_BINARY_DIR}/bin/$ #) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ + DESTINATION ${CMAKE_INSTALL_PREFIX}/include/tools/usd_proxy + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hpp" + PATTERN "*.ipp" +) + +nau_install(UsdProxy tools) \ No newline at end of file diff --git a/tools/usd_tools/usd_translator/CMakeLists.txt b/tools/usd_tools/usd_translator/CMakeLists.txt index 1b3364e1..468cf646 100644 --- a/tools/usd_tools/usd_translator/CMakeLists.txt +++ b/tools/usd_tools/usd_translator/CMakeLists.txt @@ -79,7 +79,9 @@ target_compile_definitions(${TargetName} PUBLIC NOMINMAX $<$:TBB_ target_link_options(${TargetName} PUBLIC $<$:${PXR_NODEFAULTLIBS}>) target_compile_definitions(${TargetName} PRIVATE USD_TRANSLATOR_EXPORT) target_include_directories(${TargetName} - PUBLIC $ + PUBLIC + $ + $/include/tools> PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../plugin/animation_clip/generated_src/schema_plugins" ) @@ -126,3 +128,13 @@ set_target_properties (${TargetName} PROPERTIES if (NAU_CORE_TESTS) add_subdirectory(tests) endif() + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ + DESTINATION ${CMAKE_INSTALL_PREFIX}/include/tools/usd_translator + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hpp" + PATTERN "*.ipp" +) + +nau_install(${TargetName} tools) \ No newline at end of file From a26a87d94b833f4480a317ecea8a4959a9f66167 Mon Sep 17 00:00:00 2001 From: GrosSlava <> Date: Thu, 5 Dec 2024 23:46:41 +0300 Subject: [PATCH 2/2] BuildSystem fix: fix installer, fix nau libs importing fix installer: eliminate build core twice fix libraries importing in user cmake small fixes for third-party libs exporting works only with dll preset. --- CMakeLists.txt | 13 +- cmake/for_build/CMakeLists.txt | 203 ------------------ cmake/for_build/CMakePresets.json | 95 -------- cmake/for_build/NauEngineSDK.cmake | 187 ++++++++++++++++ cmake/for_build/run_install.bat | 38 ---- cmake/platformSpec/NauMicrosoft.cmake | 1 + .../libpng-libpng16/CMakeLists.txt | 8 +- engine/3rdparty_libs/miniaudio/CMakeLists.txt | 11 +- .../ui/cocos2d-x/external/CMakeLists.txt | 10 +- .../external/ConvertUTF/CMakeLists.txt | 2 +- .../cocos2d-x/external/clipper/CMakeLists.txt | 2 +- .../external/edtaa3func/CMakeLists.txt | 2 +- .../external/poly2tri/CMakeLists.txt | 2 +- .../external/tinyxml2/CMakeLists.txt | 2 +- project_templates/empty/CMakeLists.txt | 162 +------------- tools/3rd_party/CMakeLists.txt | 7 +- tools/3rd_party/nlohmann_json-config.cmake | 108 ++++++++++ 17 files changed, 333 insertions(+), 520 deletions(-) delete mode 100644 cmake/for_build/CMakeLists.txt delete mode 100644 cmake/for_build/CMakePresets.json create mode 100644 cmake/for_build/NauEngineSDK.cmake delete mode 100644 cmake/for_build/run_install.bat create mode 100644 tools/3rd_party/nlohmann_json-config.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d914997..e7e20333 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,7 @@ endif() if (NOT DEFINED CMAKE_TOOLCHAIN_FILE) message(FATAL_ERROR "Toolchain not selected! Please define -DCMAKE_TOOLCHAIN_FILE") else() + cmake_path(SET CMAKE_TOOLCHAIN_FILE NORMALIZE "${CMAKE_TOOLCHAIN_FILE}") message(STATUS "Toolchain file: ${CMAKE_TOOLCHAIN_FILE}") endif() @@ -106,12 +107,7 @@ include(NauCommon) include(NauModule) include(NauGenFunctions) include(platformSpec/NauPlatformSetup) -if (BUILD_SHARED_LIBS) - message(STATUS "Adding UsdPackages") - include(UsdPackages) -else() - message(STATUS "Skipping UsdPackages") -endif() +include(UsdPackages) include(CTest) include(cmake/NauGitVersion.cmake) @@ -134,12 +130,13 @@ nau_generate_es_targets() # Install -foreach(_folder cmake/defaults cmake/platformSpec) +foreach(_folder cmake/defaults cmake/platformSpec cmake/_scripts) install(DIRECTORY ${_folder} DESTINATION ${CMAKE_INSTALL_PREFIX}/cmake FILES_MATCHING PATTERN "*.cmake" PATTERN "*.bat" + PATTERN "*.py" ) endforeach() install(FILES @@ -157,7 +154,7 @@ install(DIRECTORY project_templates DESTINATION ${CMAKE_INSTALL_PREFIX} ) -install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/$/plugins) +install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/$/plugins) # always create plugins folder install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/$/plugins/ DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/$/plugins OPTIONAL diff --git a/cmake/for_build/CMakeLists.txt b/cmake/for_build/CMakeLists.txt deleted file mode 100644 index 987b8715..00000000 --- a/cmake/for_build/CMakeLists.txt +++ /dev/null @@ -1,203 +0,0 @@ -# CMakeList.txt : Top-level CMake project file, do global configuration -# and include sub-projects here. -# -cmake_minimum_required (VERSION 3.20) - -project(NauEngineSDK) - - -# TODO: set enviroment variables for other platforms -if (WIN32) - execute_process( COMMAND "${CMAKE_SOURCE_DIR}/cmake/platformSpec/set_env.bat") -endif(WIN32) - -if (POLICY CMP0091) - cmake_policy(SET CMP0091 NEW) -endif() - -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - ${CMAKE_CURRENT_SOURCE_DIR}/cmake - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/defaults -) - - -# Compiler config -set(CMAKE_CXX_STANDARD 20) -# TODO: define C standard - -# Enable Hot Reload for MSVC compilers if supported. -if (POLICY CMP0141) - cmake_policy(SET CMP0141 NEW) - set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") -endif() - - -# Global config -if (NOT DEFINED NauEngineFolder) - set(NauEngineFolder "NauEngineSDK") -endif() - -set(NauSDKIncludes ${CMAKE_CURRENT_SOURCE_DIR}/include) -set(NauSDKLibraries ${CMAKE_CURRENT_SOURCE_DIR}/lib) - - -file(GLOB DLLS "${CMAKE_CURRENT_SOURCE_DIR}/bin/*.dll") -if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/bin/Debug) - file(COPY ${DLLS} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin/Debug) -endif() -if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/bin/Release) - file(COPY ${DLLS} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin/Release) -endif() - - -function(try_inc_lib target cmakeName) - if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${cmakeName}) - message(STATUS "include ${cmakeName} from NAU sdk") - include(${CMAKE_CURRENT_SOURCE_DIR}/${cmakeName}) - if (BUILD_SHARED_LIBS) - set_target_properties(${target} PROPERTIES - IMPORTED_LOCATION_Debug "${CMAKE_CURRENT_SOURCE_DIR}/bin/Debug/${target}.dll" - IMPORTED_LOCATION_Release "${CMAKE_CURRENT_SOURCE_DIR}/bin/Release/${target}.dll" - IMPORTED_IMPLIB_Debug "${CMAKE_CURRENT_SOURCE_DIR}/lib/Debug/${target}.lib" - IMPORTED_IMPLIB_Release "${CMAKE_CURRENT_SOURCE_DIR}/lib/Release/${target}.lib" - IMPORTED_GLOBAL TRUE - ) - else() - set_target_properties(${target} PROPERTIES - IMPORTED_LOCATION_Debug "${CMAKE_CURRENT_SOURCE_DIR}/bin/Debug/${target}.lib" - IMPORTED_LOCATION_Release "${CMAKE_CURRENT_SOURCE_DIR}/bin/Release/${target}.lib" - IMPORTED_GLOBAL TRUE - ) - endif() - endif() -endfunction() - -function(try_inc_exe target cmakeName) - if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${cmakeName}) - message(STATUS "include ${cmakeName} from NAU sdk") - include(${CMAKE_CURRENT_SOURCE_DIR}/${cmakeName}) - set_target_properties(${target} PROPERTIES - IMPORTED_LOCATION_Debug "${CMAKE_CURRENT_SOURCE_DIR}/bin/Debug/${target}.exe" - IMPORTED_LOCATION_Release "${CMAKE_CURRENT_SOURCE_DIR}/bin/Release/${target}.exe" - IMPORTED_GLOBAL TRUE - ) - endif() -endfunction() - -function(try_add subdir) - if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}) - message(STATUS "add ${subdir} from NAU sdk") - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${subdir}) - endif() -endfunction() - -try_inc_lib(adlSdk cmake/3rdPartyLibs/adlSdk/adlSdk-config.cmake) -try_inc_lib(asio cmake/3rdPartyLibs/asio/asio-config.cmake) -try_inc_lib(brotli cmake/3rdPartyLibs/brotli/brotli-config.cmake) -try_inc_lib(dxc cmake/3rdPartyLibs/dxc/dxc-config.cmake) -try_inc_lib(EABase cmake/3rdPartyLibs/EABase/EABase-config.cmake) -try_inc_lib(EASTL cmake/3rdPartyLibs/EASTL/EASTL-config.cmake) -try_inc_lib(fast_float cmake/3rdPartyLibs/fast_float/fast_float-config.cmake) -try_inc_lib(fmt cmake/3rdPartyLibs/fmt/fmt-config.cmake) -try_inc_lib(gainput cmake/3rdPartyLibs/gainput/gainput-config.cmake) -try_inc_lib(imgui cmake/3rdPartyLibs/imgui/imgui-config.cmake) -try_inc_lib(ispc_texcomp cmake/3rdPartyLibs/ispc_texcomp/ispc_texcomp-config.cmake) -try_inc_lib(Jolt cmake/3rdPartyLibs/Jolt/Jolt-config.cmake) -try_inc_lib(json cmake/3rdPartyLibs/json/json-config.cmake) -try_inc_lib(jsoncpp cmake/3rdPartyLibs/jsoncpp/jsoncpp-config.cmake) -try_inc_lib(lua cmake/3rdPartyLibs/lua/lua-config.cmake) -try_inc_lib(lzma-9.20 cmake/3rdPartyLibs/lzma-9.20/lzma-9.20-config.cmake) -try_inc_lib(md5 cmake/3rdPartyLibs/md5/md5-config.cmake) -try_inc_lib(ozz_base cmake/3rdPartyLibs/ozz_base/ozz_base-config.cmake) -try_inc_lib(ozz_options cmake/3rdPartyLibs/ozz_options/ozz_options-config.cmake) -try_inc_lib(ozz_animation cmake/3rdPartyLibs/ozz_animation/ozz_animation-config.cmake) -try_inc_lib(ozz_animation_offline cmake/3rdPartyLibs/ozz_animation_offline/ozz_animation_offline-config.cmake) -try_inc_lib(ozz_animation_tools cmake/3rdPartyLibs/ozz_animation_tools/ozz_animation_tools-config.cmake) -try_inc_lib(ozz_geometry cmake/3rdPartyLibs/ozz_geometry/ozz_geometry-config.cmake) -try_inc_lib(RenderDoc cmake/3rdPartyLibs/RenderDoc/RenderDoc-config.cmake) -try_inc_lib(ska_hash_map cmake/3rdPartyLibs/ska_hash_map/ska_hash_map-config.cmake) -try_inc_lib(stb cmake/3rdPartyLibs/stb/stb-config.cmake) -try_inc_lib(tinydds cmake/3rdPartyLibs/tinydds/tinydds-config.cmake) -try_inc_lib(tinygltf cmake/3rdPartyLibs/tinygltf/tinygltf-config.cmake) -try_inc_lib(tinyimageformat cmake/3rdPartyLibs/tinyimageformat/tinyimageformat-config.cmake) -try_inc_lib(tinyutf8 cmake/3rdPartyLibs/tinyutf8/tinyutf8-config.cmake) -try_inc_lib(uriparser cmake/3rdPartyLibs/uriparser/uriparser-config.cmake) -try_inc_lib(utf8cpp cmake/3rdPartyLibs/utf8cpp/utf8cpp-config.cmake) -try_inc_lib(vectormath cmake/3rdPartyLibs/vectormath/vectormath-config.cmake) -try_inc_lib(wyhash cmake/3rdPartyLibs/wyhash/wyhash-config.cmake) -try_inc_lib(xxHash cmake/3rdPartyLibs/xxHash/xxHash-config.cmake) -try_inc_lib(zlib-ng cmake/3rdPartyLibs/zlib-ng/zlib-ng-config.cmake) -try_inc_lib(zstd-1.4.5 cmake/3rdPartyLibs/zstd-1.4.5/zstd-1.4.5-config.cmake) - -try_inc_lib(NauKernel cmake/core/NauKernel/NauKernel-config.cmake) -try_inc_lib(binPack2D cmake/3rdPartyLibs/binPack2D/binPack2D-config.cmake) - -#try_inc_lib(Tracy share/Tracy/TracyConfig.cmake) - -try_inc_lib(ext_clipper cmake/core/ext_clipper/ext_clipper-config.cmake) -try_inc_lib(ext_convertUTF cmake/core/ext_convertUTF/ext_convertUTF-config.cmake) -try_inc_lib(ext_edtaa3func cmake/core/ext_edtaa3func/ext_edtaa3func-config.cmake) -try_inc_lib(ext_poly2tri cmake/core/ext_poly2tri/ext_poly2tri-config.cmake) -try_inc_lib(ext_tinyxml2 cmake/core/ext_tinyxml2/ext_tinyxml2-config.cmake) -try_inc_lib(png cmake/core/png/png-config.cmake) -try_inc_lib(external cmake/core/external/external-config.cmake) -try_inc_lib(CoreAssetFormats cmake/core/CoreAssetFormats/CoreAssetFormats-config.cmake) -try_inc_lib(CoreAssets cmake/core/CoreAssets/CoreAssets-config.cmake) -try_inc_lib(CoreInput cmake/core/CoreInput/CoreInput-config.cmake) -try_inc_lib(CoreScene cmake/core/CoreScene/CoreScene-config.cmake) -try_inc_lib(Animation cmake/core/Animation/Animation-config.cmake) -try_inc_lib(PlatformAppApi cmake/core/PlatformAppApi/PlatformAppApi-config.cmake) -try_inc_lib(PlatformApp cmake/core/PlatformApp/PlatformApp-config.cmake) -try_inc_lib(Render cmake/core/Render/Render-config.cmake) -try_inc_lib(GraphicsAssets cmake/core/GraphicsAssets/GraphicsAssets-config.cmake) -try_inc_lib(Audio cmake/core/Audio/Audio-config.cmake) -try_inc_lib(cocos2d cmake/core/cocos2d/cocos2d-config.cmake) -try_inc_lib(DebugRenderer cmake/core/DebugRenderer/DebugRenderer-config.cmake) -try_inc_lib(Graphics cmake/core/Graphics/Graphics-config.cmake) -try_inc_lib(LuaToolkit cmake/core/LuaToolkit/LuaToolkit-config.cmake) -try_inc_lib(Network cmake/core/Network/Network-config.cmake) -try_inc_lib(Physics cmake/core/Physics/Physics-config.cmake) -try_inc_lib(PhysicsJolt cmake/core/PhysicsJolt/PhysicsJolt-config.cmake) -try_inc_lib(ScriptsLua cmake/core/ScriptsLua/ScriptsLua-config.cmake) -try_inc_lib(ui cmake/core/ui/ui-config.cmake) -try_inc_lib(VFX cmake/core/VFX/VFX-config.cmake) -try_inc_lib(NauFramework cmake/core/NauFramework/NauFramework-config.cmake) - -try_inc_lib(nlohmann_json cmake/tools/nlohmann_json/nlohmann_json-config.cmake) -try_inc_lib(Shared cmake/tools/Shared/Shared-config.cmake) -try_inc_lib(UsdHelpers cmake/tools/UsdHelpers/UsdHelpers-config.cmake) -try_inc_lib(UsdProxy cmake/tools/UsdProxy/UsdProxy-config.cmake) -try_inc_lib(UsdMetaTools cmake/tools/UsdMetaTools/UsdMetaTools-config.cmake) -try_inc_lib(AssetPackTool cmake/tools/AssetPackTool/AssetPackTool-config.cmake) -try_inc_lib(AssetTool cmake/tools/AssetTool/AssetTool-config.cmake) -try_inc_lib(BuildTool cmake/tools/BuildTool/BuildTool-config.cmake) -try_inc_exe(BuildToolCmd cmake/tools/BuildToolCmd/BuildToolCmd-config.cmake) -try_inc_exe(MaterialCreationTool cmake/tools/MaterialCreationTool/MaterialCreationTool-config.cmake) -try_inc_lib(ProjectTool cmake/tools/ProjectTool/ProjectTool-config.cmake) -try_inc_exe(ProjectToolCmd cmake/tools/ProjectToolCmd/ProjectToolCmd-config.cmake) -try_inc_exe(ShaderCompilerTool cmake/tools/ShaderCompilerTool/ShaderCompilerTool-config.cmake) - -try_inc_lib(NauAnimationClipAsset cmake/tools/plugins/NauAnimationClipAsset/NauAnimationClipAsset-config.cmake) -try_inc_lib(NauAssetMetadata cmake/tools/plugins/NauAssetMetadata/NauAssetMetadata-config.cmake) -try_inc_lib(NauAudioSchema cmake/tools/plugins/NauAudioSchema/NauAudioSchema-config.cmake) -try_inc_lib(NauComponentSchema cmake/tools/plugins/NauComponentSchema/NauComponentSchema-config.cmake) -try_inc_lib(NauGuiSchema cmake/tools/plugins/NauGuiSchema/NauGuiSchema-config.cmake) -try_inc_lib(NauInputSchema cmake/tools/plugins/NauInputSchema/NauInputSchema-config.cmake) -try_inc_lib(NauPhysicsSchema cmake/tools/plugins/NauPhysicsSchema/NauPhysicsSchema-config.cmake) -try_inc_lib(NauUsdFormat cmake/tools/plugins/NauUsdFormat/NauUsdFormat-config.cmake) -try_inc_lib(NauVFXSchema cmake/tools/plugins/NauVFXSchema/NauVFXSchema-config.cmake) -try_inc_lib(UsdUidLookup cmake/tools/plugins/UsdUidLookup/UsdUidLookup-config.cmake) - -try_inc_lib(UsdTranslator cmake/tools/UsdTranslator/UsdTranslator-config.cmake) -try_inc_lib(UsdTranslatorWrapper cmake/tools/plugins/UsdTranslatorWrapper/UsdTranslatorWrapper-config.cmake) - -try_add(samples/sample_common) -try_add(samples/all3rdpartyBuild) -try_add(samples/inputDemo) -try_add(samples/kernelBuild) -try_add(samples/minimalApp) -try_add(samples/networkTransport) -try_add(samples/physics) -try_add(samples/sceneBase) -try_add(samples/ui-cpp-tests) -try_add(samples/uiSampleApp) diff --git a/cmake/for_build/CMakePresets.json b/cmake/for_build/CMakePresets.json deleted file mode 100644 index 71eac2e5..00000000 --- a/cmake/for_build/CMakePresets.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "version": 5, - "configurePresets": [ - { - "name": "config_base", - "hidden": true, - "binaryDir": "${sourceDir}/build/${presetName}", - "installDir": "${sourceDir}/dist/${presetName}", - "cacheVariables": { - "CMAKE_EXPORT_COMPILE_COMMANDS": true, - "CMAKE_SYSTEM_VERSION": "10.0", - "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", - "BUILD_SHARED_LIBS": false, - "EASTL_BUILD_BENCHMARK": false, - "EASTL_BUILD_TESTS": false - } - }, - - { - "name": "vs_2022_base", - "hidden": true, - "generator": "Visual Studio 17 2022", - "cacheVariables": { - "CMAKE_CONFIGURATION_TYPES": "Debug;Release" - }, - - "vendor": { - "microsoft.com/VisualStudioSettings/CMake/1.0": { - "hostOS": ["Windows"], - "intelliSenseMode": "windows-msvc-x64" - } - } - }, - - { - "name": "win_vs2022_x64_base", - "inherits": ["config_base", "vs_2022_base"], - "hidden": true, - "toolset": { - "strategy": "set", - "value": "v143,host=x64" - }, - "architecture": { - "strategy": "set", - "value": "x64" - } - }, - - - { - "name": "win_vs2022_x64", - "inherits": ["win_vs2022_x64_base"], - "displayName": "Visual Studio 2022 x64", - "description": "Configure for Visual Studio 17 2022", - "hidden": false - }, - { - "name": "win_vs2022_x64_dll", - "inherits": ["config_base", "vs_2022_base"], - "displayName": "Visual Studio 2022 x64, DLL", - "description": "Dll configure for Visual Studio 17 2022", - "hidden": false, - "cacheVariables": { - "BUILD_SHARED_LIBS": true - } - } - - ], - "buildPresets": [ - { - "name": "VS Debug", - "displayName": "Visual Studio Community 2022 x64 Debug", - "configurePreset": "win_vs2022_x64", - "configuration": "Debug" - }, - { - "name": "VS Debug Dll", - "displayName": "Visual Studio Community 2022 x64 Debug Dll", - "configurePreset": "win_vs2022_x64_dll", - "configuration": "Debug" - }, - { - "name": "VS Release", - "displayName": "Visual Studio Community 2022 x64 Release", - "configurePreset": "win_vs2022_x64", - "configuration": "Release" - }, - { - "name": "VS Release Dll", - "displayName": "Visual Studio Community 2022 x64 Release", - "configurePreset": "win_vs2022_x64_dll", - "configuration": "Release" - } - ] -} diff --git a/cmake/for_build/NauEngineSDK.cmake b/cmake/for_build/NauEngineSDK.cmake new file mode 100644 index 00000000..14bece59 --- /dev/null +++ b/cmake/for_build/NauEngineSDK.cmake @@ -0,0 +1,187 @@ + +# TODO: set enviroment variables for other platforms +if (WIN32) + execute_process( COMMAND "${CMAKE_SOURCE_DIR}/cmake/platformSpec/set_env.bat") +endif(WIN32) + +if (POLICY CMP0091) + cmake_policy(SET CMP0091 NEW) +endif() + +if (NOT DEFINED NauEngineFolder) + message(FATAL_ERROR "NauEngineSDK: NauEngineFolder not defined!") +endif() + +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} + "${NauEngineFolder}/cmake" + "${NauEngineFolder}/cmake/defaults" + "${NauEngineFolder}/cmake/for_build" +) + +# Enable Hot Reload for MSVC compilers if supported. +if (POLICY CMP0141) + cmake_policy(SET CMP0141 NEW) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") +endif() + +set(NauSDKIncludes ${NauEngineFolder}/include) +set(NauSDKLibraries ${NauEngineFolder}/lib) + + +function(nau_try_inc_lib target cmakeName) + if (EXISTS ${NauEngineFolder}/${cmakeName}) + message(STATUS "include ${cmakeName} from NAU sdk") + include(${NauEngineFolder}/${cmakeName}) + get_target_property(targetType ${target} TYPE) + if (NOT ${targetType} STREQUAL "INTERFACE_LIBRARY") + if (BUILD_SHARED_LIBS) + set_target_properties(${target} PROPERTIES + IMPORTED_LOCATION_Debug "${NauEngineFolder}/bin/Debug/${target}.dll" + IMPORTED_LOCATION_Release "${NauEngineFolder}/bin/Release/${target}.dll" + IMPORTED_IMPLIB_Debug "${NauEngineFolder}/lib/Debug/${target}.lib" + IMPORTED_IMPLIB_Release "${NauEngineFolder}/lib/Release/${target}.lib" + IMPORTED_GLOBAL TRUE + ) + else() + set_target_properties(${target} PROPERTIES + IMPORTED_LOCATION_Debug "${NauEngineFolder}/bin/Debug/${target}.lib" + IMPORTED_LOCATION_Release "${NauEngineFolder}/bin/Release/${target}.lib" + IMPORTED_GLOBAL TRUE + ) + endif() + endif() + endif() +endfunction() + +function(nau_try_inc_exe target cmakeName) + if (EXISTS ${NauEngineFolder}/${cmakeName}) + message(STATUS "include ${cmakeName} from NAU sdk") + include(${NauEngineFolder}/${cmakeName}) + set_target_properties(${target} PROPERTIES + IMPORTED_LOCATION_Debug "${NauEngineFolder}/bin/Debug/${target}.exe" + IMPORTED_LOCATION_Release "${NauEngineFolder}/bin/Release/${target}.exe" + IMPORTED_GLOBAL TRUE + ) + endif() +endfunction() + +function(nau_try_add_sample target subdir) + if (EXISTS ${NauEngineFolder}/${subdir}) + message(STATUS "add ${subdir} from NAU sdk") + add_subdirectory(${NauEngineFolder}/${subdir} "samples/${target}") + endif() +endfunction() + +nau_try_inc_lib(adlSdk cmake/3rdPartyLibs/adlSdk/adlSdk-config.cmake) +nau_try_inc_lib(asio cmake/3rdPartyLibs/asio/asio-config.cmake) +nau_try_inc_lib(brotli cmake/3rdPartyLibs/brotli/brotli-config.cmake) +nau_try_inc_lib(dxc cmake/3rdPartyLibs/dxc/dxc-config.cmake) +nau_try_inc_lib(EABase cmake/3rdPartyLibs/EABase/EABase-config.cmake) +nau_try_inc_lib(EASTL cmake/3rdPartyLibs/EASTL/EASTL-config.cmake) +nau_try_inc_lib(fast_float cmake/3rdPartyLibs/fast_float/fast_float-config.cmake) +nau_try_inc_lib(fmt cmake/3rdPartyLibs/fmt/fmt-config.cmake) +nau_try_inc_lib(gainput cmake/3rdPartyLibs/gainput/gainput-config.cmake) +nau_try_inc_lib(imgui cmake/3rdPartyLibs/imgui/imgui-config.cmake) +nau_try_inc_lib(ispc_texcomp cmake/3rdPartyLibs/ispc_texcomp/ispc_texcomp-config.cmake) +nau_try_inc_lib(Jolt cmake/3rdPartyLibs/Jolt/Jolt-config.cmake) +nau_try_inc_lib(json cmake/3rdPartyLibs/json/json-config.cmake) +nau_try_inc_lib(jsoncpp cmake/3rdPartyLibs/jsoncpp/jsoncpp-config.cmake) +nau_try_inc_lib(lua cmake/3rdPartyLibs/lua/lua-config.cmake) +nau_try_inc_lib(lzma-9.20 cmake/3rdPartyLibs/lzma-9.20/lzma-9.20-config.cmake) +nau_try_inc_lib(md5 cmake/3rdPartyLibs/md5/md5-config.cmake) +nau_try_inc_lib(miniaudio cmake/3rdPartyLibs/miniaudio/miniaudio-config.cmake) +nau_try_inc_lib(ozz_base cmake/3rdPartyLibs/ozz_base/ozz_base-config.cmake) +nau_try_inc_lib(ozz_options cmake/3rdPartyLibs/ozz_options/ozz_options-config.cmake) +nau_try_inc_lib(ozz_animation cmake/3rdPartyLibs/ozz_animation/ozz_animation-config.cmake) +nau_try_inc_lib(ozz_animation_offline cmake/3rdPartyLibs/ozz_animation_offline/ozz_animation_offline-config.cmake) +nau_try_inc_lib(ozz_animation_tools cmake/3rdPartyLibs/ozz_animation_tools/ozz_animation_tools-config.cmake) +nau_try_inc_lib(ozz_geomenau_try cmake/3rdPartyLibs/ozz_geomenau_try/ozz_geomenau_try-config.cmake) +nau_try_inc_lib(RenderDoc cmake/3rdPartyLibs/RenderDoc/RenderDoc-config.cmake) +nau_try_inc_lib(ska_hash_map cmake/3rdPartyLibs/ska_hash_map/ska_hash_map-config.cmake) +nau_try_inc_lib(stb cmake/3rdPartyLibs/stb/stb-config.cmake) +nau_try_inc_lib(tinydds cmake/3rdPartyLibs/tinydds/tinydds-config.cmake) +nau_try_inc_lib(tinygltf cmake/3rdPartyLibs/tinygltf/tinygltf-config.cmake) +nau_try_inc_lib(tinyimageformat cmake/3rdPartyLibs/tinyimageformat/tinyimageformat-config.cmake) +nau_try_inc_lib(tinyutf8 cmake/3rdPartyLibs/tinyutf8/tinyutf8-config.cmake) +nau_try_inc_lib(uriparser cmake/3rdPartyLibs/uriparser/uriparser-config.cmake) +nau_try_inc_lib(utf8cpp cmake/3rdPartyLibs/utf8cpp/utf8cpp-config.cmake) +nau_try_inc_lib(vectormath cmake/3rdPartyLibs/vectormath/vectormath-config.cmake) +nau_try_inc_lib(wyhash cmake/3rdPartyLibs/wyhash/wyhash-config.cmake) +nau_try_inc_lib(xxHash cmake/3rdPartyLibs/xxHash/xxHash-config.cmake) +nau_try_inc_lib(zlib-ng cmake/3rdPartyLibs/zlib-ng/zlib-ng-config.cmake) +nau_try_inc_lib(zstd-1.4.5 cmake/3rdPartyLibs/zstd-1.4.5/zstd-1.4.5-config.cmake) + +nau_try_inc_lib(NauKernel cmake/core/NauKernel/NauKernel-config.cmake) +nau_try_inc_lib(binPack2D cmake/3rdPartyLibs/binPack2D/binPack2D-config.cmake) + +#nau_try_inc_lib(Tracy share/Tracy/TracyConfig.cmake) + +nau_try_inc_lib(ext_clipper cmake/core/ext_clipper/ext_clipper-config.cmake) +nau_try_inc_lib(ext_convertUTF cmake/core/ext_convertUTF/ext_convertUTF-config.cmake) +nau_try_inc_lib(ext_edtaa3func cmake/core/ext_edtaa3func/ext_edtaa3func-config.cmake) +nau_try_inc_lib(ext_poly2tri cmake/core/ext_poly2tri/ext_poly2tri-config.cmake) +nau_try_inc_lib(ext_tinyxml2 cmake/core/ext_tinyxml2/ext_tinyxml2-config.cmake) +nau_try_inc_lib(png cmake/core/png/png-config.cmake) +nau_try_inc_lib(external cmake/core/external/external-config.cmake) +nau_try_inc_lib(PlatformAppApi cmake/core/PlatformAppApi/PlatformAppApi-config.cmake) +nau_try_inc_lib(PlatformApp cmake/core/PlatformApp/PlatformApp-config.cmake) +nau_try_inc_lib(CoreAssets cmake/core/CoreAssets/CoreAssets-config.cmake) +nau_try_inc_lib(CoreInput cmake/core/CoreInput/CoreInput-config.cmake) +nau_try_inc_lib(CoreScene cmake/core/CoreScene/CoreScene-config.cmake) +nau_try_inc_lib(Render cmake/core/Render/Render-config.cmake) +nau_try_inc_lib(Animation cmake/core/Animation/Animation-config.cmake) +nau_try_inc_lib(CoreAssetFormats cmake/core/CoreAssetFormats/CoreAssetFormats-config.cmake) +nau_try_inc_lib(GraphicsAssets cmake/core/GraphicsAssets/GraphicsAssets-config.cmake) +nau_try_inc_lib(Audio cmake/core/Audio/Audio-config.cmake) +nau_try_inc_lib(cocos2d cmake/core/cocos2d/cocos2d-config.cmake) +nau_try_inc_lib(ui cmake/core/ui/ui-config.cmake) +nau_try_inc_lib(VFX cmake/core/VFX/VFX-config.cmake) +nau_try_inc_lib(DebugRenderer cmake/core/DebugRenderer/DebugRenderer-config.cmake) +nau_try_inc_lib(Graphics cmake/core/Graphics/Graphics-config.cmake) +nau_try_inc_lib(LuaToolkit cmake/core/LuaToolkit/LuaToolkit-config.cmake) +nau_try_inc_lib(Network cmake/core/Network/Network-config.cmake) +nau_try_inc_lib(Physics cmake/core/Physics/Physics-config.cmake) +nau_try_inc_lib(PhysicsJolt cmake/core/PhysicsJolt/PhysicsJolt-config.cmake) +nau_try_inc_lib(ScriptsLua cmake/core/ScriptsLua/ScriptsLua-config.cmake) +nau_try_inc_lib(NauFramework cmake/core/NauFramework/NauFramework-config.cmake) + +nau_try_inc_lib(nlohmann_json cmake/tools/nlohmann_json/nlohmann_json-config.cmake) +nau_try_inc_lib(Shared cmake/tools/Shared/Shared-config.cmake) +nau_try_inc_lib(UsdHelpers cmake/tools/UsdHelpers/UsdHelpers-config.cmake) +nau_try_inc_lib(UsdProxy cmake/tools/UsdProxy/UsdProxy-config.cmake) +nau_try_inc_lib(UsdMetaTools cmake/tools/UsdMetaTools/UsdMetaTools-config.cmake) +nau_try_inc_lib(AssetPackTool cmake/tools/AssetPackTool/AssetPackTool-config.cmake) +nau_try_inc_lib(AssetTool cmake/tools/AssetTool/AssetTool-config.cmake) +nau_try_inc_lib(BuildTool cmake/tools/BuildTool/BuildTool-config.cmake) +nau_try_inc_exe(BuildToolCmd cmake/tools/BuildToolCmd/BuildToolCmd-config.cmake) +nau_try_inc_exe(MaterialCreationTool cmake/tools/MaterialCreationTool/MaterialCreationTool-config.cmake) +nau_try_inc_lib(ProjectTool cmake/tools/ProjectTool/ProjectTool-config.cmake) +nau_try_inc_exe(ProjectToolCmd cmake/tools/ProjectToolCmd/ProjectToolCmd-config.cmake) +nau_try_inc_exe(ShaderCompilerTool cmake/tools/ShaderCompilerTool/ShaderCompilerTool-config.cmake) + +nau_try_inc_lib(NauAnimationClipAsset cmake/tools/plugins/NauAnimationClipAsset/NauAnimationClipAsset-config.cmake) +nau_try_inc_lib(NauAssetMetadata cmake/tools/plugins/NauAssetMetadata/NauAssetMetadata-config.cmake) +nau_try_inc_lib(NauAudioSchema cmake/tools/plugins/NauAudioSchema/NauAudioSchema-config.cmake) +nau_try_inc_lib(NauComponentSchema cmake/tools/plugins/NauComponentSchema/NauComponentSchema-config.cmake) +nau_try_inc_lib(NauGuiSchema cmake/tools/plugins/NauGuiSchema/NauGuiSchema-config.cmake) +nau_try_inc_lib(NauInputSchema cmake/tools/plugins/NauInputSchema/NauInputSchema-config.cmake) +nau_try_inc_lib(NauPhysicsSchema cmake/tools/plugins/NauPhysicsSchema/NauPhysicsSchema-config.cmake) +nau_try_inc_lib(NauUsdFormat cmake/tools/plugins/NauUsdFormat/NauUsdFormat-config.cmake) +nau_try_inc_lib(NauVFXSchema cmake/tools/plugins/NauVFXSchema/NauVFXSchema-config.cmake) +nau_try_inc_lib(UsdUidLookup cmake/tools/plugins/UsdUidLookup/UsdUidLookup-config.cmake) + +nau_try_inc_lib(UsdTranslator cmake/tools/UsdTranslator/UsdTranslator-config.cmake) +nau_try_inc_lib(UsdTranslatorWrapper cmake/tools/plugins/UsdTranslatorWrapper/UsdTranslatorWrapper-config.cmake) + +function(nau_add_samples) + nau_try_add_sample(sample_common samples/sample_common) + nau_try_add_sample(all3rdpartyBuild samples/all3rdpartyBuild) + nau_try_add_sample(inputDemo samples/inputDemo) + nau_try_add_sample(kernelBuild samples/kernelBuild) + nau_try_add_sample(minimalApp samples/minimalApp) + nau_try_add_sample(networkTransport samples/networkTransport) + nau_try_add_sample(physics samples/physics) + nau_try_add_sample(sceneBase samples/sceneBase) + nau_try_add_sample(ui-cpp-tests samples/ui-cpp-tests) + nau_try_add_sample(uiSampleApp samples/uiSampleApp) +endfunction() diff --git a/cmake/for_build/run_install.bat b/cmake/for_build/run_install.bat deleted file mode 100644 index 9bb9d9ee..00000000 --- a/cmake/for_build/run_install.bat +++ /dev/null @@ -1,38 +0,0 @@ -@echo Build mode sample usage - -cd ../.. - -if exist output ( - rmdir /S /Q output -) - -del *.out - -rem set preset=win_vs2022_x64 -set preset=win_vs2022_x64_dll - -set config=Debug -rem set config=Release - -cmake --preset %preset% --graphviz=build\%preset%.dot 1>cmake_log.out 2>cmake_err.out -if errorlevel 1 exit /B - -cmake --build build\%preset% --parallel --config=%config% 1>build_log.out 2>build_err.out -if errorlevel 1 exit /B - -cmake --install build\%preset% --config=%config% 1>install_log.out 2>install_err.out -if errorlevel 1 exit /B - -cd output ->NUL SETX NAU_ENGINE_SDK_DIR %CD% - -cmake --preset %preset% 1>cmake_log.out 2>cmake_err.out -if errorlevel 1 exit /B - -cmake --build build\%preset% --config=%config% 1>build_log.out 2>build_err.out -if errorlevel 1 exit /B - -@echo on - -@rem print variables -@echo NAU_ENGINE_SDK_DIR = %CD% \ No newline at end of file diff --git a/cmake/platformSpec/NauMicrosoft.cmake b/cmake/platformSpec/NauMicrosoft.cmake index 8fb6320f..2f392195 100644 --- a/cmake/platformSpec/NauMicrosoft.cmake +++ b/cmake/platformSpec/NauMicrosoft.cmake @@ -65,6 +65,7 @@ endif() #copy_configuration_type(RELEASE RELWITHDEBINFO) set(CMAKE_INSTALL_DEBUG_LIBRARIES TRUE) +set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/$) include(InstallRequiredSystemLibraries) set_property(GLOBAL PROPERTY USE_FOLDERS ON) diff --git a/engine/3rdparty_libs/libpng-libpng16/CMakeLists.txt b/engine/3rdparty_libs/libpng-libpng16/CMakeLists.txt index adf873bc..4de3ac6a 100644 --- a/engine/3rdparty_libs/libpng-libpng16/CMakeLists.txt +++ b/engine/3rdparty_libs/libpng-libpng16/CMakeLists.txt @@ -701,7 +701,7 @@ if(PNG_SHARED) target_include_directories(png PUBLIC $) target_include_directories(png SYSTEM - INTERFACE $) + INTERFACE $) target_link_libraries(png PUBLIC zlib-ng ${M_LIBRARY}) endif() @@ -715,7 +715,7 @@ if(PNG_STATIC) target_include_directories(png PUBLIC $) target_include_directories(png SYSTEM - INTERFACE $) + INTERFACE $) target_link_libraries(png PUBLIC zlib-ng ${M_LIBRARY}) endif() @@ -744,7 +744,7 @@ if(PNG_FRAMEWORK) target_include_directories(png_framework PUBLIC $) target_include_directories(png_framework SYSTEM - INTERFACE $) + INTERFACE $) target_link_libraries(png_framework PUBLIC zlib-ng ${M_LIBRARY}) endif() @@ -1050,7 +1050,7 @@ endif() # NAU install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ - DESTINATION ${CMAKE_INSTALL_PREFIX}/include/libpng16 + DESTINATION ${CMAKE_INSTALL_PREFIX}/include/3rdPartyLibs/libpng16 FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" diff --git a/engine/3rdparty_libs/miniaudio/CMakeLists.txt b/engine/3rdparty_libs/miniaudio/CMakeLists.txt index d531b94e..5eea2ea4 100644 --- a/engine/3rdparty_libs/miniaudio/CMakeLists.txt +++ b/engine/3rdparty_libs/miniaudio/CMakeLists.txt @@ -2,7 +2,16 @@ cmake_minimum_required(VERSION 3.16) project(miniaudio LANGUAGES CXX) +set(HEADERS + miniaudio.h +) + set(TargetName miniaudio) add_library(${TargetName} INTERFACE) -target_include_directories(${TargetName} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/) +target_include_directories(${TargetName} INTERFACE + $ + $ +) + +nau_install(${TargetName} 3rdPartyLibs ${HEADERS}) \ No newline at end of file diff --git a/engine/core/modules/ui/cocos2d-x/external/CMakeLists.txt b/engine/core/modules/ui/cocos2d-x/external/CMakeLists.txt index 68f2d2e9..f05e46f7 100644 --- a/engine/core/modules/ui/cocos2d-x/external/CMakeLists.txt +++ b/engine/core/modules/ui/cocos2d-x/external/CMakeLists.txt @@ -125,19 +125,19 @@ nau_add_compile_options(external) # external # FILE ${CMAKE_BINARY_DIR}/cmake/NauCocos2dExternal.cmake) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tinyxml2 DESTINATION ${CMAKE_INSTALL_PREFIX}/include/modules/ui/cocos2d-x/external FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" PATTERN "*.ipp") +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tinyxml2 DESTINATION ${CMAKE_INSTALL_PREFIX}/include/core/modules/ui/cocos2d-x/external FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" PATTERN "*.ipp") nau_install(ext_tinyxml2 core) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/clipper DESTINATION ${CMAKE_INSTALL_PREFIX}/include/modules/ui/cocos2d-x/external FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" PATTERN "*.ipp") +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/clipper DESTINATION ${CMAKE_INSTALL_PREFIX}/include/core/modules/ui/cocos2d-x/external FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" PATTERN "*.ipp") nau_install(ext_clipper core) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/edtaa3func DESTINATION ${CMAKE_INSTALL_PREFIX}/include/modules/ui/cocos2d-x/external FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" PATTERN "*.ipp") +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/edtaa3func DESTINATION ${CMAKE_INSTALL_PREFIX}/include/core/modules/ui/cocos2d-x/external FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" PATTERN "*.ipp") nau_install(ext_edtaa3func core) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ConvertUTF DESTINATION ${CMAKE_INSTALL_PREFIX}/include/modules/ui/cocos2d-x/external FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" PATTERN "*.ipp") +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ConvertUTF DESTINATION ${CMAKE_INSTALL_PREFIX}/include/core/modules/ui/cocos2d-x/external FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" PATTERN "*.ipp") nau_install(ext_convertUTF core) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/poly2tri DESTINATION ${CMAKE_INSTALL_PREFIX}/include/modules/ui/cocos2d-x/external FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" PATTERN "*.ipp") +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/poly2tri DESTINATION ${CMAKE_INSTALL_PREFIX}/include/core/modules/ui/cocos2d-x/external FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" PATTERN "*.ipp") nau_install(ext_poly2tri core) nau_install(png core) diff --git a/engine/core/modules/ui/cocos2d-x/external/ConvertUTF/CMakeLists.txt b/engine/core/modules/ui/cocos2d-x/external/ConvertUTF/CMakeLists.txt index 8f9db971..f3fc629b 100644 --- a/engine/core/modules/ui/cocos2d-x/external/ConvertUTF/CMakeLists.txt +++ b/engine/core/modules/ui/cocos2d-x/external/ConvertUTF/CMakeLists.txt @@ -12,7 +12,7 @@ add_library(${target_name} STATIC target_include_directories(${target_name} PUBLIC $ - $/include/modules/ui/cocos2d-x/external/ConvertUTF> + $/include/core/modules/ui/cocos2d-x/external/ConvertUTF> ) set_target_properties(${target_name} diff --git a/engine/core/modules/ui/cocos2d-x/external/clipper/CMakeLists.txt b/engine/core/modules/ui/cocos2d-x/external/clipper/CMakeLists.txt index b277519d..880a7c53 100644 --- a/engine/core/modules/ui/cocos2d-x/external/clipper/CMakeLists.txt +++ b/engine/core/modules/ui/cocos2d-x/external/clipper/CMakeLists.txt @@ -11,7 +11,7 @@ add_library(${target_name} STATIC target_include_directories(${target_name} PUBLIC $ - $/include/modules/ui/cocos2d-x/external/clipper> + $/include/core/modules/ui/cocos2d-x/external/clipper> ) set_target_properties(${target_name} diff --git a/engine/core/modules/ui/cocos2d-x/external/edtaa3func/CMakeLists.txt b/engine/core/modules/ui/cocos2d-x/external/edtaa3func/CMakeLists.txt index dc4345fc..8c1b2fd7 100644 --- a/engine/core/modules/ui/cocos2d-x/external/edtaa3func/CMakeLists.txt +++ b/engine/core/modules/ui/cocos2d-x/external/edtaa3func/CMakeLists.txt @@ -11,7 +11,7 @@ add_library(${target_name} STATIC target_include_directories(${target_name} PUBLIC $ - $/include/modules/ui/cocos2d-x/external/edtaa3func> + $/include/core/modules/ui/cocos2d-x/external/edtaa3func> ) set_target_properties(${target_name} diff --git a/engine/core/modules/ui/cocos2d-x/external/poly2tri/CMakeLists.txt b/engine/core/modules/ui/cocos2d-x/external/poly2tri/CMakeLists.txt index 1b641d04..7c307136 100644 --- a/engine/core/modules/ui/cocos2d-x/external/poly2tri/CMakeLists.txt +++ b/engine/core/modules/ui/cocos2d-x/external/poly2tri/CMakeLists.txt @@ -20,7 +20,7 @@ add_library(${target_name} STATIC cmake_path(GET CMAKE_CURRENT_SOURCE_DIR PARENT_PATH PARENT_DIR) target_include_directories(${target_name} PUBLIC $ - $/include/modules/ui/cocos2d-x/external> + $/include/core/modules/ui/cocos2d-x/external> ) set_target_properties(${target_name} diff --git a/engine/core/modules/ui/cocos2d-x/external/tinyxml2/CMakeLists.txt b/engine/core/modules/ui/cocos2d-x/external/tinyxml2/CMakeLists.txt index e0bf6d0b..58dfd92a 100644 --- a/engine/core/modules/ui/cocos2d-x/external/tinyxml2/CMakeLists.txt +++ b/engine/core/modules/ui/cocos2d-x/external/tinyxml2/CMakeLists.txt @@ -15,7 +15,7 @@ add_library(${target_name} STATIC target_include_directories(${target_name} PUBLIC $ - $/include/modules/ui/cocos2d-x/external/tinyxml2> + $/include/core/modules/ui/cocos2d-x/external/tinyxml2> ) include(../cmake/CocosExternalConfig.cmake) diff --git a/project_templates/empty/CMakeLists.txt b/project_templates/empty/CMakeLists.txt index 9bbe6b2c..ae380eff 100644 --- a/project_templates/empty/CMakeLists.txt +++ b/project_templates/empty/CMakeLists.txt @@ -25,27 +25,13 @@ if(NOT EXISTS ${NauEngineFolder}/cmake message(FATAL_ERROR "SDK folder ${NauEngineFolder} does not contain required files!") endif() -set(CMAKE_MODULE_PATH ${NauEngineFolder} - ${NauEngineFolder}/cmake - ${NauEngineFolder}/cmake/defaults -) - -# TODO: set enviroment variables for other platforms -if(WIN32) - execute_process(COMMAND "${CMAKE_SOURCE_DIR}/cmake/platformSpec/set_env.bat") -endif(WIN32) +set(CMAKE_MODULE_PATH ${NauEngineFolder}) # Compiler config set(CMAKE_CXX_STANDARD 20) # TODO: define C standard -# Enable Hot Reload for MSVC compilers if supported. -if(POLICY CMP0141) - cmake_policy(SET CMP0141 NEW) - set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") -endif() - add_compile_options($<$:/MP>) @@ -77,9 +63,6 @@ endif() set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib/$) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin/$) -set(NauSDKIncludes ${NauEngineFolder}/include) -set(NauSDKLibraries ${NauEngineFolder}/lib) - # Nau options option(NAU_RTTI "Enable rtti support" OFF) @@ -98,154 +81,13 @@ else() endif() +include(NauEngineSDK) include(NauCommon) include(NauModule) include(NauGenFunctions) include(platformSpec/NauPlatformSetup) -function(try_inc_lib target cmakeName) - if (EXISTS ${NauEngineFolder}/${cmakeName}) - message(STATUS "include ${cmakeName} from NAU sdk") - include(${NauEngineFolder}/${cmakeName}) - if (BUILD_SHARED_LIBS) - set_target_properties(${target} PROPERTIES - IMPORTED_LOCATION_Debug "${NauEngineFolder}/bin/Debug/${target}.dll" - IMPORTED_LOCATION_Release "${NauEngineFolder}/bin/Release/${target}.dll" - IMPORTED_IMPLIB_Debug "${NauEngineFolder}/lib/Debug/${target}.lib" - IMPORTED_IMPLIB_Release "${NauEngineFolder}/lib/Release/${target}.lib" - IMPORTED_GLOBAL TRUE - ) - else() - set_target_properties(${target} PROPERTIES - IMPORTED_LOCATION_Debug "${NauEngineFolder}/bin/Debug/${target}.lib" - IMPORTED_LOCATION_Release "${NauEngineFolder}/bin/Release/${target}.lib" - IMPORTED_GLOBAL TRUE - ) - endif() - endif() -endfunction() - -function(try_inc_exe target cmakeName) - if (EXISTS ${NauEngineFolder}/${cmakeName}) - message(STATUS "include ${cmakeName} from NAU sdk") - include(${NauEngineFolder}/${cmakeName}) - set_target_properties(${target} PROPERTIES - IMPORTED_LOCATION_Debug "${NauEngineFolder}/bin/Debug/${target}.exe" - IMPORTED_LOCATION_Release "${NauEngineFolder}/bin/Release/${target}.exe" - IMPORTED_GLOBAL TRUE - ) - endif() -endfunction() - -function(try_add subdir) - if (EXISTS ${NauEngineFolder}/${subdir}) - message(STATUS "add ${subdir} from NAU sdk") - add_subdirectory(${NauEngineFolder}/${subdir}) - endif() -endfunction() - -try_inc_lib(adlSdk cmake/3rdPartyLibs/adlSdk/adlSdk-config.cmake) -try_inc_lib(asio cmake/3rdPartyLibs/asio/asio-config.cmake) -try_inc_lib(brotli cmake/3rdPartyLibs/brotli/brotli-config.cmake) -try_inc_lib(dxc cmake/3rdPartyLibs/dxc/dxc-config.cmake) -try_inc_lib(EABase cmake/3rdPartyLibs/EABase/EABase-config.cmake) -try_inc_lib(EASTL cmake/3rdPartyLibs/EASTL/EASTL-config.cmake) -try_inc_lib(fast_float cmake/3rdPartyLibs/fast_float/fast_float-config.cmake) -try_inc_lib(fmt cmake/3rdPartyLibs/fmt/fmt-config.cmake) -try_inc_lib(gainput cmake/3rdPartyLibs/gainput/gainput-config.cmake) -try_inc_lib(imgui cmake/3rdPartyLibs/imgui/imgui-config.cmake) -try_inc_lib(ispc_texcomp cmake/3rdPartyLibs/ispc_texcomp/ispc_texcomp-config.cmake) -try_inc_lib(Jolt cmake/3rdPartyLibs/Jolt/Jolt-config.cmake) -try_inc_lib(json cmake/3rdPartyLibs/json/json-config.cmake) -try_inc_lib(jsoncpp cmake/3rdPartyLibs/jsoncpp/jsoncpp-config.cmake) -try_inc_lib(lua cmake/3rdPartyLibs/lua/lua-config.cmake) -try_inc_lib(lzma-9.20 cmake/3rdPartyLibs/lzma-9.20/lzma-9.20-config.cmake) -try_inc_lib(md5 cmake/3rdPartyLibs/md5/md5-config.cmake) -try_inc_lib(ozz_base cmake/3rdPartyLibs/ozz_base/ozz_base-config.cmake) -try_inc_lib(ozz_options cmake/3rdPartyLibs/ozz_options/ozz_options-config.cmake) -try_inc_lib(ozz_animation cmake/3rdPartyLibs/ozz_animation/ozz_animation-config.cmake) -try_inc_lib(ozz_animation_offline cmake/3rdPartyLibs/ozz_animation_offline/ozz_animation_offline-config.cmake) -try_inc_lib(ozz_animation_tools cmake/3rdPartyLibs/ozz_animation_tools/ozz_animation_tools-config.cmake) -try_inc_lib(ozz_geometry cmake/3rdPartyLibs/ozz_geometry/ozz_geometry-config.cmake) -try_inc_lib(RenderDoc cmake/3rdPartyLibs/RenderDoc/RenderDoc-config.cmake) -try_inc_lib(ska_hash_map cmake/3rdPartyLibs/ska_hash_map/ska_hash_map-config.cmake) -try_inc_lib(stb cmake/3rdPartyLibs/stb/stb-config.cmake) -try_inc_lib(tinydds cmake/3rdPartyLibs/tinydds/tinydds-config.cmake) -try_inc_lib(tinygltf cmake/3rdPartyLibs/tinygltf/tinygltf-config.cmake) -try_inc_lib(tinyimageformat cmake/3rdPartyLibs/tinyimageformat/tinyimageformat-config.cmake) -try_inc_lib(tinyutf8 cmake/3rdPartyLibs/tinyutf8/tinyutf8-config.cmake) -try_inc_lib(uriparser cmake/3rdPartyLibs/uriparser/uriparser-config.cmake) -try_inc_lib(utf8cpp cmake/3rdPartyLibs/utf8cpp/utf8cpp-config.cmake) -try_inc_lib(vectormath cmake/3rdPartyLibs/vectormath/vectormath-config.cmake) -try_inc_lib(wyhash cmake/3rdPartyLibs/wyhash/wyhash-config.cmake) -try_inc_lib(xxHash cmake/3rdPartyLibs/xxHash/xxHash-config.cmake) -try_inc_lib(zlib-ng cmake/3rdPartyLibs/zlib-ng/zlib-ng-config.cmake) -try_inc_lib(zstd-1.4.5 cmake/3rdPartyLibs/zstd-1.4.5/zstd-1.4.5-config.cmake) - -try_inc_lib(NauKernel cmake/core/NauKernel/NauKernel-config.cmake) -try_inc_lib(binPack2D cmake/3rdPartyLibs/binPack2D/binPack2D-config.cmake) - -#try_inc_lib(Tracy share/Tracy/TracyConfig.cmake) - -try_inc_lib(ext_clipper cmake/core/ext_clipper/ext_clipper-config.cmake) -try_inc_lib(ext_convertUTF cmake/core/ext_convertUTF/ext_convertUTF-config.cmake) -try_inc_lib(ext_edtaa3func cmake/core/ext_edtaa3func/ext_edtaa3func-config.cmake) -try_inc_lib(ext_poly2tri cmake/core/ext_poly2tri/ext_poly2tri-config.cmake) -try_inc_lib(ext_tinyxml2 cmake/core/ext_tinyxml2/ext_tinyxml2-config.cmake) -try_inc_lib(png cmake/core/png/png-config.cmake) -try_inc_lib(external cmake/core/external/external-config.cmake) -try_inc_lib(CoreAssetFormats cmake/core/CoreAssetFormats/CoreAssetFormats-config.cmake) -try_inc_lib(CoreAssets cmake/core/CoreAssets/CoreAssets-config.cmake) -try_inc_lib(CoreInput cmake/core/CoreInput/CoreInput-config.cmake) -try_inc_lib(CoreScene cmake/core/CoreScene/CoreScene-config.cmake) -try_inc_lib(Animation cmake/core/Animation/Animation-config.cmake) -try_inc_lib(PlatformAppApi cmake/core/PlatformAppApi/PlatformAppApi-config.cmake) -try_inc_lib(PlatformApp cmake/core/PlatformApp/PlatformApp-config.cmake) -try_inc_lib(Render cmake/core/Render/Render-config.cmake) -try_inc_lib(GraphicsAssets cmake/core/GraphicsAssets/GraphicsAssets-config.cmake) -try_inc_lib(Audio cmake/core/Audio/Audio-config.cmake) -try_inc_lib(cocos2d cmake/core/cocos2d/cocos2d-config.cmake) -try_inc_lib(DebugRenderer cmake/core/DebugRenderer/DebugRenderer-config.cmake) -try_inc_lib(Graphics cmake/core/Graphics/Graphics-config.cmake) -try_inc_lib(LuaToolkit cmake/core/LuaToolkit/LuaToolkit-config.cmake) -try_inc_lib(Network cmake/core/Network/Network-config.cmake) -try_inc_lib(Physics cmake/core/Physics/Physics-config.cmake) -try_inc_lib(PhysicsJolt cmake/core/PhysicsJolt/PhysicsJolt-config.cmake) -try_inc_lib(ScriptsLua cmake/core/ScriptsLua/ScriptsLua-config.cmake) -try_inc_lib(ui cmake/core/ui/ui-config.cmake) -try_inc_lib(VFX cmake/core/VFX/VFX-config.cmake) -try_inc_lib(NauFramework cmake/core/NauFramework/NauFramework-config.cmake) - -try_inc_lib(nlohmann_json cmake/tools/nlohmann_json/nlohmann_json-config.cmake) -try_inc_lib(Shared cmake/tools/Shared/Shared-config.cmake) -try_inc_lib(UsdHelpers cmake/tools/UsdHelpers/UsdHelpers-config.cmake) -try_inc_lib(UsdProxy cmake/tools/UsdProxy/UsdProxy-config.cmake) -try_inc_lib(UsdMetaTools cmake/tools/UsdMetaTools/UsdMetaTools-config.cmake) -try_inc_lib(AssetPackTool cmake/tools/AssetPackTool/AssetPackTool-config.cmake) -try_inc_lib(AssetTool cmake/tools/AssetTool/AssetTool-config.cmake) -try_inc_lib(BuildTool cmake/tools/BuildTool/BuildTool-config.cmake) -try_inc_exe(BuildToolCmd cmake/tools/BuildToolCmd/BuildToolCmd-config.cmake) -try_inc_exe(MaterialCreationTool cmake/tools/MaterialCreationTool/MaterialCreationTool-config.cmake) -try_inc_lib(ProjectTool cmake/tools/ProjectTool/ProjectTool-config.cmake) -try_inc_exe(ProjectToolCmd cmake/tools/ProjectToolCmd/ProjectToolCmd-config.cmake) -try_inc_exe(ShaderCompilerTool cmake/tools/ShaderCompilerTool/ShaderCompilerTool-config.cmake) - -try_inc_lib(NauAnimationClipAsset cmake/tools/plugins/NauAnimationClipAsset/NauAnimationClipAsset-config.cmake) -try_inc_lib(NauAssetMetadata cmake/tools/plugins/NauAssetMetadata/NauAssetMetadata-config.cmake) -try_inc_lib(NauAudioSchema cmake/tools/plugins/NauAudioSchema/NauAudioSchema-config.cmake) -try_inc_lib(NauComponentSchema cmake/tools/plugins/NauComponentSchema/NauComponentSchema-config.cmake) -try_inc_lib(NauGuiSchema cmake/tools/plugins/NauGuiSchema/NauGuiSchema-config.cmake) -try_inc_lib(NauInputSchema cmake/tools/plugins/NauInputSchema/NauInputSchema-config.cmake) -try_inc_lib(NauPhysicsSchema cmake/tools/plugins/NauPhysicsSchema/NauPhysicsSchema-config.cmake) -try_inc_lib(NauUsdFormat cmake/tools/plugins/NauUsdFormat/NauUsdFormat-config.cmake) -try_inc_lib(NauVFXSchema cmake/tools/plugins/NauVFXSchema/NauVFXSchema-config.cmake) -try_inc_lib(UsdUidLookup cmake/tools/plugins/UsdUidLookup/UsdUidLookup-config.cmake) - -try_inc_lib(UsdTranslator cmake/tools/UsdTranslator/UsdTranslator-config.cmake) -try_inc_lib(UsdTranslatorWrapper cmake/tools/plugins/UsdTranslatorWrapper/UsdTranslatorWrapper-config.cmake) - - include(source/game/%%(ProjectName:no_space)%%.cmake) file(GLOB Sources diff --git a/tools/3rd_party/CMakeLists.txt b/tools/3rd_party/CMakeLists.txt index 50c5b3af..4073f790 100644 --- a/tools/3rd_party/CMakeLists.txt +++ b/tools/3rd_party/CMakeLists.txt @@ -15,4 +15,9 @@ nau_collect_files(nlohmann_json_Headers DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/json/include/nlohmann MASK "*.h" "*.hpp" ) -nau_install(nlohmann_json tools ${nlohmann_json_Headers}) \ No newline at end of file +nau_install(nlohmann_json tools ${nlohmann_json_Headers}) +# FIXME: set correct paths in nlohmann_json after make it part of the repository +# for now it is workaround to fix paths in generated cmake +install(CODE + "execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/nlohmann_json-config.cmake ${CMAKE_INSTALL_PREFIX}/cmake/tools/nlohmann_json/nlohmann_json-config.cmake)" +) \ No newline at end of file diff --git a/tools/3rd_party/nlohmann_json-config.cmake b/tools/3rd_party/nlohmann_json-config.cmake new file mode 100644 index 00000000..ce0a1ba4 --- /dev/null +++ b/tools/3rd_party/nlohmann_json-config.cmake @@ -0,0 +1,108 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) + message(FATAL_ERROR "CMake >= 2.8.0 required") +endif() +if(CMAKE_VERSION VERSION_LESS "2.8.3") + message(FATAL_ERROR "CMake >= 2.8.3 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.8.3...3.25) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_cmake_targets_defined "") +set(_cmake_targets_not_defined "") +set(_cmake_expected_targets "") +foreach(_cmake_expected_target IN ITEMS nlohmann_json) + list(APPEND _cmake_expected_targets "${_cmake_expected_target}") + if(TARGET "${_cmake_expected_target}") + list(APPEND _cmake_targets_defined "${_cmake_expected_target}") + else() + list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") + endif() +endforeach() +unset(_cmake_expected_target) +if(_cmake_targets_defined STREQUAL _cmake_expected_targets) + unset(_cmake_targets_defined) + unset(_cmake_targets_not_defined) + unset(_cmake_expected_targets) + unset(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT _cmake_targets_defined STREQUAL "") + string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") + string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") +endif() +unset(_cmake_targets_defined) +unset(_cmake_targets_not_defined) +unset(_cmake_expected_targets) + + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Create imported target nlohmann_json +add_library(nlohmann_json INTERFACE IMPORTED) + +set_target_properties(nlohmann_json PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "\$<\$>:JSON_USE_GLOBAL_UDLS=0>;\$<\$>:JSON_USE_IMPLICIT_CONVERSIONS=0>;\$<\$:JSON_DISABLE_ENUM_SERIALIZATION=1>;\$<\$:JSON_DIAGNOSTICS=1>;\$<\$:JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON=1>" + INTERFACE_COMPILE_FEATURES "cxx_std_11" + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/tools/nlohmann_json/json/include" +) + +if(CMAKE_VERSION VERSION_LESS 3.1.0) + message(FATAL_ERROR "This file relies on consumers using CMake 3.1.0 or greater.") +endif() + +# Load information for each installed configuration. +file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/nlohmann_json-config-*.cmake") +foreach(_cmake_config_file IN LISTS _cmake_config_files) + include("${_cmake_config_file}") +endforeach() +unset(_cmake_config_file) +unset(_cmake_config_files) + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(_cmake_target IN LISTS _cmake_import_check_targets) + foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") + if(NOT EXISTS "${_cmake_file}") + message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file + \"${_cmake_file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + unset(_cmake_file) + unset("_cmake_import_check_files_for_${_cmake_target}") +endforeach() +unset(_cmake_target) +unset(_cmake_import_check_targets) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP)