-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
Embed camera definition files for Yuneec camera #479
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a26987a
camera: embed camera definition files for Yuneec
julianoes 44a7a95
cmake: support Linux and Apple to embed file
julianoes 3fc17e6
camera: only cache file for Linux and macOS
julianoes 838e12f
Add orex/cpp_rsc submodule to embed files in bin
julianoes 813d506
camera: make use of cpp_rsc file embedding
julianoes 05d4395
camera: no embedding using rsc_cpp on Windows
julianoes 595b901
build_system: workaround for iOS to find cpp_rsc
julianoes 83febf2
build_system: use MSVC instead of WINDOWS in cmake
julianoes 30f99aa
build_system: properly re-use cpp_rsc from default
julianoes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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,27 @@ | ||
# Compilation step for static resources | ||
# Taken from: | ||
# https://beesbuzz.biz/code/4399-Embedding-binary-resources-with-CMake-and-C-11 | ||
function(ADD_RESOURCES out_var) | ||
set(result) | ||
foreach(in_f ${ARGN}) | ||
set(out_f "${CMAKE_CURRENT_BINARY_DIR}/${in_f}.o") | ||
file(RELATIVE_PATH rel_path_with_file ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${in_f}) | ||
get_filename_component(rel_path ${rel_path_with_file} DIRECTORY) | ||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${rel_path}) | ||
|
||
if (APPLE) | ||
set(binary_options -sectcreate binary) | ||
else() | ||
set(binary_options -b binary) | ||
endif() | ||
|
||
add_custom_command(OUTPUT ${out_f} | ||
COMMAND ld -r ${binary_options} -o ${out_f} ${CMAKE_CURRENT_SOURCE_DIR}/${in_f} | ||
DEPENDS ${in_f} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
COMMENT "Adding resource ${in_f}" | ||
VERBATIM) | ||
list(APPEND result ${out_f}) | ||
endforeach() | ||
set(${out_var} "${result}" PARENT_SCOPE) | ||
endfunction() |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get where that is used :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used in https://github.com/orex/cpp_rsc/blob/928ad84e11d768b1c6a3aa427277234b49b53cb5/cmake/modules/cpp_resource.cmake#L71.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. And
add_resource
andlink_resource_file
come from cpp_rsc as well.