2024-03-04 20:10:00 +08:00
|
|
|
project (
|
|
|
|
carla-ue
|
|
|
|
)
|
|
|
|
|
|
|
|
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-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-03-09 03:31:22 +08:00
|
|
|
if (WIN32)
|
|
|
|
set (
|
2024-03-11 19:30:24 +08:00
|
|
|
CARLA_UE_GENERATE_PROJECT_FILES_COMMAND
|
2024-03-09 03:31:22 +08:00
|
|
|
${CARLA_UNREAL_ENGINE_PATH}/GenerateProjectFiles.bat
|
2024-03-11 19:30:24 +08:00
|
|
|
-project=${CARLA_UE_PROJECT_PATH}
|
|
|
|
-CMakefile
|
|
|
|
-game
|
|
|
|
-engine
|
2024-03-12 18:01:37 +08:00
|
|
|
-progress
|
2024-03-09 03:31:22 +08:00
|
|
|
)
|
|
|
|
else ()
|
|
|
|
set (
|
2024-03-11 19:30:24 +08:00
|
|
|
CARLA_UE_GENERATE_PROJECT_FILES_COMMAND
|
2024-03-09 03:31:22 +08:00
|
|
|
${CARLA_UNREAL_ENGINE_PATH}/GenerateProjectFiles.sh
|
2024-03-11 19:30:24 +08:00
|
|
|
-project=${CARLA_UE_PROJECT_PATH}
|
|
|
|
-CMakefile
|
|
|
|
-game
|
|
|
|
-engine
|
2024-03-12 18:01:37 +08:00
|
|
|
-progress
|
2024-03-09 03:31:22 +08:00
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
2024-03-12 18:01:37 +08:00
|
|
|
set (CMAKE_NINJA_FORCE_RESPONSE_FILE ON)
|
|
|
|
|
2024-03-07 00:20:13 +08:00
|
|
|
|
|
|
|
|
2024-03-08 00:11:15 +08:00
|
|
|
add_custom_command (
|
2024-03-12 18:01:37 +08:00
|
|
|
OUTPUT
|
|
|
|
${CARLA_UE_PATH}/CMakeLists.txt
|
2024-03-07 00:20:13 +08:00
|
|
|
COMMENT
|
|
|
|
"Generating UE project files for CARLA..."
|
2024-03-04 20:10:00 +08:00
|
|
|
COMMAND
|
2024-03-11 19:30:24 +08:00
|
|
|
${CARLA_UE_GENERATE_PROJECT_FILES_COMMAND}
|
2024-03-11 04:42:58 +08:00
|
|
|
# Remember to add this on most Unreal-related commands,
|
|
|
|
# otherwise nothing is printed while running the command:
|
|
|
|
USES_TERMINAL
|
2024-03-12 18:01:37 +08:00
|
|
|
VERBATIM
|
2024-03-04 20:10:00 +08:00
|
|
|
)
|
|
|
|
|
2024-03-07 00:20:13 +08:00
|
|
|
add_custom_target (
|
2024-03-08 00:11:15 +08:00
|
|
|
carla-ue-generate-project-files
|
2024-03-11 19:30:24 +08:00
|
|
|
DEPENDS
|
|
|
|
${CARLA_UE_PATH}/CMakeLists.txt
|
2024-03-08 00:11:15 +08:00
|
|
|
)
|
|
|
|
|
2024-03-12 18:01:37 +08:00
|
|
|
add_dependencies (
|
|
|
|
carla-ue-generate-project-files
|
|
|
|
carla-server
|
|
|
|
)
|
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
|
|
|
|
|
|
|
|
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-08 00:11:15 +08:00
|
|
|
add_custom_command (
|
2024-03-12 18:01:37 +08:00
|
|
|
OUTPUT
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/carla-ue-configure.stamp
|
2024-03-08 00:11:15 +08:00
|
|
|
COMMENT
|
|
|
|
"Configuring Carla Unreal..."
|
2024-03-09 03:31:22 +08:00
|
|
|
COMMAND
|
2024-03-11 19:30:24 +08:00
|
|
|
${CMAKE_COMMAND}
|
|
|
|
-S ${CARLA_UE_PATH}
|
|
|
|
-B ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${TOOLCHAIN_FILE_OPTION}
|
2024-03-08 00:11:15 +08:00
|
|
|
COMMAND
|
|
|
|
${CMAKE_COMMAND}
|
2024-03-11 19:30:24 +08:00
|
|
|
-E touch carla-ue-configure.stamp
|
2024-03-11 04:42:58 +08:00
|
|
|
USES_TERMINAL
|
2024-03-12 18:01:37 +08:00
|
|
|
VERBATIM
|
2024-03-08 00:11:15 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target (
|
|
|
|
carla-ue-configure
|
2024-03-07 00:20:13 +08:00
|
|
|
DEPENDS
|
2024-03-08 00:11:15 +08:00
|
|
|
carla-ue-configure.stamp
|
|
|
|
)
|
|
|
|
|
2024-03-12 18:01:37 +08:00
|
|
|
add_dependencies (
|
|
|
|
carla-ue-configure
|
|
|
|
carla-ue-generate-project-files
|
|
|
|
)
|
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
|
|
|
|
|
2024-03-08 00:11:15 +08:00
|
|
|
add_custom_command (
|
2024-03-12 18:01:37 +08:00
|
|
|
OUTPUT
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/carla-ue.stamp
|
2024-03-07 00:20:13 +08:00
|
|
|
COMMENT
|
2024-03-08 00:11:15 +08:00
|
|
|
"Building Carla Unreal..."
|
2024-03-07 00:20:13 +08:00
|
|
|
COMMAND
|
|
|
|
${CMAKE_COMMAND}
|
2024-03-08 00:11:15 +08:00
|
|
|
--build ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
--target CarlaUnrealEditor
|
2024-03-11 19:30:24 +08:00
|
|
|
COMMAND
|
|
|
|
${CMAKE_COMMAND}
|
|
|
|
-E touch carla-ue.stamp
|
2024-03-11 04:42:58 +08:00
|
|
|
USES_TERMINAL
|
2024-03-12 18:01:37 +08:00
|
|
|
VERBATIM
|
2024-03-08 00:11:15 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target (
|
|
|
|
carla-ue
|
|
|
|
DEPENDS
|
|
|
|
carla-ue.stamp
|
2024-03-07 00:20:13 +08:00
|
|
|
)
|
2024-03-04 20:10:00 +08:00
|
|
|
|
2024-03-12 18:01:37 +08:00
|
|
|
add_dependencies (
|
|
|
|
carla-ue
|
|
|
|
carla-ue-configure
|
|
|
|
)
|
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
|
|
|
|
|
2024-03-11 16:20:27 +08:00
|
|
|
if (WIN32)
|
|
|
|
set (EXE_EXT .exe)
|
|
|
|
else ()
|
|
|
|
set (EXE_EXT)
|
|
|
|
endif ()
|
|
|
|
|
2024-03-11 16:13:55 +08:00
|
|
|
if (WIN32)
|
|
|
|
set (UE_SYSTEM_NAME Win64)
|
|
|
|
elseif (LINUX)
|
|
|
|
set (UE_SYSTEM_NAME Linux)
|
|
|
|
else ()
|
|
|
|
endif ()
|
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
add_custom_target (
|
|
|
|
launch-only
|
2024-03-12 18:01:37 +08:00
|
|
|
COMMENT
|
|
|
|
"Launching Carla Unreal..."
|
2024-03-09 03:31:22 +08:00
|
|
|
COMMAND
|
2024-03-11 16:20:27 +08:00
|
|
|
${CARLA_UNREAL_ENGINE_PATH}/Engine/Binaries/${UE_SYSTEM_NAME}/UnrealEditor${EXE_EXT}
|
2024-03-11 19:30:24 +08:00
|
|
|
${CARLA_UE_PROJECT_PATH}
|
|
|
|
-${CARLA_UNREAL_RHI}
|
|
|
|
${LAUNCH_ARGS}
|
2024-03-11 04:42:58 +08:00
|
|
|
USES_TERMINAL
|
2024-03-12 18:01:37 +08:00
|
|
|
VERBATIM
|
2024-03-09 03:31:22 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
add_custom_target (
|
|
|
|
launch
|
2024-03-12 18:01:37 +08:00
|
|
|
COMMENT
|
|
|
|
"Launching Carla Unreal..."
|
|
|
|
COMMAND
|
|
|
|
${CARLA_UNREAL_ENGINE_PATH}/Engine/Binaries/${UE_SYSTEM_NAME}/UnrealEditor${EXE_EXT}
|
|
|
|
${CARLA_UE_PROJECT_PATH}
|
|
|
|
-${CARLA_UNREAL_RHI}
|
|
|
|
${LAUNCH_ARGS}
|
|
|
|
USES_TERMINAL
|
|
|
|
VERBATIM
|
|
|
|
)
|
|
|
|
|
|
|
|
add_dependencies (
|
|
|
|
launch
|
|
|
|
carla-ue
|
2024-03-09 03:31:22 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-04 20:10:00 +08:00
|
|
|
file (
|
|
|
|
MAKE_DIRECTORY
|
|
|
|
${CARLA_UE_PATH}/Content/Carla/ExportedMaps
|
2024-03-09 03:31:22 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
carla_two_step_configure_file (
|
|
|
|
${CARLA_UE_PLUGINS_PATH}/Carla/Source/Carla/Carla.Build.cs
|
|
|
|
${CARLA_UE_PLUGINS_PATH}/Carla/Source/Carla/Carla.Build.cs.in
|
|
|
|
)
|
|
|
|
|
|
|
|
carla_two_step_configure_file (
|
|
|
|
${CARLA_UE_PLUGINS_PATH}/CarlaTools/Source/CarlaTools/CarlaTools.Build.cs
|
|
|
|
${CARLA_UE_PLUGINS_PATH}/CarlaTools/Source/CarlaTools/CarlaTools.Build.cs.in
|
2024-03-04 20:10:00 +08:00
|
|
|
)
|