diff --git a/Unreal/CMakeLists.txt b/Unreal/CMakeLists.txt index dbef425c0..69bd1dbb4 100644 --- a/Unreal/CMakeLists.txt +++ b/Unreal/CMakeLists.txt @@ -368,42 +368,26 @@ function(add_carla_ue_package_target TARGET_NAME_SUFFIX UE_BUILD_CONFIGURATION) add_custom_command( TARGET carla-unreal-package${TARGET_NAME_SUFFIX} POST_BUILD + 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 **********" + COMMAND ${CMAKE_COMMAND} -E echo "********** PACKAGE COPYING CARLA ADDITIONAL FILES STARTED **********" - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/LICENSE ${CARLA_TARGET_PACKAGE_PATH}/LICENSE - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/CHANGELOG.md ${CARLA_TARGET_PACKAGE_PATH}/CHANGELOG - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Docs/release_readme.md ${CARLA_TARGET_PACKAGE_PATH}/README - - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Docs/python_api.md ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/python_api.md - COMMAND ${CMAKE_COMMAND} -E make_directory ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/carla/dist - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/PythonAPI/dist/carla-*.whl ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/carla/dist/ - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/PythonAPI/carla/agents/ ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/carla/agents/ - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/PythonAPI/carla/scene_layout.py ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/carla/ - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/PythonAPI/carla/requirements.txt ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/carla/ - - COMMAND ${CMAKE_COMMAND} -E make_directory ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/examples/ - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/PythonAPI/examples/*.py ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/examples/ - COMMAND ${CMAKE_COMMAND} -E make_directory ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/examples/rss/ - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/PythonAPI/examples/rss/*.py ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/examples/rss/ - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/PythonAPI/examples/requirements.txt ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/examples/ - - COMMAND ${CMAKE_COMMAND} -E make_directory ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/util/ - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/PythonAPI/util/*.py ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/util/ - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/PythonAPI/util/requirements.txt ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/util/ - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/PythonAPI/util/opendrive/ ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/util/opendrive/ - - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Co-Simulation/ ${CARLA_TARGET_PACKAGE_PATH}/Co-Simulation/ - - COMMAND ${CMAKE_COMMAND} -E make_directory ${CARLA_TARGET_PACKAGE_PATH}/HDMaps/ - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Unreal/CarlaUnreal/Content/Carla/HDMaps/*.pcd ${CARLA_TARGET_PACKAGE_PATH}/HDMaps/ - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Unreal/CarlaUnreal/Content/Carla/HDMaps/Readme.md ${CARLA_TARGET_PACKAGE_PATH}/HDMaps/README - - COMMAND ${CMAKE_COMMAND} -E remove ${CARLA_TARGET_PACKAGE_PATH}/Manifest_NonUFSFiles_Linux.txt - COMMAND ${CMAKE_COMMAND} -E remove ${CARLA_TARGET_PACKAGE_PATH}/Manifest_UFSFiles_Linux.txt - COMMAND ${CMAKE_COMMAND} -E remove ${CARLA_TARGET_PACKAGE_PATH}/Manifest_DebugFiles_Linux.txt + 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 COMMAND ${CMAKE_COMMAND} -E echo "********** PACKAGE COPYING CARLA ADDITIONAL FILES COMPLETED **********" COMMAND ${CMAKE_COMMAND} -E echo "********** COMPRESSING PACKAGE STARTED **********" - COMMAND ${CMAKE_COMMAND} -E chdir ${CARLA_TARGET_PACKAGE_PATH} cmake -E tar cfvz ${CARLA_PACKAGE_PATH}/CARLA${TARGET_NAME_SUFFIX}.tar.gz ${CARLA_TARGET_PACKAGE_PATH}/* + 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 COMMAND ${CMAKE_COMMAND} -E echo "********** COMPRESSING PACKAGE COMPLETED **********" ) @@ -414,7 +398,6 @@ function(add_carla_ue_package_target TARGET_NAME_SUFFIX UE_BUILD_CONFIGURATION) add_custom_target ( package${TARGET_NAME_SUFFIX} - ${CARLA_LAUNCH_TARGET_OPTIONS} ) add_dependencies ( diff --git a/Unreal/Package/Compress.cmake b/Unreal/Package/Compress.cmake new file mode 100644 index 000000000..c749c7cc7 --- /dev/null +++ b/Unreal/Package/Compress.cmake @@ -0,0 +1,12 @@ +set (CARLA_PACKAGE_FILE_NAME_WITHOUT_EXTENSION ${CARLA_PACKAGE_PATH}/CARLA${TARGET_NAME_SUFFIX}) +if (WIN32) + set(CARLA_PACKAGE_FILE_NAME_AND_ARGS cvf ${CARLA_PACKAGE_FILE_NAME_WITHOUT_EXTENSION}.zip --format=zip) +else() + set(CARLA_PACKAGE_FILE_NAME_AND_ARGS cvfz ${CARLA_PACKAGE_FILE_NAME_WITHOUT_EXTENSION}.tar.gz) +endif() + +file(GLOB CARLA_PACKAGE_FILES ${CARLA_TARGET_PACKAGE_PATH}/*) + +execute_process( + COMMAND cmake -E tar ${CARLA_PACKAGE_FILE_NAME_AND_ARGS} ${CARLA_PACKAGE_FILES} + WORKING_DIRECTORY ${CARLA_TARGET_PACKAGE_PATH}) diff --git a/Unreal/Package/CopyCarlaAdditionalFiles.cmake b/Unreal/Package/CopyCarlaAdditionalFiles.cmake new file mode 100644 index 000000000..51b066669 --- /dev/null +++ b/Unreal/Package/CopyCarlaAdditionalFiles.cmake @@ -0,0 +1,33 @@ +message("${CARLA_SOURCE_DIR} ${CARLA_TARGET_PACKAGE_PATH} ${CARLA_BINARY_DIR}") +file(COPY_FILE ${CARLA_SOURCE_DIR}/LICENSE ${CARLA_TARGET_PACKAGE_PATH}/LICENSE) +file(COPY_FILE ${CARLA_SOURCE_DIR}/CHANGELOG.md ${CARLA_TARGET_PACKAGE_PATH}/CHANGELOG) +file(COPY_FILE ${CARLA_SOURCE_DIR}/Docs/release_readme.md ${CARLA_TARGET_PACKAGE_PATH}/README) + +make_directory(${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/carla/dist) +file(GLOB PYTHON_WHL_FILES ${CARLA_BINARY_DIR}/PythonAPI/dist/carla-*.whl) +file(COPY ${PYTHON_WHL_FILES} DESTINATION ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/carla/dist/) +file(COPY_FILE ${CARLA_SOURCE_DIR}/Docs/python_api.md ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/python_api.md) +file(COPY ${CARLA_SOURCE_DIR}/PythonAPI/carla/agents/ DESTINATION ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/carla/agents/) +file(COPY_FILE ${CARLA_SOURCE_DIR}/PythonAPI/carla/scene_layout.py ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/carla/scene_layout.py) +file(COPY_FILE ${CARLA_SOURCE_DIR}/PythonAPI/carla/requirements.txt ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/carla/requirements.txt) + +make_directory(${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/examples/) +file(GLOB PYTHON_EXAMPLE_FILES ${CARLA_SOURCE_DIR}/PythonAPI/examples/*.py) +file(COPY ${PYTHON_EXAMPLE_FILES} DESTINATION ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/examples/) +make_directory(${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/examples/rss/) +file(GLOB PYTHON_EXAMPLE_RSS_FILES ${CARLA_SOURCE_DIR}/PythonAPI/examples/rss/*.py) +file(COPY ${PYTHON_EXAMPLE_RSS_FILES} DESTINATION ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/examples/rss/) +file(COPY_FILE ${CARLA_SOURCE_DIR}/PythonAPI/examples/requirements.txt ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/examples/requirements.txt) + +make_directory(${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/util/) +file(GLOB PYTHON_UTIL_FILES ${CARLA_SOURCE_DIR}/PythonAPI/util/*.py) +file(COPY ${PYTHON_UTIL_FILES} DESTINATION ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/util/) +file(COPY_FILE ${CARLA_SOURCE_DIR}/PythonAPI/util/requirements.txt ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/util/requirements.txt) +file(COPY ${CARLA_SOURCE_DIR}/PythonAPI/util/opendrive/ DESTINATION ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/util/opendrive/) + +file(COPY ${CARLA_SOURCE_DIR}/Co-Simulation/ DESTINATION ${CARLA_TARGET_PACKAGE_PATH}/Co-Simulation/) + +make_directory(${CARLA_TARGET_PACKAGE_PATH}/HDMaps/) +file(GLOB PYTHON_HDMAP_FILES ${CARLA_SOURCE_DIR}/Unreal/CarlaUnreal/Content/Carla/HDMaps/*.pcd) +file(COPY ${PYTHON_HDMAP_FILES} DESTINATION ${CARLA_TARGET_PACKAGE_PATH}/HDMaps/) +file(COPY_FILE ${CARLA_SOURCE_DIR}/Unreal/CarlaUnreal/Content/Carla/HDMaps/Readme.md ${CARLA_TARGET_PACKAGE_PATH}/HDMaps/README) diff --git a/Unreal/Package/RemoveUnrealPackageExtraFiles.cmake b/Unreal/Package/RemoveUnrealPackageExtraFiles.cmake new file mode 100644 index 000000000..a90810107 --- /dev/null +++ b/Unreal/Package/RemoveUnrealPackageExtraFiles.cmake @@ -0,0 +1,3 @@ +file(REMOVE ${CARLA_TARGET_PACKAGE_PATH}/Manifest_NonUFSFiles_Linux.txt) +file(REMOVE ${CARLA_TARGET_PACKAGE_PATH}/Manifest_UFSFiles_Linux.txt) +file(REMOVE ${CARLA_TARGET_PACKAGE_PATH}/Manifest_DebugFiles_Linux.txt)