mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
The wpimath library is a new library designed to separate the reusable math functionality from the common utility library (wpiutil) and the hardware-dependent library (wpilibc/j). Package names / include file names were NOT changed to minimize breakage. In a future year it would be good to revamp these for a more uniform user experience and to reduce the risk of accidental naming conflicts. While theoretically all of this functionality could be placed into wpiutil, several pieces of this library (e.g. DARE) are very time-consuming to compile, so it's nice to avoid this expense for users who only want cscore or ntcore. It also allows for easy future separation of build tasks vs number of workers on memory-constrained machines. This moves the following functionality from wpiutil into wpimath: - Eigen - ejml - Drake - DARE - wpiutil.math package (Matrix etc) - units And the following functionality from wpilibc/j into wpimath: - Geometry - Kinematics - Spline - Trajectory - LinearFilter - MedianFilter - Feed-forward controllers
36 lines
1.4 KiB
CMake
36 lines
1.4 KiB
CMake
project (wpilibj)
|
|
|
|
find_package( OpenCV REQUIRED )
|
|
|
|
# Java bindings
|
|
if (NOT WITHOUT_JAVA)
|
|
find_package(Java REQUIRED)
|
|
include(UseJava)
|
|
set(CMAKE_JAVA_COMPILE_FLAGS "-Xlint:unchecked")
|
|
|
|
set(OPENCV_JAVA_INSTALL_DIR ${OpenCV_INSTALL_PATH}/share/OpenCV/java/)
|
|
|
|
find_file(OPENCV_JAR_FILE NAMES opencv-${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}.jar PATHS ${OPENCV_JAVA_INSTALL_DIR} ${OpenCV_INSTALL_PATH}/bin NO_DEFAULT_PATH)
|
|
|
|
configure_file(src/generate/WPILibVersion.java.in WPILibVersion.java)
|
|
|
|
file(GLOB_RECURSE JAVA_SOURCES src/main/java/*.java)
|
|
file(GLOB EJML_JARS "${CMAKE_BINARY_DIR}/wpimath/thirdparty/ejml/*.jar")
|
|
file(GLOB JACKSON_JARS "${CMAKE_BINARY_DIR}/wpiutil/thirdparty/jackson/*.jar")
|
|
|
|
add_jar(wpilibj_jar ${JAVA_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/WPILibVersion.java INCLUDE_JARS hal_jar ntcore_jar ${EJML_JARS} ${JACKSON_JARS} ${OPENCV_JAR_FILE} cscore_jar cameraserver_jar wpimath_jar wpiutil_jar OUTPUT_NAME wpilibj)
|
|
|
|
get_property(WPILIBJ_JAR_FILE TARGET wpilibj_jar PROPERTY JAR_FILE)
|
|
install(FILES ${WPILIBJ_JAR_FILE} DESTINATION "${java_lib_dest}")
|
|
|
|
set_property(TARGET wpilibj_jar PROPERTY FOLDER "java")
|
|
|
|
if (MSVC OR FLAT_INSTALL_WPILIB)
|
|
set (wpilibj_config_dir ${wpilib_dest})
|
|
else()
|
|
set (wpilibj_config_dir share/wpilibj)
|
|
endif()
|
|
|
|
install(FILES wpilibj-config.cmake DESTINATION ${wpilibj_config_dir})
|
|
endif()
|