Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPIcal: Field Calibration Tool #6915

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions wpical/.styleguide
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
cppHeaderFileInclude {
\.h$
\.inc$
\.inl$
}

cppSrcFileInclude {
\.cpp$
}

generatedFileExclude {
src/main/native/resources/
src/main/native/win/outlineviewer.ico
src/main/native/mac/ov.icns
}

repoRootNameOverride {
outlineviewer
}

includeOtherLibs {
^GLFW
^ceres/
^fmt/
^frc/
^glass/
^glog/
^gtest/
^imgui
^implot\.h$
^mrcal_wrapper\.h$
^networktables/
^ntcore
^portable-file-dialogs\.h$
^tagpose\.h$
^units/
^wpi/
^wpigui
}
52 changes: 52 additions & 0 deletions wpical/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
project(wpical)

include(CompileWarnings)
include(GenResources)
include(LinkMacOSGUI)
include(AddTest)

configure_file(src/main/generate/WPILibVersion.cpp.in WPILibVersion.cpp)
generate_resources(src/main/native/resources generated/main/cpp WPIcal wpical wpical_resources_src)

file(GLOB wpical_src src/main/native/cpp/*.cpp ${CMAKE_CURRENT_BINARY_DIR}/WPILibVersion.cpp)

if(WIN32)
set(wpical_rc src/main/native/win/wpical.rc)
elseif(APPLE)
set(MACOSX_BUNDLE_ICON_FILE wpical.icns)
set(APP_ICON_MACOSX src/main/native/mac/wpical.icns)
set_source_files_properties(${APP_ICON_MACOSX} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
endif()

add_executable(wpical ${wpical_src} ${wpical_resources_src} ${wpical_rc} ${APP_ICON_MACOSX})
wpilib_link_macos_gui(wpical)
wpilib_target_warnings(wpical)
target_include_directories(wpical PRIVATE src/main/native/include)

find_package(OpenCV REQUIRED)
target_link_libraries(
wpical
wpimath
libglassnt
libglass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

apriltaglib
${OpenCV_LIBS}
)

if(WIN32)
set_target_properties(wpical PROPERTIES WIN32_EXECUTABLE YES)
elseif(APPLE)
set_target_properties(wpical PROPERTIES MACOSX_BUNDLE YES OUTPUT_NAME "wpical")
endif()

if(WITH_TESTS)
wpilib_add_test(wpical src/test/native/cpp)
wpilib_link_macos_gui(wpical_test)
target_sources(wpical_test PRIVATE ${sysid_src})
target_compile_definitions(wpical_test PRIVATE RUNNING_WPICAL_TEST)
if(MSVC)
target_compile_options(wpical_test PRIVATE /utf-8)
endif()
target_include_directories(wpical_test PRIVATE src/main/native/cpp src/main/native/include)
target_link_libraries(wpical_test wpimath libglassnt libglass googletest)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
target_link_libraries(wpical_test wpimath libglassnt libglass googletest)
target_link_libraries(wpical_test wpimath googletest)

endif()
32 changes: 32 additions & 0 deletions wpical/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>WPIcal</string>
<key>CFBundleExecutable</key>
<string>wpical</string>
<key>CFBundleDisplayName</key>
<string>WPIcal</string>
<key>CFBundleIdentifier</key>
<string>edu.wpi.first.tools.WPIcal</string>
<key>CFBundleIconFile</key>
<string>ov.icns</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
<string>2021</string>
<key>CFBundleVersion</key>
<string>2021</string>
<key>LSMinimumSystemVersion</key>
<string>10.11</string>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>
Loading
Loading