Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
graphics
openMVG
fix_build_agains_cereal_1_3_1.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix_build_agains_cereal_1_3_1.patch of Package openMVG
From 1f9b938a4afcaf067b331eefeb9fa8743d1dfaba Mon Sep 17 00:00:00 2001 From: bartoszek <bartoszek.github@bartus.33mail.com> Date: Mon, 23 May 2022 02:43:19 +0200 Subject: [PATCH] Fix build againt cereal>1.3.0 (#2071) * Fix build against cereal>1.3.0 - As of cereal=1.3.1 target requires component Co-authored-by: bartoszek <szczepaniak.bartek+github@gmail.com> --- src/CMakeLists.txt | 6 ++++++ src/cmakeFindModules/OpenMVGConfig.cmake.in | 13 +++++++++++++ src/openMVG/cameras/CMakeLists.txt | 2 +- src/openMVG/features/CMakeLists.txt | 2 +- src/openMVG/geometry/CMakeLists.txt | 2 +- src/openMVG/matching/CMakeLists.txt | 2 +- src/openMVG/sfm/CMakeLists.txt | 2 +- 7 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 37b2aa6e38..cffffa29e2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -248,6 +248,7 @@ ENDMACRO(UNIT_TEST) # ============================================================================== # - external by default # - internal if cereal not found +# - as of cereal:1.3.1 target requires component # ============================================================================== find_package(cereal QUIET CONFIG) if (NOT cereal_FOUND) @@ -260,6 +261,11 @@ if (NOT cereal_FOUND) install(TARGETS cereal EXPORT openMVG-targets) set(OpenMVG_USE_INTERNAL_CEREAL ON) endif() +if (TARGET cereal::cereal) + set(cereal_TARGET "cereal::cereal") +else() + set(cereal_TARGET "cereal") +endif() # ============================================================================== # Eigen diff --git a/src/cmakeFindModules/OpenMVGConfig.cmake.in b/src/cmakeFindModules/OpenMVGConfig.cmake.in index e7dfbfd8a8..5a788b569c 100644 --- a/src/cmakeFindModules/OpenMVGConfig.cmake.in +++ b/src/cmakeFindModules/OpenMVGConfig.cmake.in @@ -82,6 +82,19 @@ endif (NOT EXISTS ${CURRENT_ROOT_INSTALL_DIR}/include/openMVG/version.hpp) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) +# Record state of build time dependencies +set(OpenMVG_USE_INTERNAL_CEREAL "@OpenMVG_USE_INTERNAL_CEREAL@") +set(OpenMVG_USE_OPENMP "@OpenMVG_USE_OPENMP@") + +# Find transitive dependencies if required +include(CMakeFindDependencyMacro) +if (OpenMVG_USE_OPENMP) + find_dependency(OpenMP REQUIRED) +endif() +if (NOT OpenMVG_USE_INTERNAL_CEREAL) + find_dependency(cereal REQUIRED) +endif() + # Import exported OpenMVG targets include(${CURRENT_CONFIG_INSTALL_DIR}/OpenMVGTargets.cmake) diff --git a/src/openMVG/cameras/CMakeLists.txt b/src/openMVG/cameras/CMakeLists.txt index 333ab72950..5909e592af 100644 --- a/src/openMVG/cameras/CMakeLists.txt +++ b/src/openMVG/cameras/CMakeLists.txt @@ -4,7 +4,7 @@ set_property(TARGET openMVG_camera APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:include>") target_compile_features(openMVG_camera INTERFACE ${CXX11_FEATURES}) -target_link_libraries(openMVG_camera INTERFACE openMVG_numeric cereal ${OPENMVG_LIBRARY_DEPENDENCIES}) +target_link_libraries(openMVG_camera INTERFACE openMVG_numeric ${cereal_TARGET} ${OPENMVG_LIBRARY_DEPENDENCIES}) install(TARGETS openMVG_camera DESTINATION lib EXPORT openMVG-targets) UNIT_TEST(openMVG Camera_Pinhole openMVG_camera) diff --git a/src/openMVG/features/CMakeLists.txt b/src/openMVG/features/CMakeLists.txt index 2e49701d37..96b1b30a59 100644 --- a/src/openMVG/features/CMakeLists.txt +++ b/src/openMVG/features/CMakeLists.txt @@ -31,7 +31,7 @@ target_include_directories(openMVG_features ) target_link_libraries(openMVG_features PRIVATE openMVG_fast ${STLPLUS_LIBRARY} - PUBLIC ${OPENMVG_LIBRARY_DEPENDENCIES} cereal) + PUBLIC ${OPENMVG_LIBRARY_DEPENDENCIES} ${cereal_TARGET}) if (MSVC) set_target_properties(openMVG_features PROPERTIES COMPILE_FLAGS "/bigobj") target_compile_options(openMVG_features PUBLIC "-D_USE_MATH_DEFINES") diff --git a/src/openMVG/geometry/CMakeLists.txt b/src/openMVG/geometry/CMakeLists.txt index 0a6a016a18..973978d1cd 100644 --- a/src/openMVG/geometry/CMakeLists.txt +++ b/src/openMVG/geometry/CMakeLists.txt @@ -21,7 +21,7 @@ set_property(TARGET openMVG_geometry PROPERTY FOLDER OpenMVG/OpenMVG) target_link_libraries(openMVG_geometry PUBLIC openMVG_numeric - cereal + ${cereal_TARGET} PRIVATE openMVG_linearProgramming ) diff --git a/src/openMVG/matching/CMakeLists.txt b/src/openMVG/matching/CMakeLists.txt index 2e0eafd7b3..4600550b9e 100644 --- a/src/openMVG/matching/CMakeLists.txt +++ b/src/openMVG/matching/CMakeLists.txt @@ -35,7 +35,7 @@ target_link_libraries(openMVG_matching PUBLIC openMVG_features Threads::Threads - cereal + ${cereal_TARGET} ) if (NOT DEFINED OpenMVG_USE_INTERNAL_FLANN) target_link_libraries(openMVG_matching diff --git a/src/openMVG/sfm/CMakeLists.txt b/src/openMVG/sfm/CMakeLists.txt index b89280834b..7aabc13614 100644 --- a/src/openMVG/sfm/CMakeLists.txt +++ b/src/openMVG/sfm/CMakeLists.txt @@ -25,7 +25,7 @@ target_link_libraries(openMVG_sfm openMVG_graph openMVG_matching openMVG_multiview - cereal + ${cereal_TARGET} ${OPENMVG_LIBRARY_DEPENDENCIES} )
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor