2018-11-20 21:18:40 +08:00
|
|
|
cmake_minimum_required(VERSION 3.5.1)
|
2018-07-04 17:11:49 +08:00
|
|
|
project(libcarla)
|
|
|
|
|
2019-03-13 21:57:44 +08:00
|
|
|
option(LIBCARLA_BUILD_DEBUG "Build debug configuration" ON)
|
|
|
|
option(LIBCARLA_BUILD_RELEASE "Build release configuration" ON)
|
|
|
|
option(LIBCARLA_BUILD_TEST "Build unit tests" ON)
|
|
|
|
|
|
|
|
message(STATUS "Build debug: ${LIBCARLA_BUILD_DEBUG}")
|
|
|
|
message(STATUS "Build release: ${LIBCARLA_BUILD_RELEASE}")
|
|
|
|
message(STATUS "Build test: ${LIBCARLA_BUILD_TEST}")
|
|
|
|
|
2018-07-04 17:11:49 +08:00
|
|
|
set(libcarla_source_path "${PROJECT_SOURCE_DIR}/../source")
|
2019-07-01 18:09:28 +08:00
|
|
|
set(libcarla_source_thirdparty_path "${libcarla_source_path}/third-party")
|
2018-07-04 17:11:49 +08:00
|
|
|
|
|
|
|
include_directories(${libcarla_source_path})
|
2019-07-01 18:09:28 +08:00
|
|
|
include_directories(${libcarla_source_thirdparty_path})
|
2018-07-04 17:11:49 +08:00
|
|
|
|
2019-03-12 22:09:32 +08:00
|
|
|
if (CARLA_VERSION)
|
|
|
|
configure_file(${libcarla_source_path}/carla/Version.h.in ${libcarla_source_path}/carla/Version.h)
|
|
|
|
endif()
|
2018-07-04 17:11:49 +08:00
|
|
|
|
|
|
|
if (CMAKE_BUILD_TYPE STREQUAL "Client")
|
|
|
|
add_subdirectory("client")
|
|
|
|
elseif (CMAKE_BUILD_TYPE STREQUAL "Server")
|
|
|
|
add_subdirectory("server")
|
2022-09-23 21:39:09 +08:00
|
|
|
elseif (CMAKE_BUILD_TYPE STREQUAL "Pytorch")
|
|
|
|
add_subdirectory("pytorch")
|
2018-07-04 17:11:49 +08:00
|
|
|
else ()
|
|
|
|
message(FATAL_ERROR "Unknown build type '${CMAKE_BUILD_TYPE}'")
|
|
|
|
endif ()
|
2019-01-27 00:27:14 +08:00
|
|
|
|
|
|
|
# GTest is not compiled on Windows.
|
2022-09-23 21:39:09 +08:00
|
|
|
if ((LIBCARLA_BUILD_TEST) AND (NOT WIN32) AND (NOT (CMAKE_BUILD_TYPE STREQUAL "Pytorch")))
|
2019-01-27 00:27:14 +08:00
|
|
|
add_subdirectory("test")
|
|
|
|
endif()
|