2018-05-02 21:15:30 -07:00
|
|
|
# Disable in-source builds to prevent source tree corruption.
|
2020-11-24 23:25:44 -05:00
|
|
|
if(" ${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL " ${CMAKE_CURRENT_BINARY_DIR}")
|
2023-11-30 19:52:21 -05:00
|
|
|
message(
|
|
|
|
|
FATAL_ERROR
|
|
|
|
|
"
|
2018-05-02 21:15:30 -07:00
|
|
|
FATAL: In-source builds are not allowed.
|
|
|
|
|
You should create a separate directory for build files.
|
2023-11-30 19:52:21 -05:00
|
|
|
"
|
|
|
|
|
)
|
2018-05-02 21:15:30 -07:00
|
|
|
endif()
|
|
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
|
2021-11-25 22:08:26 -08:00
|
|
|
set(CMAKE_SYSTEM_VERSION 10.0.18362.0 CACHE STRING INTERNAL FORCE)
|
|
|
|
|
set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION 10.0.18362.0 CACHE STRING INTERNAL FORCE)
|
2024-07-11 18:01:05 -04:00
|
|
|
message(STATUS "Platform version: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
|
2021-11-25 22:08:26 -08:00
|
|
|
endif()
|
2018-05-02 21:15:30 -07:00
|
|
|
|
2024-07-15 18:12:41 -04:00
|
|
|
cmake_minimum_required(VERSION 3.21)
|
2023-05-25 21:39:35 -07:00
|
|
|
project(allwpilib)
|
2020-11-24 23:25:44 -05:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
|
|
|
|
|
|
2023-08-28 15:06:51 -07:00
|
|
|
# Make timestamps of extracted files from FetchContent the time of extraction
|
2023-11-30 19:52:21 -05:00
|
|
|
if(POLICY CMP0135)
|
2023-09-07 09:58:22 -07:00
|
|
|
cmake_policy(SET CMP0135 NEW)
|
|
|
|
|
endif()
|
2023-08-28 15:06:51 -07:00
|
|
|
|
2020-11-24 23:25:44 -05:00
|
|
|
set(WPILIB_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
2018-05-02 21:15:30 -07:00
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
include(CPack)
|
2024-07-11 18:01:05 -04:00
|
|
|
include(OptionValidation)
|
2018-05-02 21:15:30 -07:00
|
|
|
|
|
|
|
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
2024-07-13 00:51:55 -04:00
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
|
|
|
|
|
if(MSVC)
|
|
|
|
|
add_compile_options(/Zc:__cplusplus)
|
|
|
|
|
endif()
|
2018-05-02 21:15:30 -07:00
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
|
|
|
|
2020-11-24 23:25:44 -05:00
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${WPILIB_BINARY_DIR}/lib)
|
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${WPILIB_BINARY_DIR}/lib)
|
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${WPILIB_BINARY_DIR}/bin)
|
2018-05-02 21:15:30 -07:00
|
|
|
|
|
|
|
|
# use, i.e. don't skip the full RPATH for the build tree
|
2023-11-30 19:52:21 -05:00
|
|
|
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
2018-05-02 21:15:30 -07:00
|
|
|
|
|
|
|
|
# when building, don't use the install RPATH already
|
|
|
|
|
# (but later on when installing)
|
2023-11-30 19:52:21 -05:00
|
|
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
2018-05-02 21:15:30 -07:00
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
2018-05-02 21:15:30 -07:00
|
|
|
|
|
|
|
|
# add the automatically determined parts of the RPATH
|
|
|
|
|
# which point to directories outside the build tree to the install RPATH
|
2023-11-30 19:52:21 -05:00
|
|
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
2018-05-02 21:15:30 -07:00
|
|
|
|
|
|
|
|
# the RPATH to be used when installing, but only if it's not a system directory
|
2023-11-30 19:52:21 -05:00
|
|
|
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
|
|
|
|
|
if("${isSystemDir}" STREQUAL "-1")
|
|
|
|
|
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
2024-01-04 03:47:47 -05:00
|
|
|
endif()
|
2018-05-02 21:15:30 -07:00
|
|
|
|
2020-10-23 00:52:24 -04:00
|
|
|
# Options for building certain parts of the repo. Everything is built by default.
|
2020-10-23 00:12:40 -07:00
|
|
|
option(BUILD_SHARED_LIBS "Build with shared libs (needed for JNI)" ON)
|
2023-10-30 12:57:28 -04:00
|
|
|
option(WITH_JAVA "Include Java and JNI in the build" ON)
|
2023-12-03 20:14:34 -08:00
|
|
|
option(WITH_JAVA_SOURCE "Build Java source jars" ${WITH_JAVA})
|
2020-10-23 00:52:24 -04:00
|
|
|
option(WITH_CSCORE "Build cscore (needs OpenCV)" ON)
|
2022-10-20 17:21:31 -07:00
|
|
|
option(WITH_NTCORE "Build ntcore" ON)
|
2020-11-23 22:44:20 -05:00
|
|
|
option(WITH_WPIMATH "Build wpimath" ON)
|
2023-11-17 11:45:04 -05:00
|
|
|
option(WITH_WPIUNITS "Build wpiunits" ON)
|
2024-05-24 10:41:23 -07:00
|
|
|
option(WITH_WPILIB "Build hal, wpilibc/j, and developerRobot (needs OpenCV)" ON)
|
2020-11-26 14:47:35 -05:00
|
|
|
option(WITH_EXAMPLES "Build examples" OFF)
|
2020-10-23 00:52:24 -04:00
|
|
|
option(WITH_TESTS "Build unit tests (requires internet connection)" ON)
|
2020-10-22 22:01:31 -07:00
|
|
|
option(WITH_GUI "Build GUI items" ON)
|
2020-10-23 00:52:24 -04:00
|
|
|
option(WITH_SIMULATION_MODULES "Build simulation modules" ON)
|
|
|
|
|
|
2022-10-20 19:47:12 -07:00
|
|
|
# Options for using a package manager (e.g., vcpkg) for certain dependencies.
|
|
|
|
|
option(USE_SYSTEM_FMTLIB "Use system fmtlib" OFF)
|
|
|
|
|
option(USE_SYSTEM_LIBUV "Use system libuv" OFF)
|
|
|
|
|
option(USE_SYSTEM_EIGEN "Use system eigen" OFF)
|
2020-10-23 00:52:24 -04:00
|
|
|
|
|
|
|
|
# Options for location of OpenCV Java.
|
2020-02-10 20:30:54 -05:00
|
|
|
set(OPENCV_JAVA_INSTALL_DIR "" CACHE PATH "Location to search for the OpenCV jar file")
|
2018-05-02 21:15:30 -07:00
|
|
|
|
2023-12-22 12:38:38 -08:00
|
|
|
# Options for compilation flags.
|
|
|
|
|
option(NO_WERROR "Disable -Werror flag during compilation" OFF)
|
|
|
|
|
|
2020-10-23 00:52:24 -04:00
|
|
|
# Set default build type to release with debug info (i.e. release mode optimizations
|
|
|
|
|
# are performed, but debug info still exists).
|
2023-11-30 19:52:21 -05:00
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
|
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "" FORCE)
|
2020-10-23 00:52:24 -04:00
|
|
|
endif()
|
|
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
if(NOT WITH_JAVA OR NOT WITH_CSCORE)
|
2020-02-10 20:30:54 -05:00
|
|
|
if(NOT "${OPENCV_JAVA_INSTALL_DIR}" STREQUAL "")
|
2023-11-30 19:52:21 -05:00
|
|
|
message(
|
|
|
|
|
WARNING
|
|
|
|
|
"
|
2020-02-10 20:30:54 -05:00
|
|
|
WARNING: OpenCV Java dir set but java is not enabled!
|
|
|
|
|
It will be ignored.
|
2023-11-30 19:52:21 -05:00
|
|
|
"
|
|
|
|
|
)
|
2020-02-10 20:30:54 -05:00
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
2024-07-11 18:01:05 -04:00
|
|
|
wpilib_config(OPTIONS WITH_JAVA REQUIRES BUILD_SHARED_LIBS)
|
2022-10-20 17:21:31 -07:00
|
|
|
|
2024-07-11 18:01:05 -04:00
|
|
|
wpilib_config(OPTIONS WITH_SIMULATION_MODULES REQUIRES BUILD_SHARED_LIBS WITH_WPILIB WITH_NTCORE)
|
2022-10-20 17:21:31 -07:00
|
|
|
|
2024-07-11 18:01:05 -04:00
|
|
|
wpilib_config(OPTIONS WITH_CSCORE REQUIRES WITH_NTCORE)
|
2022-10-20 17:21:31 -07:00
|
|
|
|
2024-07-11 18:01:05 -04:00
|
|
|
wpilib_config(OPTIONS WITH_GUI REQUIRES WITH_NTCORE WITH_WPIMATH)
|
2022-10-20 17:21:31 -07:00
|
|
|
|
2024-07-11 18:01:05 -04:00
|
|
|
wpilib_config(OPTIONS WITH_WPILIB REQUIRES WITH_NTCORE WITH_WPIMATH)
|
2020-11-23 22:44:20 -05:00
|
|
|
|
2024-07-11 18:01:05 -04:00
|
|
|
wpilib_config(OPTIONS WITH_WPIMATH WITH_JAVA REQUIRES WITH_WPIUNITS)
|
2023-11-17 11:45:04 -05:00
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
set(include_dest include)
|
|
|
|
|
set(java_lib_dest java)
|
2024-07-11 18:01:05 -04:00
|
|
|
if(WITH_JAVA OR WITH_JAVA_SOURCE)
|
2024-05-24 13:48:05 -04:00
|
|
|
set(CMAKE_JAVA_COMPILE_FLAGS "-encoding" "UTF8" "-Xlint:unchecked")
|
2024-07-11 18:01:05 -04:00
|
|
|
find_package(Java REQUIRED COMPONENTS Development)
|
|
|
|
|
find_package(JNI REQUIRED COMPONENTS JVM)
|
2024-05-24 13:48:05 -04:00
|
|
|
endif()
|
2018-05-02 21:15:30 -07:00
|
|
|
|
2022-01-08 00:14:48 -08:00
|
|
|
find_package(LIBSSH 0.7.1)
|
|
|
|
|
|
2024-06-28 09:28:39 -04:00
|
|
|
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
|
|
|
|
|
set(protobuf_MODULE_COMPATIBLE ON CACHE BOOL "" FORCE)
|
2023-10-19 21:41:47 -07:00
|
|
|
find_package(Protobuf REQUIRED)
|
2024-06-30 20:25:10 -07:00
|
|
|
find_program(PROTOC_COMPILER protoc REQUIRED)
|
2024-06-28 09:28:39 -04:00
|
|
|
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG OFF)
|
2023-10-19 21:41:47 -07:00
|
|
|
|
2021-09-16 18:48:41 -07:00
|
|
|
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
|
|
|
|
|
|
|
|
|
if(isMultiConfig)
|
|
|
|
|
if(NOT "Asan" IN_LIST CMAKE_CONFIGURATION_TYPES)
|
|
|
|
|
list(APPEND CMAKE_CONFIGURATION_TYPES Asan)
|
|
|
|
|
endif()
|
|
|
|
|
if(NOT "Tsan" IN_LIST CMAKE_CONFIGURATION_TYPES)
|
|
|
|
|
list(APPEND CMAKE_CONFIGURATION_TYPES Tsan)
|
|
|
|
|
endif()
|
|
|
|
|
if(NOT "Ubsan" IN_LIST CMAKE_CONFIGURATION_TYPES)
|
|
|
|
|
list(APPEND CMAKE_CONFIGURATION_TYPES Ubsan)
|
|
|
|
|
endif()
|
|
|
|
|
else()
|
2023-11-30 19:52:21 -05:00
|
|
|
set(allowedBuildTypes
|
|
|
|
|
Asan
|
|
|
|
|
Tsan
|
|
|
|
|
Ubsan
|
|
|
|
|
Debug
|
|
|
|
|
Release
|
|
|
|
|
RelWithDebInfo
|
|
|
|
|
MinSizeRel
|
|
|
|
|
)
|
2021-09-16 18:48:41 -07:00
|
|
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${allowedBuildTypes}")
|
|
|
|
|
|
|
|
|
|
if(CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE IN_LIST allowedBuildTypes)
|
|
|
|
|
message(FATAL_ERROR "Invalid build type: ${CMAKE_BUILD_TYPE}")
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
set(CMAKE_C_FLAGS_ASAN
|
2023-11-30 19:52:21 -05:00
|
|
|
"${CMAKE_C_FLAGS_DEBUG} -fsanitize=address -fno-omit-frame-pointer"
|
|
|
|
|
CACHE STRING
|
|
|
|
|
"Flags used by the C compiler for Asan build type or configuration."
|
|
|
|
|
FORCE
|
|
|
|
|
)
|
2021-09-16 18:48:41 -07:00
|
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS_ASAN
|
2023-11-30 19:52:21 -05:00
|
|
|
"${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address -fno-omit-frame-pointer"
|
|
|
|
|
CACHE STRING
|
|
|
|
|
"Flags used by the C++ compiler for Asan build type or configuration."
|
|
|
|
|
FORCE
|
|
|
|
|
)
|
2021-09-16 18:48:41 -07:00
|
|
|
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS_ASAN
|
2023-11-30 19:52:21 -05:00
|
|
|
"${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -fsanitize=address"
|
|
|
|
|
CACHE STRING
|
|
|
|
|
"Linker flags to be used to create executables for Asan build type."
|
|
|
|
|
FORCE
|
|
|
|
|
)
|
2021-09-16 18:48:41 -07:00
|
|
|
|
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS_ASAN
|
2023-11-30 19:52:21 -05:00
|
|
|
"${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -fsanitize=address"
|
|
|
|
|
CACHE STRING
|
2024-05-24 13:48:05 -04:00
|
|
|
"Linker flags to be used to create shared libraries for Asan build type."
|
2023-11-30 19:52:21 -05:00
|
|
|
FORCE
|
|
|
|
|
)
|
2021-09-16 18:48:41 -07:00
|
|
|
|
|
|
|
|
set(CMAKE_C_FLAGS_TSAN
|
2023-11-30 19:52:21 -05:00
|
|
|
"${CMAKE_C_FLAGS_DEBUG} -fsanitize=thread -fno-omit-frame-pointer"
|
|
|
|
|
CACHE STRING
|
|
|
|
|
"Flags used by the C compiler for Tsan build type or configuration."
|
|
|
|
|
FORCE
|
|
|
|
|
)
|
2021-09-16 18:48:41 -07:00
|
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS_TSAN
|
2023-11-30 19:52:21 -05:00
|
|
|
"${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=thread -fno-omit-frame-pointer"
|
|
|
|
|
CACHE STRING
|
|
|
|
|
"Flags used by the C++ compiler for Tsan build type or configuration."
|
|
|
|
|
FORCE
|
|
|
|
|
)
|
2021-09-16 18:48:41 -07:00
|
|
|
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS_TSAN
|
2023-11-30 19:52:21 -05:00
|
|
|
"${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -fsanitize=thread"
|
|
|
|
|
CACHE STRING
|
|
|
|
|
"Linker flags to be used to create executables for Tsan build type."
|
|
|
|
|
FORCE
|
|
|
|
|
)
|
2021-09-16 18:48:41 -07:00
|
|
|
|
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS_TSAN
|
2023-11-30 19:52:21 -05:00
|
|
|
"${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -fsanitize=thread"
|
|
|
|
|
CACHE STRING
|
2024-05-24 13:48:05 -04:00
|
|
|
"Linker flags to be used to create shared libraries for Tsan build type."
|
2023-11-30 19:52:21 -05:00
|
|
|
FORCE
|
|
|
|
|
)
|
2021-09-16 18:48:41 -07:00
|
|
|
|
|
|
|
|
set(CMAKE_C_FLAGS_UBSAN
|
2023-11-30 19:52:21 -05:00
|
|
|
"${CMAKE_C_FLAGS_DEBUG} -fsanitize=undefined -fno-sanitize-recover=all -fno-omit-frame-pointer"
|
|
|
|
|
CACHE STRING
|
|
|
|
|
"Flags used by the C compiler for Ubsan build type or configuration."
|
|
|
|
|
FORCE
|
|
|
|
|
)
|
2021-09-16 18:48:41 -07:00
|
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS_UBSAN
|
2023-11-30 19:52:21 -05:00
|
|
|
"${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=undefined -fno-sanitize-recover=all -fno-omit-frame-pointer"
|
|
|
|
|
CACHE STRING
|
|
|
|
|
"Flags used by the C++ compiler for Ubsan build type or configuration."
|
|
|
|
|
FORCE
|
|
|
|
|
)
|
2021-09-16 18:48:41 -07:00
|
|
|
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS_UBSAN
|
2023-11-30 19:52:21 -05:00
|
|
|
"${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -fsanitize=undefined -fno-sanitize-recover=all"
|
|
|
|
|
CACHE STRING
|
|
|
|
|
"Linker flags to be used to create executables for Ubsan build type."
|
|
|
|
|
FORCE
|
|
|
|
|
)
|
2021-09-16 18:48:41 -07:00
|
|
|
|
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS_UBSAN
|
2023-11-30 19:52:21 -05:00
|
|
|
"${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -fsanitize=undefined"
|
|
|
|
|
CACHE STRING
|
2024-05-24 13:48:05 -04:00
|
|
|
"Linker flags to be used to create shared libraries for Ubsan build type."
|
2023-11-30 19:52:21 -05:00
|
|
|
FORCE
|
|
|
|
|
)
|
2021-09-16 18:48:41 -07:00
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
if(WITH_TESTS)
|
2019-06-23 12:44:28 -07:00
|
|
|
enable_testing()
|
2024-07-19 00:10:26 -04:00
|
|
|
add_subdirectory(thirdparty/googletest)
|
2019-06-23 12:44:28 -07:00
|
|
|
include(GoogleTest)
|
|
|
|
|
endif()
|
|
|
|
|
|
2024-06-29 09:55:04 -04:00
|
|
|
if(USE_SYSTEM_LIBUV)
|
|
|
|
|
set(LIBUV_SYSTEM_REPLACE "find_dependency(libuv CONFIG)")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(USE_SYSTEM_EIGEN)
|
|
|
|
|
set(EIGEN_SYSTEM_REPLACE "find_package(Eigen3 CONFIG)")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
set(FILENAME_DEP_REPLACE "get_filename_component(SELF_DIR \"$\{CMAKE_CURRENT_LIST_FILE\}\" PATH)")
|
|
|
|
|
set(SELF_DIR "$\{SELF_DIR\}")
|
|
|
|
|
set(WPIUNITS_DEP_REPLACE_IMPL "find_dependency(wpiunits)")
|
|
|
|
|
set(WPIUTIL_DEP_REPLACE "find_dependency(wpiutil)")
|
2018-05-02 21:15:30 -07:00
|
|
|
add_subdirectory(wpiutil)
|
2022-10-20 17:21:31 -07:00
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
if(WITH_NTCORE)
|
2024-06-29 09:55:04 -04:00
|
|
|
set(NTCORE_DEP_REPLACE "find_dependency(ntcore)")
|
|
|
|
|
set(WPINET_DEP_REPLACE "find_dependency(wpinet)")
|
2022-10-20 17:21:31 -07:00
|
|
|
add_subdirectory(wpinet)
|
|
|
|
|
add_subdirectory(ntcore)
|
|
|
|
|
endif()
|
2018-05-02 21:15:30 -07:00
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
if(WITH_WPIMATH)
|
|
|
|
|
if(WITH_JAVA)
|
2024-06-29 09:55:04 -04:00
|
|
|
set(WPIUNITS_DEP_REPLACE ${WPIUNITS_DEP_REPLACE_IMPL})
|
2023-11-17 11:45:04 -05:00
|
|
|
add_subdirectory(wpiunits)
|
|
|
|
|
endif()
|
2024-06-29 09:55:04 -04:00
|
|
|
set(WPIMATH_DEP_REPLACE "find_dependency(wpimath)")
|
2020-11-23 22:44:20 -05:00
|
|
|
add_subdirectory(wpimath)
|
|
|
|
|
endif()
|
|
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
if(WITH_WPIUNITS AND NOT WITH_WPIMATH)
|
2023-11-17 11:45:04 -05:00
|
|
|
# In case of building wpiunits standalone
|
2024-06-29 09:55:04 -04:00
|
|
|
set(WPIUNITS_DEP_REPLACE ${WPIUNITS_DEP_REPLACE_IMPL})
|
2023-11-17 11:45:04 -05:00
|
|
|
add_subdirectory(wpiunits)
|
|
|
|
|
endif()
|
|
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
if(WITH_GUI)
|
2022-01-09 20:26:54 -08:00
|
|
|
add_subdirectory(fieldImages)
|
2020-08-29 11:30:45 -07:00
|
|
|
add_subdirectory(imgui)
|
|
|
|
|
add_subdirectory(wpigui)
|
2020-09-12 10:55:46 -07:00
|
|
|
add_subdirectory(glass)
|
2021-03-16 22:05:41 -07:00
|
|
|
add_subdirectory(outlineviewer)
|
2023-10-01 15:09:09 -07:00
|
|
|
add_subdirectory(sysid)
|
2023-11-30 19:52:21 -05:00
|
|
|
if(LIBSSH_FOUND)
|
2022-01-08 00:14:48 -08:00
|
|
|
add_subdirectory(roborioteamnumbersetter)
|
2022-01-05 22:28:01 -08:00
|
|
|
add_subdirectory(datalogtool)
|
2022-01-08 00:14:48 -08:00
|
|
|
endif()
|
2020-08-29 11:30:45 -07:00
|
|
|
endif()
|
|
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
if(WITH_WPILIB OR WITH_SIMULATION_MODULES)
|
2024-06-29 09:55:04 -04:00
|
|
|
set(HAL_DEP_REPLACE "find_dependency(hal)")
|
2021-06-19 09:30:49 -07:00
|
|
|
add_subdirectory(hal)
|
|
|
|
|
endif()
|
|
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
if(WITH_CSCORE)
|
2024-06-29 09:55:04 -04:00
|
|
|
set(CAMERASERVER_DEP_REPLACE "find_dependency(cameraserver)")
|
|
|
|
|
set(CSCORE_DEP_REPLACE "find_dependency(cscore)")
|
2024-07-11 18:01:05 -04:00
|
|
|
find_package(OpenCV REQUIRED)
|
2018-05-02 21:15:30 -07:00
|
|
|
add_subdirectory(cscore)
|
|
|
|
|
add_subdirectory(cameraserver)
|
2021-09-27 21:37:04 -07:00
|
|
|
endif()
|
|
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
if(WITH_WPILIB)
|
2024-06-29 09:55:04 -04:00
|
|
|
set(APRILTAG_DEP_REPLACE "find_dependency(apriltag)")
|
|
|
|
|
set(WPILIBC_DEP_REPLACE "find_dependency(wpilibc)")
|
|
|
|
|
set(WPILIBJ_DEP_REPLACE "find_dependency(wpilibj)")
|
|
|
|
|
set(WPILIBNEWCOMMANDS_DEP_REPLACE "find_dependency(wpilibNewCommands)")
|
2022-11-17 17:29:29 -05:00
|
|
|
add_subdirectory(apriltag)
|
2021-09-27 21:37:04 -07:00
|
|
|
add_subdirectory(wpilibj)
|
|
|
|
|
add_subdirectory(wpilibc)
|
|
|
|
|
add_subdirectory(wpilibNewCommands)
|
2023-09-20 21:03:55 -07:00
|
|
|
add_subdirectory(romiVendordep)
|
|
|
|
|
add_subdirectory(xrpVendordep)
|
2023-11-30 19:52:21 -05:00
|
|
|
if(WITH_EXAMPLES)
|
2021-09-27 21:37:04 -07:00
|
|
|
add_subdirectory(wpilibcExamples)
|
2018-05-02 21:15:30 -07:00
|
|
|
endif()
|
2024-05-24 10:41:23 -07:00
|
|
|
add_subdirectory(developerRobot)
|
2018-05-02 21:15:30 -07:00
|
|
|
endif()
|
|
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
if(WITH_SIMULATION_MODULES AND NOT WITH_EXTERNAL_HAL)
|
2019-10-04 19:08:57 -07:00
|
|
|
add_subdirectory(simulation)
|
|
|
|
|
endif()
|
|
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
configure_file(wpilib-config.cmake.in ${WPILIB_BINARY_DIR}/wpilib-config.cmake)
|
2023-11-21 14:48:32 -05:00
|
|
|
install(FILES ${WPILIB_BINARY_DIR}/wpilib-config.cmake DESTINATION share/wpilib)
|