-
Notifications
You must be signed in to change notification settings - Fork 553
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build as sub components with defined exports
- Loading branch information
Showing
86 changed files
with
600 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## Build Examples | ||
|
||
### Note | ||
# apriltag targets are in the same build tree so can be used directly without installation | ||
# or including the build-generated apriltagsTargets.cmake file | ||
# | ||
# Typical usage would be to build and *install* the apriltag libraries and then, for your project use | ||
# find_package(apriltag REQUIRED) | ||
# target_link_libraries(my_application PRIVATE apriltag::detector apriltag::utils apriltag::tags) | ||
|
||
# apriltag_demo | ||
add_executable(apriltag_demo apriltag_demo.c) | ||
target_link_libraries(apriltag_demo PRIVATE apriltag-detector apriltag-utils apriltag-tags) | ||
|
||
set(_OpenCV_REQUIRED_COMPONENTS core imgproc videoio highgui) | ||
find_package(OpenCV COMPONENTS ${_OpenCV_REQUIRED_COMPONENTS} QUIET CONFIG) | ||
if(OpenCV_FOUND) | ||
# NB: contrib required for TickMeter in OpenCV 2.4. This is only required for 16.04 backwards compatibility and can be removed in the future. | ||
# If we add it to the find_package initially, the demo won't build for newer OpenCV versions | ||
if(OpenCV_VERSION VERSION_LESS "3.0.0") | ||
list(APPEND _OpenCV_REQUIRED_COMPONENTS contrib) | ||
find_package(OpenCV COMPONENTS ${_OpenCV_REQUIRED_COMPONENTS} CONFIG) | ||
endif() | ||
|
||
add_executable(opencv_demo opencv_demo.cc) | ||
target_link_libraries(opencv_demo apriltag-detector apriltag-tags apriltag-utils ${OpenCV_LIBRARIES}) | ||
set_target_properties(opencv_demo PROPERTIES CXX_STANDARD 11) | ||
install(TARGETS opencv_demo RUNTIME DESTINATION bin) | ||
else() | ||
message(STATUS "OpenCV not found: Not building demo") | ||
endif(OpenCV_FOUND) | ||
|
||
# install example programs | ||
install(TARGETS apriltag_demo RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Helper Functions | ||
function(set_apriltag_lib_property_defaults target_name) | ||
set_target_properties(${target_name} PROPERTIES SOVERSION 3 VERSION ${PROJECT_VERSION}) | ||
set_target_properties(${target_name} PROPERTIES DEBUG_POSTFIX "d") | ||
set_target_properties(${target_name} PROPERTIES POSITION_INDEPENDENT_CODE ON) | ||
endfunction() | ||
|
||
function(set_apriltag_named_exports_only target_name) | ||
set_target_properties(${target_name} PROPERTIES | ||
C_VISIBILITY_PRESET hidden | ||
CXX_VISIBILITY_PRESET hidden | ||
VISIBILITY_INLINES_HIDDEN ON | ||
WINDOWS_EXPORT_ALL_SYMBOLS OFF | ||
# multiple libs sharing same auto-generated header so override default to use apriltag_EXPORTS | ||
DEFINE_SYMBOL apriltag_EXPORTS | ||
) | ||
endfunction() | ||
|
||
function(set_apriltag_export_all target_name) | ||
set_target_properties(${target_name} PROPERTIES | ||
C_VISIBILITY_PRESET default | ||
CXX_VISIBILITY_PRESET default | ||
VISIBILITY_INLINES_HIDDEN OFF | ||
WINDOWS_EXPORT_ALL_SYMBOLS ON | ||
# multiple libs sharing same auto-generated header so override default to use apriltag_EXPORTS | ||
DEFINE_SYMBOL apriltag_EXPORTS | ||
) | ||
endfunction() |
Oops, something went wrong.