Skip to content

Commit

Permalink
[build] Do not overwrite existing library openMVG#1282
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoulon committed Apr 13, 2018
1 parent 464f100 commit 768bd44
Show file tree
Hide file tree
Showing 50 changed files with 147 additions and 157 deletions.
38 changes: 1 addition & 37 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ if (NOT Ceres_FOUND)
${PROJECT_BINARY_DIR}/third_party/ceres-solver/config)
FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/third_party/ceres-solver/VERSION" CERES_CONFIG)
STRING(REGEX REPLACE "version ([0-9.]+).*" "\\1" CERES_VERSION ${CERES_CONFIG})
set(CERES_LIBRARIES ceres)
set(CERES_LIBRARIES openMVG_ceres)
endif()

# ==============================================================================
Expand Down Expand Up @@ -391,42 +391,6 @@ add_subdirectory(testing)
# The openMVG library itself
add_subdirectory(openMVG)

# ==============================================================================
# openMVG libraries
# ==============================================================================
set(OpenMVG_LIBRARIES
openMVG_camera
openMVG_exif
openMVG_features
openMVG_geodesy
openMVG_geometry
openMVG_graph
openMVG_image
openMVG_kvld
openMVG_lInftyComputerVision
openMVG_matching
openMVG_matching_image_collection
openMVG_multiview
openMVG_sfm
openMVG_system
)

foreach(omvglib ${OpenMVG_LIBRARIES})
get_property(target_type TARGET ${omvglib} PROPERTY TYPE)
if (target_type STREQUAL STATIC_LIBRARY)
set_property(TARGET ${omvglib} PROPERTY FOLDER OpenMVG/OpenMVG)
set_property(TARGET ${omvglib} APPEND PROPERTY
INTERFACE_COMPILE_DEFINITIONS ${OpenMVG_DEFINITIONS})
string(REPLACE " " ";" REPLACED_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
target_compile_options(${omvglib} INTERFACE ${REPLACED_CMAKE_CXX_FLAGS})

check_cxx_compiler_flag("-std=c++11" COMPILER_HAS_CXX11_FLAG)
if (COMPILER_HAS_CXX11_FLAG)
target_compile_options(${omvglib} INTERFACE "-std=c++11")
endif(COMPILER_HAS_CXX11_FLAG)
endif()
endforeach()

# openMVG tutorial examples
if (OpenMVG_BUILD_EXAMPLES)
add_subdirectory(openMVG_Samples)
Expand Down
2 changes: 1 addition & 1 deletion src/openMVG/cameras/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ target_link_libraries(openMVG_camera_test INTERFACE openMVG_camera openMVG_multi
target_include_directories(openMVG_camera_test
INTERFACE $<BUILD_INTERFACE:${CEREAL_INCLUDE_DIRS}>)

UNIT_TEST(openMVG Camera_IO "openMVG_camera_test;stlplus")
UNIT_TEST(openMVG Camera_IO "openMVG_camera_test;${STLPLUS_LIBRARY}")

UNIT_TEST(openMVG Camera_Pinhole "openMVG_camera_test")

Expand Down
4 changes: 2 additions & 2 deletions src/openMVG/exif/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

add_library(openMVG_exif exif_IO_EasyExif.cpp)
target_link_libraries(openMVG_exif LINK_PRIVATE easyexif)
target_link_libraries(openMVG_exif LINK_PRIVATE openMVG_easyexif)
target_include_directories(openMVG_exif PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/third_party/include/easyexif)
install(TARGETS openMVG_exif DESTINATION lib EXPORT openMVG-targets)

UNIT_TEST(openMVG exif_IO "openMVG_testing;stlplus;openMVG_exif")
UNIT_TEST(openMVG exif_IO "openMVG_testing;${STLPLUS_LIBRARY};openMVG_exif")

add_subdirectory(sensor_width_database)
2 changes: 1 addition & 1 deletion src/openMVG/exif/sensor_width_database/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

UNIT_TEST(openMVG ParseDatabase "openMVG_testing;stlplus")
UNIT_TEST(openMVG ParseDatabase "openMVG_testing;${STLPLUS_LIBRARY}")

# Installation rules
install(FILES sensor_width_camera_database.txt DESTINATION share/openMVG)
4 changes: 2 additions & 2 deletions src/openMVG/features/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ target_include_directories(openMVG_features
$<INSTALL_INTERFACE:include>
$<INSTALL_INTERFACE:include/openMVG>
)
target_link_libraries(openMVG_features LINK_PRIVATE fast stlplus)
target_link_libraries(openMVG_features LINK_PRIVATE openMVG_fast ${STLPLUS_LIBRARY})
if (MSVC)
target_compile_options(openMVG_features PUBLIC "/bigobj")
endif ()
Expand All @@ -36,7 +36,7 @@ install(TARGETS openMVG_features DESTINATION lib EXPORT openMVG-targets)
set_property(TARGET openMVG_features PROPERTY FOLDER OpenMVG/OpenMVG)

UNIT_TEST(openMVG features "openMVG_features")
UNIT_TEST(openMVG image_describer "openMVG_features;stlplus")
UNIT_TEST(openMVG image_describer "openMVG_features;${STLPLUS_LIBRARY}")

add_subdirectory(akaze)
add_subdirectory(mser)
Expand Down
2 changes: 1 addition & 1 deletion src/openMVG/matching/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ target_include_directories(openMVG_matching
)
target_link_libraries(openMVG_matching
PRIVATE
stlplus
${STLPLUS_LIBRARY}
PUBLIC
openMVG_features
Threads::Threads
Expand Down
4 changes: 2 additions & 2 deletions src/openMVG/multiview/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ add_library(openMVG_multiview
set_property(TARGET openMVG_multiview PROPERTY FOLDER OpenMVG)
install(TARGETS openMVG_multiview DESTINATION lib EXPORT openMVG-targets)
target_link_libraries(openMVG_multiview
LINK_PUBLIC
PUBLIC
openMVG_numeric
LINK_PRIVATE
PRIVATE
openMVG_graph
${CERES_LIBRARIES}
)
Expand Down
8 changes: 4 additions & 4 deletions src/openMVG/sfm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ target_link_libraries(openMVG_sfm
openMVG_image
openMVG_lInftyComputerVision
openMVG_system
stlplus
${STLPLUS_LIBRARY}
)
target_include_directories(openMVG_sfm
PRIVATE
Expand All @@ -47,9 +47,9 @@ set_target_properties(openMVG_sfm PROPERTIES SOVERSION ${OPENMVG_VERSION_MAJOR}

install(TARGETS openMVG_sfm DESTINATION lib EXPORT openMVG-targets)

UNIT_TEST(openMVG sfm_data_io "openMVG_sfm;stlplus")
UNIT_TEST(openMVG sfm_data_BA "openMVG_multiview_test_data;openMVG_sfm;stlplus")
UNIT_TEST(openMVG sfm_data_utils "openMVG_sfm;stlplus")
UNIT_TEST(openMVG sfm_data_io "openMVG_sfm;${STLPLUS_LIBRARY}")
UNIT_TEST(openMVG sfm_data_BA "openMVG_multiview_test_data;openMVG_sfm;${STLPLUS_LIBRARY}")
UNIT_TEST(openMVG sfm_data_utils "openMVG_sfm;${STLPLUS_LIBRARY}")
UNIT_TEST(openMVG sfm_data_filters "openMVG_sfm")
UNIT_TEST(openMVG sfm_data_graph_utils "openMVG_sfm")

Expand Down
2 changes: 1 addition & 1 deletion src/openMVG/sfm/pipelines/global/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

UNIT_TEST(openMVG global_SfM
"openMVG_multiview_test_data;openMVG_sfm;stlplus")
"openMVG_multiview_test_data;openMVG_sfm;${STLPLUS_LIBRARY}")
2 changes: 1 addition & 1 deletion src/openMVG/sfm/pipelines/sequential/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

UNIT_TEST(openMVG sequential_SfM
"openMVG_multiview_test_data;openMVG_sfm;stlplus")
"openMVG_multiview_test_data;openMVG_sfm;${STLPLUS_LIBRARY}")
2 changes: 1 addition & 1 deletion src/openMVG_Samples/cameras_undisto_Brown/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ target_link_libraries(openMVG_sample_cameras_undistoBrown
openMVG_geometry
openMVG_image
openMVG_multiview
stlplus)
${STLPLUS_LIBRARY})
set_property(TARGET openMVG_sample_cameras_undistoBrown PROPERTY FOLDER OpenMVG/Samples)
2 changes: 1 addition & 1 deletion src/openMVG_Samples/features_affine_demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ target_link_libraries(openMVG_sample_features_affine
openMVG_image
openMVG_features
openMVG_system
stlplus)
${STLPLUS_LIBRARY})
target_compile_definitions(openMVG_sample_features_affine
PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
set_property(TARGET openMVG_sample_features_affine PROPERTY FOLDER OpenMVG/Samples)
2 changes: 1 addition & 1 deletion src/openMVG_Samples/features_image_matching/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ target_link_libraries(openMVG_sample_image_matching
openMVG_image
openMVG_features
openMVG_matching
stlplus
${STLPLUS_LIBRARY}
vlsift)
target_compile_definitions(openMVG_sample_image_matching
PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ target_link_libraries(openMVG_sample_image_matching_gmsfilter
openMVG_matching
openMVG_multiview
openMVG_robust_estimation
stlplus
${STLPLUS_LIBRARY}
)
target_compile_definitions(openMVG_sample_image_matching_gmsfilter
PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
Expand Down
2 changes: 1 addition & 1 deletion src/openMVG_Samples/features_kvld_filter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ target_link_libraries(openMVG_sample_features_kvld
openMVG_kvld
openMVG_features
openMVG_matching
stlplus)
${STLPLUS_LIBRARY})
target_compile_definitions(openMVG_sample_features_kvld
PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
set_property(TARGET openMVG_sample_features_kvld PROPERTY FOLDER OpenMVG/Samples)
2 changes: 1 addition & 1 deletion src/openMVG_Samples/features_repeatability/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ target_link_libraries(openMVG_sample_main_features_repeatability_dataset
openMVG_system
openMVG_multiview
vlsift
stlplus)
${STLPLUS_LIBRARY})

set_property(TARGET openMVG_sample_main_features_repeatability_dataset PROPERTY FOLDER OpenMVG/Samples)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ target_link_libraries(openMVG_sample_features_siftPutative
openMVG_image
openMVG_features
openMVG_matching
stlplus)
${STLPLUS_LIBRARY})
target_compile_definitions(openMVG_sample_features_siftPutative
PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
set_property(TARGET openMVG_sample_features_siftPutative PROPERTY FOLDER OpenMVG/Samples)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ target_link_libraries(openMVG_sample_geodesy_show_exif_gps_position
PRIVATE
openMVG_exif
openMVG_geodesy
stlplus)
${STLPLUS_LIBRARY})
target_compile_definitions(openMVG_sample_geodesy_show_exif_gps_position
PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
set_property(TARGET openMVG_sample_geodesy_show_exif_gps_position PROPERTY FOLDER OpenMVG/Samples)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ add_executable(openMVG_sample_pano_converter main_pano_converter.cpp)
target_link_libraries(openMVG_sample_pano_converter
openMVG_numeric
openMVG_image
stlplus)
${STLPLUS_LIBRARY})

set_property(TARGET openMVG_sample_pano_converter PROPERTY FOLDER OpenMVG/Samples)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ target_link_libraries(openMVG_sample_multiview_robustEssential
openMVG_geometry
openMVG_matching
openMVG_sfm
stlplus)
${STLPLUS_LIBRARY})
target_compile_definitions(openMVG_sample_multiview_robustEssential
PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
set_property(TARGET openMVG_sample_multiview_robustEssential PROPERTY FOLDER OpenMVG/Samples)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ target_link_libraries(openMVG_sample_multiview_robustEssential_ba
openMVG_matching
openMVG_system
openMVG_sfm
stlplus)
${STLPLUS_LIBRARY})
target_compile_definitions(openMVG_sample_multiview_robustEssential_ba
PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
set_property(TARGET openMVG_sample_multiview_robustEssential_ba PROPERTY FOLDER OpenMVG/Samples)
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ target_link_libraries(openMVG_sample_multiview_robustEssential_spherical
openMVG_matching
openMVG_system
openMVG_sfm
stlplus)
${STLPLUS_LIBRARY})
target_compile_definitions(openMVG_sample_multiview_robustEssential_spherical
PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
set_property(TARGET openMVG_sample_multiview_robustEssential_spherical PROPERTY FOLDER OpenMVG/Samples)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ target_link_libraries(openMVG_sample_robust_estimation_Homography
openMVG_multiview
openMVG_features
openMVG_matching
stlplus)
${STLPLUS_LIBRARY})
target_compile_definitions(openMVG_sample_robust_estimation_Homography
PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
set_property(TARGET openMVG_sample_robust_estimation_Homography PROPERTY FOLDER OpenMVG/Samples)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ target_link_libraries(openMVG_sample_multiview_robustFundamental
openMVG_multiview
openMVG_features
openMVG_matching
stlplus)
${STLPLUS_LIBRARY})
target_compile_definitions(openMVG_sample_multiview_robustFundamental
PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
set_property(TARGET openMVG_sample_multiview_robustFundamental PROPERTY FOLDER OpenMVG/Samples)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ target_link_libraries(openMVG_sample_multiview_robustFundamental_guided
openMVG_multiview
openMVG_features
openMVG_matching
stlplus)
${STLPLUS_LIBRARY})
target_compile_definitions(openMVG_sample_multiview_robustFundamental_guided
PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
set_property(TARGET openMVG_sample_multiview_robustFundamental_guided PROPERTY FOLDER OpenMVG/Samples)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ target_link_libraries(openMVG_sample_multiview_robustHomography
openMVG_multiview
openMVG_features
openMVG_matching
stlplus)
${STLPLUS_LIBRARY})
target_compile_definitions(openMVG_sample_multiview_robustHomography
PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
set_property(TARGET openMVG_sample_multiview_robustHomography PROPERTY FOLDER OpenMVG/Samples)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ target_link_libraries(openMVG_sample_multiview_robustHomography_guided
openMVG_multiview
openMVG_features
openMVG_matching
stlplus)
${STLPLUS_LIBRARY})
target_compile_definitions(openMVG_sample_multiview_robustHomography_guided
PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
set_property(TARGET openMVG_sample_multiview_robustHomography_guided PROPERTY FOLDER OpenMVG/Samples)
2 changes: 1 addition & 1 deletion src/software/Geodesy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ target_link_libraries(openMVG_main_geodesy_registration_to_gps_position
openMVG_geodesy
openMVG_sfm
openMVG_system
stlplus
${STLPLUS_LIBRARY}
)

set_property(TARGET openMVG_main_geodesy_registration_to_gps_position PROPERTY FOLDER OpenMVG/software)
Expand Down
2 changes: 1 addition & 1 deletion src/software/Localization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ target_link_libraries(openMVG_main_SfM_Localization
openMVG_matching_image_collection
openMVG_sfm
openMVG_exif
stlplus
${STLPLUS_LIBRARY}
vlsift
)

Expand Down
Loading

0 comments on commit 768bd44

Please sign in to comment.