Skip to content

Commit

Permalink
use protobuf_generate instead of protobuf_generate_cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
rzblue committed Nov 3, 2023
1 parent 1c35d42 commit 21e14ff
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion README-CMAKE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmake/toolchains/gnu.toolchain.cmake
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
5 changes: 3 additions & 2 deletions wpimath/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")

Expand All @@ -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
Expand Down

0 comments on commit 21e14ff

Please sign in to comment.