2024-03-04 20:10:00 +08:00
|
|
|
project (
|
2024-03-12 20:04:01 +08:00
|
|
|
carla-unreal
|
|
|
|
VERSION
|
|
|
|
${CARLA_VERSION}
|
|
|
|
LANGUAGES
|
|
|
|
CXX
|
|
|
|
DESCRIPTION
|
|
|
|
"Open-source simulator for autonomous driving research."
|
2024-03-04 20:10:00 +08:00
|
|
|
)
|
|
|
|
|
2024-05-15 23:50:06 +08:00
|
|
|
carla_option (
|
|
|
|
ENABLE_DIRECTORY_CLEAN
|
2024-04-22 20:10:58 +08:00
|
|
|
"Enable ADDITIONAL_CLEAN_FILES on directory level"
|
|
|
|
ON
|
|
|
|
)
|
|
|
|
|
|
|
|
set (
|
|
|
|
CARLA_BUILD_PATH
|
|
|
|
${CARLA_WORKSPACE_PATH}/Build/
|
|
|
|
)
|
|
|
|
|
2024-03-04 20:10:00 +08:00
|
|
|
set (
|
|
|
|
CARLA_UE_PATH
|
2024-03-04 20:33:51 +08:00
|
|
|
${CARLA_WORKSPACE_PATH}/Unreal/CarlaUnreal
|
2024-03-04 20:10:00 +08:00
|
|
|
)
|
|
|
|
|
2024-03-07 00:20:13 +08:00
|
|
|
set (
|
|
|
|
CARLA_UE_PLUGINS_PATH
|
|
|
|
${CARLA_UE_PATH}/Plugins
|
|
|
|
)
|
|
|
|
|
2024-03-15 03:03:32 +08:00
|
|
|
set (
|
|
|
|
CARLA_UE_CARLA_PATH
|
|
|
|
${CARLA_UE_PLUGINS_PATH}/Carla
|
|
|
|
)
|
|
|
|
|
|
|
|
set (
|
|
|
|
CARLA_UE_CARLA_TOOLS_PATH
|
|
|
|
${CARLA_UE_PLUGINS_PATH}/CarlaTools
|
|
|
|
)
|
|
|
|
|
2024-05-22 22:22:45 +08:00
|
|
|
set (
|
|
|
|
CARLA_UE_CARLA_EXPORTER_PATH
|
|
|
|
${CARLA_UE_PLUGINS_PATH}/CarlaExporter
|
|
|
|
)
|
|
|
|
|
2024-03-04 20:10:00 +08:00
|
|
|
set (
|
|
|
|
CARLA_UE_PROJECT_PATH
|
2024-03-04 20:33:51 +08:00
|
|
|
${CARLA_UE_PATH}/CarlaUnreal.uproject
|
2024-03-04 20:10:00 +08:00
|
|
|
)
|
|
|
|
|
2024-04-02 18:05:55 +08:00
|
|
|
set (
|
|
|
|
CARLA_UE_CONTENT_PATH
|
|
|
|
${CARLA_UE_PATH}/Content/Carla
|
|
|
|
)
|
|
|
|
|
|
|
|
if (NOT EXISTS ${CARLA_UE_CONTENT_PATH}/.git)
|
|
|
|
carla_error ("Missing CARLA content.")
|
|
|
|
endif ()
|
|
|
|
|
2024-03-14 23:27:10 +08:00
|
|
|
if (ENABLE_ROS2)
|
|
|
|
set (LAUNCH_ARGS ${LAUNCH_ARGS} --ros2)
|
|
|
|
endif()
|
|
|
|
|
2024-05-21 19:30:13 +08:00
|
|
|
if (ENABLE_ROS2_DEMO)
|
|
|
|
set (LAUNCH_ARGS ${LAUNCH_ARGS} --ros2-demo)
|
|
|
|
endif()
|
|
|
|
|
2024-03-21 03:00:14 +08:00
|
|
|
set (
|
|
|
|
UNREAL_EDITOR_PATH
|
|
|
|
${CARLA_UNREAL_ENGINE_PATH}/Engine/Binaries/${UE_SYSTEM_NAME}/UnrealEditor${EXE_EXT}
|
|
|
|
)
|
|
|
|
|
2024-03-26 21:55:35 +08:00
|
|
|
set (CARLA_UE_CONTENT_CHECK_PATH ${CARLA_UE_PATH}/Content/Carla/Blueprints)
|
|
|
|
if (IS_DIRECTORY ${CARLA_UE_CONTENT_CHECK_PATH})
|
2024-09-19 23:35:18 +08:00
|
|
|
carla_message_verbose ("CARLA Unreal Content - FOUND")
|
2024-03-26 21:55:35 +08:00
|
|
|
else ()
|
|
|
|
carla_warning ("Could not find CARLA Content, download it or running the editor will result in a crash.")
|
|
|
|
endif ()
|
|
|
|
|
2024-03-07 00:20:13 +08:00
|
|
|
|
|
|
|
|
2024-03-12 23:50:08 +08:00
|
|
|
set (
|
2024-09-18 20:49:14 +08:00
|
|
|
UE_DEPENDENCIES
|
2024-03-12 18:01:37 +08:00
|
|
|
carla-server
|
2024-03-12 18:20:17 +08:00
|
|
|
libsqlite3
|
|
|
|
Boost::asio
|
|
|
|
Boost::python
|
|
|
|
Boost::geometry
|
|
|
|
Boost::gil
|
|
|
|
Eigen3::Eigen
|
|
|
|
zlibstatic
|
|
|
|
png_static
|
2024-03-15 03:03:32 +08:00
|
|
|
rpc
|
|
|
|
)
|
|
|
|
|
2024-09-18 20:49:14 +08:00
|
|
|
set (UE_DEPENDENCIES_ORDER_ONLY ${UE_DEPENDENCIES})
|
2024-03-17 18:46:19 +08:00
|
|
|
|
|
|
|
if (BUILD_CARLA_CLIENT)
|
|
|
|
list (APPEND UE_DEPENDENCIES_ORDER_ONLY carla-client)
|
|
|
|
endif ()
|
|
|
|
|
2024-09-18 20:49:14 +08:00
|
|
|
list (
|
|
|
|
APPEND
|
|
|
|
UE_DEPENDENCIES_ORDER_ONLY
|
|
|
|
RecastBuilder
|
|
|
|
)
|
|
|
|
|
2024-03-17 18:46:19 +08:00
|
|
|
|
|
|
|
|
2024-03-19 03:32:33 +08:00
|
|
|
set (
|
|
|
|
CARLA_UNREAL_INCLUDE_PATHS_FILE_PATH
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Includes.inc
|
|
|
|
)
|
|
|
|
|
|
|
|
set (
|
|
|
|
CARLA_UNREAL_LIBRARIES_PATHS_FILE_PATH
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Libraries.inc
|
|
|
|
)
|
|
|
|
|
|
|
|
set (
|
|
|
|
CARLA_UNREAL_OPTIONS_PATHS_FILE_PATH
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Options.inc
|
|
|
|
)
|
2024-03-15 03:03:32 +08:00
|
|
|
|
|
|
|
set (
|
|
|
|
CARLA_UNREAL_INCLUDE_PATHS
|
|
|
|
${sqlite3_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach (UE_DEP ${UE_DEPENDENCIES})
|
|
|
|
list (
|
|
|
|
APPEND
|
|
|
|
CARLA_UNREAL_INCLUDE_PATHS
|
|
|
|
"$<TARGET_PROPERTY:${UE_DEP},INTERFACE_INCLUDE_DIRECTORIES>"
|
|
|
|
)
|
|
|
|
endforeach ()
|
|
|
|
|
|
|
|
set (
|
|
|
|
CARLA_UNREAL_LIBRARIES
|
|
|
|
$<TARGET_FILE:libsqlite3>
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach (UE_DEP ${UE_DEPENDENCIES})
|
|
|
|
get_target_property (UE_DEP_TYPE ${UE_DEP} TYPE)
|
|
|
|
if (NOT ("${UE_DEP_TYPE}" STREQUAL "INTERFACE_LIBRARY"))
|
|
|
|
list (
|
|
|
|
APPEND
|
|
|
|
CARLA_UNREAL_LIBRARIES
|
|
|
|
"$<TARGET_FILE:${UE_DEP}>"
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
endforeach ()
|
|
|
|
|
2024-03-15 22:58:32 +08:00
|
|
|
set (UNREAL_PROJECT_OPTIONS)
|
|
|
|
|
|
|
|
if (ENABLE_ROS2)
|
|
|
|
list (
|
|
|
|
APPEND
|
|
|
|
CARLA_UNREAL_OPTIONS
|
|
|
|
"ROS2"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2024-05-21 19:30:13 +08:00
|
|
|
if (ENABLE_ROS2_DEMO)
|
|
|
|
list (
|
|
|
|
APPEND
|
|
|
|
CARLA_UNREAL_OPTIONS
|
|
|
|
"ROS2_DEMO"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2024-03-15 22:58:32 +08:00
|
|
|
if (ENABLE_OSM2ODR)
|
|
|
|
list (
|
|
|
|
APPEND
|
|
|
|
CARLA_UNREAL_OPTIONS
|
|
|
|
"OSM2ODR"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
|
|
|
|
|
2024-03-21 02:38:23 +08:00
|
|
|
if (WIN32)
|
|
|
|
set (
|
|
|
|
CARLA_UE_GENERATE_PROJECT_FILES_COMMAND
|
|
|
|
${CARLA_UNREAL_ENGINE_PATH}/GenerateProjectFiles.bat
|
|
|
|
-project=${CARLA_UE_PROJECT_PATH}
|
|
|
|
-CMakefile
|
|
|
|
-game
|
|
|
|
-engine
|
|
|
|
)
|
|
|
|
set (
|
|
|
|
CARLA_UE_BUILD_COMMAND_PREFIX
|
|
|
|
${CARLA_UNREAL_ENGINE_PATH}/Engine/Build/BatchFiles/Build.bat
|
|
|
|
)
|
2024-04-02 18:05:55 +08:00
|
|
|
set (
|
|
|
|
CARLA_UE_UAT_COMMAND_PREFIX
|
|
|
|
${CARLA_UNREAL_ENGINE_PATH}/Engine/Build/BatchFiles/RunUAT.bat
|
|
|
|
)
|
2024-03-21 02:38:23 +08:00
|
|
|
else ()
|
|
|
|
set (
|
|
|
|
CARLA_UE_GENERATE_PROJECT_FILES_COMMAND
|
|
|
|
${CARLA_UNREAL_ENGINE_PATH}/GenerateProjectFiles.sh
|
|
|
|
-project=${CARLA_UE_PROJECT_PATH}
|
|
|
|
-CMakefile
|
|
|
|
-game
|
|
|
|
-engine
|
|
|
|
)
|
|
|
|
set (
|
|
|
|
CARLA_UE_BUILD_COMMAND_PREFIX
|
2024-03-21 03:00:14 +08:00
|
|
|
${CARLA_UNREAL_ENGINE_PATH}/Engine/Build/BatchFiles/${UE_SYSTEM_NAME}/Build.sh
|
2024-03-21 02:38:23 +08:00
|
|
|
)
|
2024-04-02 18:05:55 +08:00
|
|
|
set (
|
|
|
|
CARLA_UE_UAT_COMMAND_PREFIX
|
|
|
|
${CARLA_UNREAL_ENGINE_PATH}/Engine/Build/BatchFiles/RunUAT.sh
|
|
|
|
)
|
2024-03-21 02:38:23 +08:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (CMAKE_TOOLCHAIN_FILE)
|
|
|
|
cmake_path (
|
|
|
|
ABSOLUTE_PATH
|
|
|
|
CMAKE_TOOLCHAIN_FILE
|
|
|
|
BASE_DIRECTORY
|
|
|
|
${CARLA_WORKSPACE_PATH}
|
|
|
|
NORMALIZE
|
|
|
|
OUTPUT_VARIABLE
|
|
|
|
TOOLCHAIN_FILE
|
|
|
|
)
|
|
|
|
set (
|
|
|
|
TOOLCHAIN_FILE_OPTION
|
|
|
|
--toolchain=${TOOLCHAIN_FILE}
|
|
|
|
)
|
|
|
|
else ()
|
|
|
|
set (TOOLCHAIN_FILE_OPTION)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-21 03:05:54 +08:00
|
|
|
set (
|
|
|
|
CARLA_UNREAL_CONFIGURE_OUTPUTS
|
2024-03-20 18:34:44 +08:00
|
|
|
${CARLA_UNREAL_INCLUDE_PATHS_FILE_PATH}
|
2024-03-21 02:38:23 +08:00
|
|
|
${CARLA_UE_CARLA_PATH}/Includes.def
|
|
|
|
${CARLA_UE_CARLA_TOOLS_PATH}/Includes.def
|
2024-03-20 18:34:44 +08:00
|
|
|
${CARLA_UNREAL_LIBRARIES_PATHS_FILE_PATH}
|
2024-03-21 02:38:23 +08:00
|
|
|
${CARLA_UE_CARLA_PATH}/Libraries.def
|
|
|
|
${CARLA_UE_CARLA_TOOLS_PATH}/Libraries.def
|
2024-03-20 18:34:44 +08:00
|
|
|
${CARLA_UNREAL_OPTIONS_PATHS_FILE_PATH}
|
2024-03-21 02:38:23 +08:00
|
|
|
${CARLA_UE_CARLA_PATH}/Options.def
|
|
|
|
${CARLA_UE_CARLA_TOOLS_PATH}/Options.def
|
2024-03-21 03:05:54 +08:00
|
|
|
)
|
2024-03-21 03:18:58 +08:00
|
|
|
|
2024-03-26 00:23:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
file (
|
|
|
|
GENERATE
|
|
|
|
OUTPUT
|
|
|
|
${CARLA_UNREAL_INCLUDE_PATHS_FILE_PATH}
|
|
|
|
CONTENT
|
|
|
|
"${CARLA_UNREAL_INCLUDE_PATHS}"
|
|
|
|
)
|
|
|
|
|
|
|
|
file (
|
|
|
|
GENERATE
|
|
|
|
OUTPUT
|
|
|
|
${CARLA_UNREAL_LIBRARIES_PATHS_FILE_PATH}
|
|
|
|
CONTENT
|
|
|
|
"${CARLA_UNREAL_LIBRARIES}"
|
|
|
|
)
|
|
|
|
|
|
|
|
file (
|
|
|
|
GENERATE
|
|
|
|
OUTPUT
|
|
|
|
${CARLA_UNREAL_OPTIONS_PATHS_FILE_PATH}
|
|
|
|
CONTENT
|
|
|
|
"${CARLA_UNREAL_OPTIONS}"
|
|
|
|
)
|
|
|
|
|
2024-03-21 03:05:54 +08:00
|
|
|
add_custom_command (
|
|
|
|
OUTPUT
|
|
|
|
${CARLA_UNREAL_CONFIGURE_OUTPUTS}
|
2024-03-26 00:23:16 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink ${CARLA_UNREAL_INCLUDE_PATHS_FILE_PATH} ${CARLA_UE_CARLA_PATH}/Includes.def
|
|
|
|
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink ${CARLA_UNREAL_INCLUDE_PATHS_FILE_PATH} ${CARLA_UE_CARLA_TOOLS_PATH}/Includes.def
|
|
|
|
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink ${CARLA_UNREAL_LIBRARIES_PATHS_FILE_PATH} ${CARLA_UE_CARLA_PATH}/Libraries.def
|
|
|
|
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink ${CARLA_UNREAL_LIBRARIES_PATHS_FILE_PATH} ${CARLA_UE_CARLA_TOOLS_PATH}/Libraries.def
|
|
|
|
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink ${CARLA_UNREAL_OPTIONS_PATHS_FILE_PATH} ${CARLA_UE_CARLA_PATH}/Options.def
|
|
|
|
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink ${CARLA_UNREAL_OPTIONS_PATHS_FILE_PATH} ${CARLA_UE_CARLA_TOOLS_PATH}/Options.def
|
2024-03-21 03:18:58 +08:00
|
|
|
USES_TERMINAL
|
|
|
|
VERBATIM
|
2024-03-21 02:38:23 +08:00
|
|
|
)
|
2024-03-20 18:34:44 +08:00
|
|
|
|
2024-03-21 02:38:23 +08:00
|
|
|
add_custom_target (
|
|
|
|
carla-unreal-configure
|
|
|
|
DEPENDS
|
2024-03-21 03:05:54 +08:00
|
|
|
${CARLA_UNREAL_CONFIGURE_OUTPUTS}
|
2024-03-17 18:46:19 +08:00
|
|
|
)
|
|
|
|
|
2024-03-21 02:38:23 +08:00
|
|
|
|
|
|
|
|
|
|
|
file (
|
|
|
|
MAKE_DIRECTORY
|
|
|
|
${CARLA_UE_PATH}/Content/Carla/ExportedMaps
|
2024-03-18 17:49:06 +08:00
|
|
|
)
|
|
|
|
|
2024-03-17 18:46:19 +08:00
|
|
|
|
|
|
|
|
2024-05-15 23:50:06 +08:00
|
|
|
carla_add_custom_target (
|
2024-04-02 18:05:55 +08:00
|
|
|
carla-unreal
|
2024-05-15 23:50:06 +08:00
|
|
|
"Build the CarlaUnreal subproject."
|
2024-03-11 19:30:24 +08:00
|
|
|
COMMAND
|
2024-05-22 22:22:45 +08:00
|
|
|
${CARLA_UE_BUILD_COMMAND_PREFIX}
|
2024-03-21 02:38:23 +08:00
|
|
|
CarlaUnreal
|
|
|
|
${UE_SYSTEM_NAME}
|
2024-03-21 03:41:12 +08:00
|
|
|
${CARLA_UNREAL_BUILD_TYPE}
|
2024-03-21 02:38:23 +08:00
|
|
|
-project=${CARLA_UE_PROJECT_PATH}
|
|
|
|
-game
|
|
|
|
-buildscw
|
2024-03-21 03:41:12 +08:00
|
|
|
DEPENDS
|
|
|
|
${CARLA_UNREAL_CONFIGURE_OUTPUTS}
|
2024-03-21 02:38:23 +08:00
|
|
|
USES_TERMINAL
|
|
|
|
VERBATIM
|
2024-03-09 03:31:22 +08:00
|
|
|
)
|
|
|
|
|
2024-03-21 17:26:02 +08:00
|
|
|
add_dependencies (
|
2024-04-02 18:05:55 +08:00
|
|
|
carla-unreal
|
2024-03-21 17:26:02 +08:00
|
|
|
${UE_DEPENDENCIES_ORDER_ONLY}
|
|
|
|
)
|
|
|
|
|
2024-05-15 23:50:06 +08:00
|
|
|
carla_add_custom_target (
|
2024-04-02 18:05:55 +08:00
|
|
|
carla-unreal-editor
|
2024-05-15 23:50:06 +08:00
|
|
|
"Build the CarlaUnrealEditor subproject."
|
2024-03-12 18:01:37 +08:00
|
|
|
COMMAND
|
2024-05-22 22:22:45 +08:00
|
|
|
${CARLA_UE_BUILD_COMMAND_PREFIX}
|
2024-03-21 02:38:23 +08:00
|
|
|
CarlaUnrealEditor
|
|
|
|
${UE_SYSTEM_NAME}
|
2024-03-21 03:41:12 +08:00
|
|
|
${CARLA_UNREAL_BUILD_TYPE}
|
2024-03-21 02:38:23 +08:00
|
|
|
-project=${CARLA_UE_PROJECT_PATH}
|
|
|
|
-game
|
|
|
|
-buildscw
|
2024-03-21 03:41:12 +08:00
|
|
|
DEPENDS
|
|
|
|
${CARLA_UNREAL_CONFIGURE_OUTPUTS}
|
2024-03-12 18:01:37 +08:00
|
|
|
USES_TERMINAL
|
|
|
|
VERBATIM
|
|
|
|
)
|
|
|
|
|
2024-03-21 17:26:02 +08:00
|
|
|
add_dependencies (
|
2024-04-02 18:05:55 +08:00
|
|
|
carla-unreal-editor
|
|
|
|
${UE_DEPENDENCIES_ORDER_ONLY}
|
|
|
|
)
|
|
|
|
|
2024-09-12 22:35:45 +08:00
|
|
|
function (
|
|
|
|
add_carla_ue_package_target
|
|
|
|
PACKAGE_CONFIGURATION
|
|
|
|
UE_BUILD_CONFIGURATION)
|
|
|
|
|
|
|
|
set (
|
|
|
|
CARLA_TARGET_PACKAGE_PATH
|
|
|
|
${CARLA_PACKAGE_PATH}/${UE_SYSTEM_NAME}
|
|
|
|
)
|
|
|
|
|
2024-05-15 23:50:06 +08:00
|
|
|
if (NOT "${PACKAGE_CONFIGURATION}" STREQUAL "")
|
|
|
|
set (TARGET_NAME_SUFFIX -${PACKAGE_CONFIGURATION})
|
2024-09-12 22:35:45 +08:00
|
|
|
string (TOLOWER "${TARGET_NAME_SUFFIX}" TARGET_NAME_SUFFIX)
|
|
|
|
else ()
|
|
|
|
set (PACKAGE_CONFIGURATION "default (shipping)")
|
2024-05-15 23:50:06 +08:00
|
|
|
endif ()
|
2024-09-12 22:35:45 +08:00
|
|
|
|
2024-09-19 23:35:18 +08:00
|
|
|
set (TARGET_NAME_SHORT package${TARGET_NAME_SUFFIX})
|
|
|
|
set (TARGET_NAME carla-unreal-${TARGET_NAME_SHORT})
|
|
|
|
|
2024-05-15 23:50:06 +08:00
|
|
|
carla_add_custom_target (
|
2024-09-19 23:35:18 +08:00
|
|
|
${TARGET_NAME}
|
2024-05-15 23:50:06 +08:00
|
|
|
"Create a CARLA package in ${PACKAGE_CONFIGURATION} mode."
|
2024-04-12 17:41:42 +08:00
|
|
|
COMMAND
|
|
|
|
${CARLA_UE_BUILD_COMMAND_PREFIX}
|
|
|
|
CarlaUnreal
|
|
|
|
${UE_SYSTEM_NAME}
|
|
|
|
${UE_BUILD_CONFIGURATION}
|
|
|
|
-project=${CARLA_UE_PROJECT_PATH}
|
|
|
|
-game
|
|
|
|
-buildscw
|
|
|
|
COMMAND
|
|
|
|
${CARLA_UE_UAT_COMMAND_PREFIX}
|
|
|
|
BuildCookRun
|
|
|
|
-project=${CARLA_UE_PROJECT_PATH}
|
|
|
|
-nocompileeditor
|
|
|
|
-nop4
|
|
|
|
-cook
|
|
|
|
-stage
|
|
|
|
-archive
|
|
|
|
-package
|
|
|
|
-iterate
|
|
|
|
-clientconfig=${UE_BUILD_CONFIGURATION}
|
|
|
|
-TargetPlatform=${UE_SYSTEM_NAME}
|
|
|
|
-Platform=${UE_SYSTEM_NAME}
|
|
|
|
-prereqs
|
|
|
|
-build
|
|
|
|
-archivedirectory=${CARLA_PACKAGE_PATH}
|
|
|
|
DEPENDS
|
|
|
|
${CARLA_UNREAL_CONFIGURE_OUTPUTS}
|
|
|
|
USES_TERMINAL
|
|
|
|
VERBATIM
|
|
|
|
)
|
2024-09-19 23:35:18 +08:00
|
|
|
|
2024-05-15 23:50:06 +08:00
|
|
|
add_custom_command (
|
2024-09-19 23:35:18 +08:00
|
|
|
TARGET ${TARGET_NAME}
|
2024-04-12 17:41:42 +08:00
|
|
|
POST_BUILD
|
2024-04-19 17:21:21 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "********** PACKAGE CREATING VERSION FILE UNREAL PACKAGE EXTRA FILES STARTED **********"
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
-DCARLA_SOURCE_DIR=${CARLA_SOURCE_DIR}
|
|
|
|
-DCARLA_UNREAL_ENGINE_PATH=${CARLA_UNREAL_ENGINE_PATH}
|
|
|
|
-DCARLA_PACKAGE_VERSION_FILE=${CARLA_TARGET_PACKAGE_PATH}/VERSION
|
|
|
|
-P${CMAKE_CURRENT_SOURCE_DIR}/Package/CreateCarlaVersionFile.cmake
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "********** PACKAGE VERSION FILE UNREAL PACKAGE EXTRA FILES COMPLETED **********"
|
|
|
|
|
2024-04-15 16:32:06 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "********** PACKAGE REMOVING UNREAL PACKAGE EXTRA FILES STARTED **********"
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
-DCARLA_TARGET_PACKAGE_PATH=${CARLA_TARGET_PACKAGE_PATH}
|
|
|
|
-P${CMAKE_CURRENT_SOURCE_DIR}/Package/RemoveUnrealPackageExtraFiles.cmake
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "********** PACKAGE REMOVING UNREAL PACKAGE EXTRA FILES COMPLETED **********"
|
|
|
|
|
2024-04-12 17:41:42 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "********** PACKAGE COPYING CARLA ADDITIONAL FILES STARTED **********"
|
2024-04-15 16:32:06 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
-DCARLA_SOURCE_DIR=${CARLA_SOURCE_DIR}
|
|
|
|
-DCARLA_TARGET_PACKAGE_PATH=${CARLA_TARGET_PACKAGE_PATH}
|
|
|
|
-DCARLA_BINARY_DIR=${CARLA_BINARY_DIR}
|
|
|
|
-P${CMAKE_CURRENT_SOURCE_DIR}/Package/CopyCarlaAdditionalFiles.cmake
|
2024-04-12 17:41:42 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "********** PACKAGE COPYING CARLA ADDITIONAL FILES COMPLETED **********"
|
|
|
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "********** COMPRESSING PACKAGE STARTED **********"
|
2024-04-15 16:32:06 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
-DCARLA_PACKAGE_PATH=${CARLA_PACKAGE_PATH}
|
|
|
|
-DCARLA_TARGET_PACKAGE_PATH=${CARLA_TARGET_PACKAGE_PATH}
|
|
|
|
-DTARGET_NAME_SUFFIX=${TARGET_NAME_SUFFIX}
|
|
|
|
-P${CMAKE_CURRENT_SOURCE_DIR}/Package/Compress.cmake
|
2024-04-12 17:41:42 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "********** COMPRESSING PACKAGE COMPLETED **********"
|
2024-04-08 21:13:29 +08:00
|
|
|
)
|
|
|
|
|
2024-04-12 17:41:42 +08:00
|
|
|
add_dependencies (
|
2024-09-19 23:35:18 +08:00
|
|
|
${TARGET_NAME}
|
2024-09-18 20:49:14 +08:00
|
|
|
carla-unreal-editor
|
2024-04-12 17:41:42 +08:00
|
|
|
)
|
2024-04-02 18:05:55 +08:00
|
|
|
|
2024-05-15 23:50:06 +08:00
|
|
|
carla_add_custom_target (
|
2024-09-19 23:35:18 +08:00
|
|
|
${TARGET_NAME_SHORT}
|
2024-05-15 23:50:06 +08:00
|
|
|
"Create a CARLA package in ${PACKAGE_CONFIGURATION} mode."
|
2024-04-12 17:41:42 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
add_dependencies (
|
2024-09-19 23:35:18 +08:00
|
|
|
${TARGET_NAME_SHORT}
|
|
|
|
${TARGET_NAME}
|
2024-04-12 17:41:42 +08:00
|
|
|
)
|
2024-09-19 23:35:18 +08:00
|
|
|
|
2024-04-12 17:41:42 +08:00
|
|
|
endfunction()
|
|
|
|
|
2024-09-19 23:35:18 +08:00
|
|
|
|
|
|
|
|
2024-04-12 17:41:42 +08:00
|
|
|
# Docs for UE5 build configurations:
|
|
|
|
# https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/DevelopmentSetup/BuildConfigurations/
|
|
|
|
add_carla_ue_package_target("" Shipping)
|
2024-05-15 23:50:06 +08:00
|
|
|
add_carla_ue_package_target(Shipping Shipping)
|
|
|
|
add_carla_ue_package_target(Debug Debug)
|
|
|
|
add_carla_ue_package_target(DebugGame DebugGame)
|
|
|
|
add_carla_ue_package_target(Development Development)
|
|
|
|
add_carla_ue_package_target(Test Test)
|
2024-03-21 17:26:02 +08:00
|
|
|
|
2024-03-15 02:08:12 +08:00
|
|
|
|
2024-03-21 03:05:54 +08:00
|
|
|
|
|
|
|
set (
|
|
|
|
CARLA_LAUNCH_TARGET_OPTIONS
|
2024-03-15 03:03:32 +08:00
|
|
|
COMMENT
|
|
|
|
"Launching Carla Unreal..."
|
|
|
|
COMMAND
|
2024-03-21 03:05:54 +08:00
|
|
|
${UNREAL_EDITOR_PATH}
|
|
|
|
${CARLA_UE_PROJECT_PATH}
|
|
|
|
-${CARLA_UNREAL_RHI}
|
|
|
|
${LAUNCH_ARGS}
|
2024-03-15 03:03:32 +08:00
|
|
|
USES_TERMINAL
|
|
|
|
VERBATIM
|
2024-03-15 02:08:12 +08:00
|
|
|
)
|
|
|
|
|
2024-03-26 21:55:35 +08:00
|
|
|
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 ()
|
|
|
|
|
2024-05-15 23:50:06 +08:00
|
|
|
carla_add_custom_target (
|
|
|
|
check-unreal-content
|
|
|
|
"Perform some basic checks to ensure that the CARLA Unreal Editor will not open without its assets."
|
2024-03-26 21:55:35 +08:00
|
|
|
COMMAND
|
|
|
|
${PRELAUNCH_CONTENT_CHECK_COMMAND}
|
|
|
|
COMMENT
|
|
|
|
"Performing prelaunch check for CARLA Content presence."
|
|
|
|
USES_TERMINAL
|
|
|
|
VERBATIM
|
|
|
|
)
|
|
|
|
|
2024-09-19 23:35:18 +08:00
|
|
|
carla_add_custom_target (
|
|
|
|
launch-only
|
|
|
|
"Open CARLA in the Unreal Editor. This will not rebuild outdated targets."
|
|
|
|
${CARLA_LAUNCH_TARGET_OPTIONS}
|
|
|
|
)
|
|
|
|
|
2024-03-12 18:01:37 +08:00
|
|
|
add_dependencies (
|
2024-09-19 23:35:18 +08:00
|
|
|
launch-only
|
2024-05-15 23:50:06 +08:00
|
|
|
check-unreal-content
|
2024-03-09 03:31:22 +08:00
|
|
|
)
|
2024-03-21 03:05:54 +08:00
|
|
|
|
2024-05-15 23:50:06 +08:00
|
|
|
carla_add_custom_target (
|
2024-09-19 23:35:18 +08:00
|
|
|
launch
|
|
|
|
"Build and open CARLA in the Unreal Editor."
|
2024-03-21 03:05:54 +08:00
|
|
|
${CARLA_LAUNCH_TARGET_OPTIONS}
|
|
|
|
)
|
2024-03-26 21:55:35 +08:00
|
|
|
|
|
|
|
add_dependencies (
|
2024-09-19 23:35:18 +08:00
|
|
|
launch
|
|
|
|
carla-unreal-editor
|
2024-05-15 23:50:06 +08:00
|
|
|
check-unreal-content
|
2024-03-26 21:55:35 +08:00
|
|
|
)
|
2024-04-22 20:10:58 +08:00
|
|
|
|
2024-05-15 23:50:06 +08:00
|
|
|
set_property (
|
2024-05-22 22:22:45 +08:00
|
|
|
DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES
|
|
|
|
"${CARLA_UE_PATH}/Binaries"
|
|
|
|
"${CARLA_UE_PATH}/Build"
|
|
|
|
"${CARLA_UE_PATH}/DerivedDataCache"
|
2024-04-22 20:10:58 +08:00
|
|
|
"${CARLA_UE_PATH}/Intermediate"
|
|
|
|
"${CARLA_UE_PATH}/Saved"
|
2024-05-22 22:22:45 +08:00
|
|
|
"${CARLA_UE_CARLA_TOOLS_PATH}/Binaries"
|
2024-04-22 20:10:58 +08:00
|
|
|
"${CARLA_UE_CARLA_TOOLS_PATH}/Intermediate"
|
|
|
|
"${CARLA_UE_CARLA_TOOLS_PATH}/Saved"
|
2024-05-22 22:22:45 +08:00
|
|
|
"${CARLA_UE_CARLA_EXPORTER_PATH}/Binaries"
|
|
|
|
"${CARLA_UE_CARLA_EXPORTER_PATH}/Intermediate"
|
|
|
|
"${CARLA_UE_CARLA_EXPORTER_PATH}/Saved"
|
|
|
|
"${CARLA_UE_CARLA_PATH}/Binaries"
|
2024-04-22 20:10:58 +08:00
|
|
|
"${CARLA_UE_CARLA_PATH}/Intermediate"
|
|
|
|
"${CARLA_UE_CARLA_PATH}/Saved"
|
2024-05-22 22:22:45 +08:00
|
|
|
"${CARLA_UE_PLUGINS_PATH}/StreetMap/Binaries"
|
|
|
|
"${CARLA_UE_PLUGINS_PATH}/StreetMap/Intermediate"
|
|
|
|
"${CARLA_UE_PLUGINS_PATH}/StreetMap/Saved"
|
2024-04-22 20:10:58 +08:00
|
|
|
"${CARLA_BUILD_PATH}/Package"
|
2024-04-22 22:41:30 +08:00
|
|
|
"${CARLA_BUILD_PATH}/PythonAPI/dist"
|
2024-05-15 23:50:06 +08:00
|
|
|
)
|