From 21e14ff82c114ab67ea2929ef7cf48a9566c4b90 Mon Sep 17 00:00:00 2001 From: Ryan Blue Date: Fri, 3 Nov 2023 19:09:42 -0400 Subject: [PATCH] use protobuf_generate instead of protobuf_generate_cpp --- CMakeLists.txt | 2 +- README-CMAKE.md | 2 +- cmake/toolchains/gnu.toolchain.cmake | 2 +- wpimath/CMakeLists.txt | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f994bf13e54..9aa8d063e7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION 10.0.18362.0 CACHE STRING INTERNAL FORCE) endif() -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.13) project(allwpilib) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") diff --git a/README-CMAKE.md b/README-CMAKE.md index 776f808d911..34ae7402f14 100644 --- a/README-CMAKE.md +++ b/README-CMAKE.md @@ -100,7 +100,7 @@ Using the libraries from C++ is the easiest way to use the built libraries. To do so, create a new folder to contain your project. Add the following code below to a `CMakeLists.txt` file in that directory. ``` -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.13) project(vision_app) # Project Name Here find_package(wpilib REQUIRED) diff --git a/cmake/toolchains/gnu.toolchain.cmake b/cmake/toolchains/gnu.toolchain.cmake index dbddbd0dc4d..5945aa858a8 100644 --- a/cmake/toolchains/gnu.toolchain.cmake +++ b/cmake/toolchains/gnu.toolchain.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.13) # load settings in case of "try compile" set(TOOLCHAIN_CONFIG_FILE "${WPILIB_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/toolchain.config.cmake") diff --git a/wpimath/CMakeLists.txt b/wpimath/CMakeLists.txt index 32e4ef12b78..45ab0aa764f 100644 --- a/wpimath/CMakeLists.txt +++ b/wpimath/CMakeLists.txt @@ -6,7 +6,6 @@ include(AddTest) include(DownloadAndCheck) file(GLOB wpimath_proto_src src/main/proto/*.proto) -protobuf_generate_cpp(WPIMATH_PROTO_SRCS WPIMATH_PROTO_HDRS PROTOC_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/protobuf" PROTOS ${wpimath_proto_src}) function(quickbuf_generate SRCS JAVA_PACKAGE) if(NOT ARGN) @@ -170,7 +169,7 @@ file(GLOB_RECURSE wpimath_native_src src/main/native/cpp/*.cpp) list(REMOVE_ITEM wpimath_native_src ${wpimath_jni_src}) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS FALSE) -add_library(wpimath ${wpimath_native_src} ${WPIMATH_PROTO_SRCS}) +add_library(wpimath ${wpimath_native_src} ${wpimath_proto_src}) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) set_target_properties(wpimath PROPERTIES DEBUG_POSTFIX "d") @@ -184,6 +183,8 @@ endif() wpilib_target_warnings(wpimath) target_link_libraries(wpimath wpiutil) +protobuf_generate(TARGET wpimath LANGUAGE cpp PROTOC_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/protobuf" APPEND_PATH) + if (NOT USE_SYSTEM_EIGEN) install(DIRECTORY src/main/native/thirdparty/eigen/include/ DESTINATION "${include_dest}/wpimath") target_include_directories(wpimath SYSTEM PUBLIC