mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
Explicitly list required components when using FindJava and FindJNI Consolidate find_package calls for Java, JNI, and OpenCV into the root CMakeLists.txt file Remove references to main_lib_dest Install missing generated headers Flatten some if statements Use LinkMacOSGUI macro instead of hand rolling it Stop installing OpenCV libraries and an extra ntcorejni library; OpenCV JAR will still be installed to make it easy to use Only print platform version on Windows Prevent GUI modules from being built when wpimath is off, which would otherwise cause a build failure Simplify build configuration checks Clean up fieldImages JAR creation Place built JARs in the same subdir as installed JARs Remove unnecessary JAR includes Remove extra directories in target_include_directories Improve CMake docs
59 lines
1.7 KiB
CMake
59 lines
1.7 KiB
CMake
project(fieldImages)
|
|
|
|
include(CompileWarnings)
|
|
include(GenResources)
|
|
|
|
if(WITH_JAVA)
|
|
include(UseJava)
|
|
|
|
file(GLOB JACKSON_JARS "${WPILIB_BINARY_DIR}/wpiutil/thirdparty/jackson/*.jar")
|
|
|
|
file(GLOB_RECURSE JAVA_SOURCES src/main/java/*.java)
|
|
file(
|
|
GLOB_RECURSE JAVA_RESOURCES
|
|
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
src/main/native/resources/*.json
|
|
src/main/native/resources/*.png
|
|
src/main/native/resources/*.jpg
|
|
)
|
|
add_jar(
|
|
field_images_jar
|
|
SOURCES ${JAVA_SOURCES}
|
|
RESOURCES
|
|
NAMESPACE "edu/wpi/first/fields" ${JAVA_RESOURCES}
|
|
INCLUDE_JARS ${JACKSON_JARS}
|
|
OUTPUT_DIR ${WPILIB_BINARY_DIR}/${java_lib_dest}
|
|
OUTPUT_NAME fieldImages
|
|
)
|
|
set_property(TARGET field_images_jar PROPERTY FOLDER "java")
|
|
install_jar(field_images_jar DESTINATION ${java_lib_dest})
|
|
endif()
|
|
|
|
generate_resources(
|
|
src/main/native/resources/edu/wpi/first/fields
|
|
generated/main/cpp
|
|
FIELDS
|
|
fields
|
|
field_images_resources_src
|
|
)
|
|
|
|
add_library(fieldImages src/main/native/cpp/fields.cpp ${field_images_resources_src})
|
|
set_target_properties(fieldImages PROPERTIES DEBUG_POSTFIX "d")
|
|
|
|
set_property(TARGET fieldImages PROPERTY FOLDER "libraries")
|
|
target_compile_features(fieldImages PUBLIC cxx_std_20)
|
|
if(MSVC)
|
|
target_compile_options(fieldImages PUBLIC /bigobj)
|
|
endif()
|
|
wpilib_target_warnings(fieldImages)
|
|
|
|
target_include_directories(
|
|
fieldImages
|
|
PUBLIC
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/include>
|
|
$<INSTALL_INTERFACE:${include_dest}/fields>
|
|
)
|
|
|
|
install(TARGETS fieldImages EXPORT fieldimages)
|
|
export(TARGETS fieldImages FILE fieldimages.cmake NAMESPACE fieldimages::)
|