2024-03-09 03:31:22 +08:00
|
|
|
#[[
|
2024-02-20 23:34:31 +08:00
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
Copyright (c) 2024 Computer Vision Center (CVC) at the Universitat Autonoma
|
|
|
|
de Barcelona (UAB).
|
|
|
|
|
|
|
|
This work is licensed under the terms of the MIT license.
|
|
|
|
For a copy, see <https://opensource.org/licenses/MIT>.
|
2024-03-01 23:27:12 +08:00
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
]]
|
2024-03-01 23:27:12 +08:00
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
include (FetchContent)
|
2024-03-08 16:47:18 +08:00
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
set (CARLA_DEPENDENCIES_PENDING)
|
|
|
|
|
2024-09-12 22:35:45 +08:00
|
|
|
macro (carla_git_dependency_add NAME TAG ARCHIVE_URL GIT_URL)
|
|
|
|
carla_message ("Cloning ${NAME}...")
|
|
|
|
FetchContent_Declare (
|
|
|
|
${NAME}
|
|
|
|
GIT_REPOSITORY ${GIT_URL}
|
|
|
|
GIT_TAG ${TAG}
|
|
|
|
GIT_SUBMODULES_RECURSE ON
|
|
|
|
GIT_SHALLOW ON
|
|
|
|
GIT_PROGRESS ON
|
|
|
|
OVERRIDE_FIND_PACKAGE
|
|
|
|
${ARGN}
|
|
|
|
)
|
|
|
|
list (APPEND CARLA_DEPENDENCIES_PENDING ${NAME})
|
|
|
|
endmacro ()
|
|
|
|
|
|
|
|
macro (carla_download_dependency_add NAME TAG ARCHIVE_URL GIT_URL)
|
|
|
|
carla_message ("Downloading ${NAME}...")
|
|
|
|
FetchContent_Declare (
|
|
|
|
${NAME}
|
|
|
|
URL ${ARCHIVE_URL}
|
|
|
|
OVERRIDE_FIND_PACKAGE
|
|
|
|
${ARGN}
|
|
|
|
)
|
|
|
|
list (APPEND CARLA_DEPENDENCIES_PENDING ${NAME})
|
|
|
|
endmacro ()
|
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
macro (carla_dependency_add NAME TAG ARCHIVE_URL GIT_URL)
|
|
|
|
if (PREFER_CLONE)
|
2024-09-16 23:13:36 +08:00
|
|
|
carla_git_dependency_add (${NAME} ${TAG} ${ARCHIVE_URL} ${GIT_URL} ${ARGN})
|
2024-03-09 03:31:22 +08:00
|
|
|
else ()
|
2024-09-16 23:13:36 +08:00
|
|
|
carla_download_dependency_add (${NAME} ${TAG} ${ARCHIVE_URL} ${GIT_URL} ${ARGN})
|
2024-03-09 03:31:22 +08:00
|
|
|
endif ()
|
2024-03-08 16:47:18 +08:00
|
|
|
endmacro ()
|
2024-03-01 23:27:12 +08:00
|
|
|
|
2024-03-08 16:47:18 +08:00
|
|
|
macro (carla_dependencies_make_available)
|
|
|
|
FetchContent_MakeAvailable (
|
2024-03-09 03:31:22 +08:00
|
|
|
${CARLA_DEPENDENCIES_PENDING})
|
|
|
|
set (CARLA_DEPENDENCIES_PENDING)
|
2024-03-08 16:47:18 +08:00
|
|
|
endmacro ()
|
|
|
|
|
2024-03-20 18:34:44 +08:00
|
|
|
macro (carla_dependency_option NAME VALUE)
|
2024-03-08 16:47:18 +08:00
|
|
|
set (${NAME} ${VALUE} CACHE INTERNAL "")
|
|
|
|
endmacro ()
|
2024-03-01 23:27:12 +08:00
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
|
|
|
|
|
|
|
|
# ==== SQLITE3 ====
|
|
|
|
|
|
|
|
set (THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package (Threads REQUIRED)
|
2024-03-04 20:10:00 +08:00
|
|
|
|
2024-02-20 23:34:31 +08:00
|
|
|
string (REPLACE "." "" CARLA_SQLITE_TAG ${CARLA_SQLITE_VERSION})
|
|
|
|
|
2024-03-20 18:34:44 +08:00
|
|
|
carla_message ("Downloading sqlite3...")
|
|
|
|
FetchContent_Declare (
|
2024-02-20 23:34:31 +08:00
|
|
|
sqlite3
|
2024-03-20 18:34:44 +08:00
|
|
|
URL https://www.sqlite.org/2024/sqlite-amalgamation-${CARLA_SQLITE_TAG}.zip
|
|
|
|
OVERRIDE_FIND_PACKAGE
|
2024-02-20 23:34:31 +08:00
|
|
|
)
|
2024-03-20 18:34:44 +08:00
|
|
|
FetchContent_MakeAvailable (sqlite3)
|
2024-02-20 23:34:31 +08:00
|
|
|
|
|
|
|
add_library (
|
|
|
|
libsqlite3 STATIC
|
|
|
|
${sqlite3_SOURCE_DIR}/sqlite3.h
|
|
|
|
${sqlite3_SOURCE_DIR}/sqlite3.c
|
|
|
|
)
|
|
|
|
|
|
|
|
add_executable (
|
|
|
|
sqlite3
|
|
|
|
${sqlite3_SOURCE_DIR}/shell.c
|
|
|
|
)
|
|
|
|
|
2024-03-01 23:27:12 +08:00
|
|
|
if (LINUX)
|
|
|
|
target_link_libraries (libsqlite3 PRIVATE ${CMAKE_DL_LIBS})
|
|
|
|
target_link_libraries (libsqlite3 PRIVATE Threads::Threads)
|
|
|
|
endif ()
|
|
|
|
|
2024-02-20 23:34:31 +08:00
|
|
|
target_link_libraries (
|
|
|
|
sqlite3 PRIVATE
|
|
|
|
libsqlite3
|
|
|
|
)
|
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
|
2024-09-19 23:35:18 +08:00
|
|
|
|
|
|
|
# ==== ZLIB ====
|
2024-03-20 18:34:44 +08:00
|
|
|
carla_dependency_option (ZLIB_BUILD_EXAMPLES OFF)
|
2024-03-09 03:31:22 +08:00
|
|
|
carla_dependency_add (
|
2024-02-20 23:34:31 +08:00
|
|
|
zlib
|
2024-03-09 03:31:22 +08:00
|
|
|
${CARLA_ZLIB_TAG}
|
2024-03-08 16:47:18 +08:00
|
|
|
https://github.com/madler/zlib/archive/refs/tags/${CARLA_ZLIB_TAG}.zip
|
2024-03-09 03:31:22 +08:00
|
|
|
https://github.com/madler/zlib.git
|
2024-02-20 23:34:31 +08:00
|
|
|
)
|
|
|
|
carla_dependencies_make_available ()
|
2024-03-20 18:34:44 +08:00
|
|
|
include_directories (
|
|
|
|
${zlib_SOURCE_DIR}
|
|
|
|
${zlib_BINARY_DIR}
|
|
|
|
) # @TODO HACK
|
2024-03-21 02:52:17 +08:00
|
|
|
|
|
|
|
if (WIN32)
|
2024-03-21 02:54:08 +08:00
|
|
|
carla_dependency_option (ZLIB_LIBRARY ${zlib_BINARY_DIR}/zlibstatic${CARLA_DEBUG_AFFIX}.lib)
|
2024-03-21 02:52:17 +08:00
|
|
|
else ()
|
2024-03-21 02:54:08 +08:00
|
|
|
carla_dependency_option (ZLIB_LIBRARY ${zlib_BINARY_DIR}/libz.a)
|
2024-03-21 02:52:17 +08:00
|
|
|
endif ()
|
2024-03-21 02:54:08 +08:00
|
|
|
carla_dependency_option (ZLIB_INCLUDE_DIRS ${zlib_SOURCE_DIR} ${zlib_BINARY_DIR})
|
|
|
|
carla_dependency_option (ZLIB_LIBRARIES ${ZLIB_LIBRARY})
|
2024-02-20 23:34:31 +08:00
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
|
2024-09-19 23:35:18 +08:00
|
|
|
|
|
|
|
# ==== LIBPNG ====
|
2024-03-20 18:34:44 +08:00
|
|
|
carla_dependency_option (PNG_SHARED OFF)
|
|
|
|
carla_dependency_option (PNG_STATIC ON)
|
|
|
|
if (APPLE)
|
|
|
|
carla_dependency_option (PNG_FRAMEWORK OFF)
|
2024-02-27 00:09:02 +08:00
|
|
|
endif ()
|
2024-03-20 18:34:44 +08:00
|
|
|
carla_dependency_option (PNG_TESTS OFF)
|
|
|
|
carla_dependency_option (PNG_TOOLS OFF)
|
|
|
|
carla_dependency_option (PNG_DEBUG OFF)
|
|
|
|
carla_dependency_option (PNG_HARDWARE_OPTIMIZATIONS ON)
|
2024-03-09 03:31:22 +08:00
|
|
|
carla_dependency_add (
|
2024-02-20 23:34:31 +08:00
|
|
|
libpng
|
2024-03-09 03:31:22 +08:00
|
|
|
${CARLA_LIBPNG_TAG}
|
2024-03-08 16:47:18 +08:00
|
|
|
https://github.com/pnggroup/libpng/archive/refs/tags/${CARLA_LIBPNG_TAG}.zip
|
2024-03-20 18:34:44 +08:00
|
|
|
https://github.com/pnggroup/libpng.git
|
2024-02-20 23:34:31 +08:00
|
|
|
)
|
|
|
|
carla_dependencies_make_available ()
|
2024-03-20 18:34:44 +08:00
|
|
|
include_directories (
|
|
|
|
${libpng_SOURCE_DIR}
|
|
|
|
${libpng_BINARY_DIR}
|
|
|
|
) # @TODO HACK
|
2024-02-20 23:34:31 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
# ==== BOOST ====
|
2024-03-11 19:30:24 +08:00
|
|
|
set (
|
2024-03-17 18:46:19 +08:00
|
|
|
BOOST_INCLUDED_PROJECTS
|
|
|
|
asio
|
|
|
|
iterator
|
|
|
|
python
|
|
|
|
date_time
|
|
|
|
geometry
|
|
|
|
container
|
|
|
|
variant2
|
2024-09-19 23:35:18 +08:00
|
|
|
gil
|
|
|
|
)
|
|
|
|
set (
|
|
|
|
BOOST_EXCLUDED_PROJECTS
|
|
|
|
# filesystem # <- Boost.GIL links with Boost.filesystem, so we can't remove the dependency yet.
|
2024-03-11 19:30:24 +08:00
|
|
|
)
|
2024-03-20 18:34:44 +08:00
|
|
|
carla_dependency_option (BOOST_INCLUDE_LIBRARIES "${BOOST_INCLUDED_PROJECTS}")
|
2024-09-19 23:35:18 +08:00
|
|
|
carla_dependency_option (BOOST_EXCLUDE_LIBRARIES "${BOOST_EXCLUDED_PROJECTS}")
|
|
|
|
carla_dependency_option (BOOST_ENABLE_PYTHON ${BUILD_PYTHON_API})
|
|
|
|
carla_dependency_option (BOOST_ENABLE_MPI OFF)
|
|
|
|
carla_dependency_option (BOOST_LOCALE_WITH_ICU OFF)
|
|
|
|
carla_dependency_option (BOOST_LOCALE_WITH_ICONV OFF)
|
|
|
|
carla_dependency_option (BOOST_GIL_BUILD_EXAMPLES OFF)
|
|
|
|
carla_dependency_option (BOOST_GIL_BUILD_HEADER_TESTS OFF)
|
2024-03-09 03:31:22 +08:00
|
|
|
carla_dependency_add(
|
2024-02-20 23:34:31 +08:00
|
|
|
boost
|
2024-03-09 03:31:22 +08:00
|
|
|
${CARLA_BOOST_TAG}
|
2024-03-08 16:47:18 +08:00
|
|
|
https://github.com/boostorg/boost/releases/download/${CARLA_BOOST_TAG}/${CARLA_BOOST_TAG}.zip
|
2024-03-09 03:31:22 +08:00
|
|
|
https://github.com/boostorg/boost.git
|
2024-02-20 23:34:31 +08:00
|
|
|
)
|
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
|
2024-09-19 23:35:18 +08:00
|
|
|
|
|
|
|
# ==== EIGEN ====
|
2024-03-20 18:34:44 +08:00
|
|
|
carla_dependency_option (EIGEN_BUILD_PKGCONFIG OFF)
|
|
|
|
carla_dependency_option (BUILD_TESTING OFF)
|
|
|
|
carla_dependency_option (EIGEN_BUILD_DOC OFF)
|
2024-03-09 03:31:22 +08:00
|
|
|
carla_dependency_add (
|
2024-02-20 23:34:31 +08:00
|
|
|
eigen
|
2024-03-09 03:31:22 +08:00
|
|
|
${CARLA_EIGEN_TAG}
|
2024-03-08 16:47:18 +08:00
|
|
|
https://gitlab.com/libeigen/eigen/-/archive/${CARLA_EIGEN_TAG}/eigen-${CARLA_EIGEN_TAG}.tar.gz
|
2024-03-09 03:31:22 +08:00
|
|
|
https://gitlab.com/libeigen/eigen.git
|
2024-02-20 23:34:31 +08:00
|
|
|
)
|
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
|
2024-09-19 23:35:18 +08:00
|
|
|
|
|
|
|
# ==== RPCLIB ====
|
2024-03-09 03:31:22 +08:00
|
|
|
carla_dependency_add (
|
2024-02-20 23:34:31 +08:00
|
|
|
rpclib
|
2024-03-09 03:31:22 +08:00
|
|
|
${CARLA_RPCLIB_TAG}
|
2024-03-08 16:47:18 +08:00
|
|
|
https://github.com/carla-simulator/rpclib/archive/refs/heads/${CARLA_RPCLIB_TAG}.zip
|
2024-03-09 03:31:22 +08:00
|
|
|
https://github.com/carla-simulator/rpclib.git
|
2024-02-20 23:34:31 +08:00
|
|
|
)
|
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
|
2024-09-19 23:35:18 +08:00
|
|
|
|
|
|
|
# ==== RECAST ====
|
2024-09-16 16:22:51 +08:00
|
|
|
carla_dependency_option (RECASTNAVIGATION_BUILDER ON)
|
2024-03-09 03:31:22 +08:00
|
|
|
carla_dependency_add (
|
2024-02-20 23:34:31 +08:00
|
|
|
recastnavigation
|
2024-03-09 03:31:22 +08:00
|
|
|
${CARLA_RECAST_TAG}
|
2024-03-08 16:47:18 +08:00
|
|
|
https://github.com/carla-simulator/recastnavigation/archive/refs/heads/${CARLA_RECAST_TAG}.zip
|
2024-03-09 03:31:22 +08:00
|
|
|
https://github.com/carla-simulator/recastnavigation.git
|
2024-02-20 23:34:31 +08:00
|
|
|
)
|
|
|
|
|
2024-09-19 23:35:18 +08:00
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
|
2024-02-27 00:09:02 +08:00
|
|
|
if (ENABLE_OSM2ODR)
|
2024-09-19 23:35:18 +08:00
|
|
|
# ==== PROJ ====
|
2024-03-20 18:34:44 +08:00
|
|
|
carla_dependency_option (BUILD_TESTING OFF)
|
|
|
|
carla_dependency_option (ENABLE_TIFF OFF)
|
|
|
|
carla_dependency_option (ENABLE_CURL OFF)
|
2024-02-27 00:09:02 +08:00
|
|
|
carla_dependency_add (
|
|
|
|
proj
|
2024-03-20 18:34:44 +08:00
|
|
|
${CARLA_PROJ_TAG}
|
2024-03-09 03:31:22 +08:00
|
|
|
https://github.com/OSGeo/PROJ/archive/refs/tags/${CARLA_PROJ_TAG}.zip
|
2024-02-27 00:09:02 +08:00
|
|
|
https://github.com/OSGeo/PROJ.git
|
|
|
|
)
|
|
|
|
endif ()
|
2024-02-20 23:34:31 +08:00
|
|
|
|
2024-09-19 23:35:18 +08:00
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
|
2024-02-27 00:09:02 +08:00
|
|
|
if (ENABLE_OSM2ODR)
|
2024-09-19 23:35:18 +08:00
|
|
|
# ==== XERCESC ====
|
2024-02-27 00:09:02 +08:00
|
|
|
carla_dependency_add (
|
|
|
|
xercesc
|
2024-03-20 18:34:44 +08:00
|
|
|
${CARLA_XERCESC_TAG}
|
2024-03-09 03:31:22 +08:00
|
|
|
https://github.com/apache/xerces-c/archive/refs/tags/${CARLA_XERCESC_TAG}.zip
|
2024-02-27 00:09:02 +08:00
|
|
|
https://github.com/apache/xerces-c.git
|
|
|
|
)
|
|
|
|
endif ()
|
2024-02-20 23:34:31 +08:00
|
|
|
|
2024-09-19 23:35:18 +08:00
|
|
|
|
2024-03-09 03:31:22 +08:00
|
|
|
|
2024-02-20 23:34:31 +08:00
|
|
|
if (BUILD_OSM_WORLD_RENDERER)
|
2024-09-19 23:35:18 +08:00
|
|
|
# ==== LUNASVG ====
|
2024-02-20 23:34:31 +08:00
|
|
|
carla_dependency_add (
|
|
|
|
lunasvg
|
2024-03-20 18:34:44 +08:00
|
|
|
${CARLA_LUNASVG_TAG}
|
2024-03-09 03:31:22 +08:00
|
|
|
https://github.com/sammycage/lunasvg/archive/refs/tags/${CARLA_LUNASVG_TAG}.zip
|
2024-02-20 23:34:31 +08:00
|
|
|
https://github.com/sammycage/lunasvg.git
|
|
|
|
)
|
2024-03-09 03:31:22 +08:00
|
|
|
|
2024-09-19 23:35:18 +08:00
|
|
|
# ==== LIBOSMSCOUT ====
|
2024-02-20 23:34:31 +08:00
|
|
|
carla_dependency_add (
|
|
|
|
libosmscout
|
2024-03-20 18:34:44 +08:00
|
|
|
${CARLA_LIBOSMSCOUT_TAG}
|
2024-03-09 03:31:22 +08:00
|
|
|
https://github.com/Framstag/libosmscout/archive/refs/tags/${CARLA_LIBOSMSCOUT_TAG}.zip
|
2024-02-20 23:34:31 +08:00
|
|
|
https://github.com/Framstag/libosmscout.git
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
2024-09-19 23:35:18 +08:00
|
|
|
|
2024-02-20 23:34:31 +08:00
|
|
|
|
2024-03-11 04:42:58 +08:00
|
|
|
if (BUILD_CARLA_UNREAL)
|
2024-09-19 23:35:18 +08:00
|
|
|
# ==== STREETMAP ====
|
2024-03-09 03:31:22 +08:00
|
|
|
carla_dependency_add (
|
|
|
|
StreetMap
|
|
|
|
${CARLA_STREETMAP_TAG}
|
2024-03-20 18:34:44 +08:00
|
|
|
https://github.com/carla-simulator/StreetMap/archive/refs/heads/${CARLA_STREETMAP_TAG}.zip
|
|
|
|
https://github.com/carla-simulator/StreetMap.git
|
2024-03-09 07:25:47 +08:00
|
|
|
SOURCE_DIR ${CARLA_WORKSPACE_PATH}/Unreal/CarlaUnreal/Plugins/StreetMap
|
2024-03-09 03:31:22 +08:00
|
|
|
)
|
|
|
|
endif ()
|
2024-02-20 23:34:31 +08:00
|
|
|
|
2024-03-09 07:25:47 +08:00
|
|
|
carla_dependencies_make_available ()
|