-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Modify CMakeLists to use openMVG on other project #1250
base: develop
Are you sure you want to change the base?
Conversation
1. Fix stlplus3 CMakeLists to generate proper include paths 2. Add & export dependencies/cereal to openMVG-targets 3. Add & export header only third_party folders to openMVG-targets
This pr requires below. Related pr on cereal. |
src/openMVG/cameras/CMakeLists.txt
Outdated
target_link_libraries(openMVG_camera_test INTERFACE openMVG_camera openMVG_multiview) | ||
target_include_directories(openMVG_camera_test | ||
INTERFACE $<BUILD_INTERFACE:${CEREAL_INCLUDE_DIRS}>) | ||
target_link_libraries(openMVG_camera_test INTERFACE openMVG_camera openMVG_multiview cereal) |
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.
ceresl is already linked in openMVG_camera so you do need to add it there.
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.
Got it, I'll remove cereal from openMVG_camera_test
src/third_party/CMakeLists.txt
Outdated
@@ -119,4 +119,10 @@ install( | |||
COMPONENT headers | |||
FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h" | |||
) | |||
add_library(${inDirectory} INTERFACE) |
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.
Can you explain why you need this?
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.
At first, I want to declare every third-party utility explicitly so it gives more modularity.
However, just adding 'include/openMVG' to OPENMVG_INCLUDE_DIRS would be enough.
src/CMakeLists.txt
Outdated
# ============================================================================== | ||
# Dependency libraries: | ||
# ============================================================================== | ||
add_subdirectory(dependencies/cereal) |
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.
We need to do this only if we use the internal cereal. Please note that OpenMVG can use an external cereal library.
Can you check that your modification will work even you are using an external cereal library.
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.
Got it.
Thx you. |
FYI, your changes are not working on VisualStudio CI: https://ci.appveyor.com/project/pmoulon/openmvg/build/1.0.861 |
Since openMVG-targets have namespace, prefix has to be added
Example
|
I will look to your PR. FYI: According the last change those lines should not be required:
All the includes and compilation flags should be added by:
|
While I'm using openMVG in my project, I suffered a lot of troubles especially related to include paths.
This pr mainly focused on proper include path configuration.
Also, it should update dependencies/cereal submodule, too.
So, I'll create the corresponding pr to that repo.
Since I just learned about modern CMake, let me know if I misunderstood your intention.