Add check for CarlaUnreal Content presence. (#7294)
* Add check for CarlaUnreal Content presence. Remove check for Release build and instead guard against Debug build. --------- Co-authored-by: Xavier Solé Nogués <xavisolesoft@gmail.com>
This commit is contained in:
parent
d07a623c9c
commit
9bc6e1cce1
|
@ -68,9 +68,9 @@ include (${CARLA_WORKSPACE_PATH}/CMake/CarlaOptions.cmake)
|
|||
include (${CARLA_WORKSPACE_PATH}/CMake/Warnings.cmake)
|
||||
include (${CARLA_WORKSPACE_PATH}/CMake/Errors.cmake)
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
carla_warning (
|
||||
"CARLA is not set to be built in Release mode. This may cause issues when building CarlaUnrealEditor."
|
||||
"CARLA is set to be built in Debug mode. This may cause issues when building CarlaUnrealEditor."
|
||||
)
|
||||
endif ()
|
||||
|
||||
|
|
|
@ -55,6 +55,14 @@ set (
|
|||
${CARLA_UNREAL_ENGINE_PATH}/Engine/Binaries/${UE_SYSTEM_NAME}/UnrealEditor${EXE_EXT}
|
||||
)
|
||||
|
||||
set (CARLA_UE_CONTENT_CHECK_PATH ${CARLA_UE_PATH}/Content/Carla/Blueprints)
|
||||
if (IS_DIRECTORY ${CARLA_UE_CONTENT_CHECK_PATH})
|
||||
carla_message ("CARLA Unreal Content - FOUND")
|
||||
else ()
|
||||
carla_message ("CARLA Unreal Content - MISSING")
|
||||
carla_warning ("Could not find CARLA Content, download it or running the editor will result in a crash.")
|
||||
endif ()
|
||||
|
||||
|
||||
|
||||
set (
|
||||
|
@ -326,12 +334,40 @@ add_custom_target (
|
|||
${CARLA_LAUNCH_TARGET_OPTIONS}
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
set (
|
||||
PRELAUNCH_CONTENT_CHECK_COMMAND
|
||||
if exist ${CARLA_UE_CONTENT_CHECK_PATH} (exit 0) else (exit 1)
|
||||
)
|
||||
else ()
|
||||
set (
|
||||
PRELAUNCH_CONTENT_CHECK_COMMAND
|
||||
test -d ${CARLA_UE_CONTENT_CHECK_PATH}
|
||||
)
|
||||
endif ()
|
||||
|
||||
add_custom_target (
|
||||
prelaunch-content-check
|
||||
COMMAND
|
||||
${PRELAUNCH_CONTENT_CHECK_COMMAND}
|
||||
COMMENT
|
||||
"Performing prelaunch check for CARLA Content presence."
|
||||
USES_TERMINAL
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_dependencies (
|
||||
launch
|
||||
CarlaUnrealEditor
|
||||
prelaunch-content-check
|
||||
)
|
||||
|
||||
add_custom_target (
|
||||
launch-only
|
||||
${CARLA_LAUNCH_TARGET_OPTIONS}
|
||||
)
|
||||
|
||||
add_dependencies (
|
||||
launch-only
|
||||
prelaunch-content-check
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue