Skip to content

Commit

Permalink
Make it work locally
Browse files Browse the repository at this point in the history
  • Loading branch information
KangarooKoala committed Dec 28, 2023
1 parent 5366051 commit 6069560
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
1 change: 1 addition & 0 deletions wpilibc/src/main/native/cpp/util/Color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// the WPILib BSD license file in the root directory of this project.

#include "frc/util/Color.h"
#include <frc/proto/VectorProto.h>

using namespace frc;

Expand Down
33 changes: 14 additions & 19 deletions wpimath/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ include(CompileWarnings)
include(AddTest)
include(DownloadAndCheck)

# workaround for makefiles - for some reason parent directories aren't created.
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/protobuf")
file(GLOB wpimath_proto_src src/main/proto/*.proto)

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
Expand All @@ -15,20 +13,25 @@ add_library(wpimathproto ${wpimath_proto_src})
protobuf_generate(
TARGET
wpimathproto
LANGUAGE # This is the default, but have to make sure
cpp
OUR_VAR
test_proto_output
# EXPORT_MACRO?
PROTOC_OUT_DIR
"${CMAKE_CURRENT_BINARY_DIR}/protobuf"
IMPORT_DIRS
"src/main/proto"
APPEND_PATH
)

message("test_proto_output: ${test_proto_output}")
file(GLOB_RECURSE protoc_output RELATIVE "${CMAKE_CURRENT_BINARY_DIR}/protobuf" "${CMAKE_CURRENT_BINARY_DIR}/protobuf/*")
message("Output dir contents: ${protoc_output}")
target_compile_features(wpimathproto PUBLIC cxx_std_14)

# Where is proto_headers coming from?
install(DIRECTORY proto_headers DESTINATION "${include_dest}/wpimath")
target_include_directories(
wpimathproto
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/protobuf>
$<BUILD_INTERFACE:${Protobuf_INCLUDE_DIRS}>
$<INSTALL_INTERFACE:${include_dest}/wpimath>
)

target_link_libraries(wpimathproto ${Protobuf_LIBRARIES})

function(quickbuf_generate SRCS JAVA_PACKAGE)
if(NOT ARGN)
Expand Down Expand Up @@ -247,14 +250,6 @@ else()
target_link_libraries(wpimath Eigen3::Eigen)
endif()

# install(DIRECTORY WPIMATH_PROTO_HDRS DESTINATION "${include_dest}/wpimath")
# target_include_directories(
# wpimathproto
# PUBLIC
# # $<BUILD_INTERFACE:${WPIMATH_PROTO_HDRS}>
# $<INSTALL_INTERFACE:${include_dest}/wpimath>
# )

install(DIRECTORY src/main/native/thirdparty/gcem/include/ DESTINATION "${include_dest}/wpimath")
target_include_directories(
wpimath
Expand Down

0 comments on commit 6069560

Please sign in to comment.