Skip to content

Commit

Permalink
[cmake] Add SKIP_TOOLS option (#2958)
Browse files Browse the repository at this point in the history
* [cmake] Add SKIP_TOOLS option

If you are only interested in building and installing the desktop app, calling
make install would build all the tools, when configured with SKIP_TOOLS=ON it
only builds the required target.

Signed-off-by: Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fastmail.net>

* [cmake] Remove repeated check

Signed-off-by: Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fastmail.net>
  • Loading branch information
jaimeMF authored Jul 21, 2022
1 parent 8c9148f commit 62f729d
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 24 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -377,16 +377,16 @@ if (PLATFORM_DESKTOP)
add_subdirectory(mapshot)
add_subdirectory(software_renderer)
endif()
add_subdirectory(feature_list)
omim_add_tool_subdirectory(feature_list)
add_subdirectory(generator)
add_subdirectory(openlr)
add_subdirectory(poly_borders)
add_subdirectory(topography_generator)
omim_add_tool_subdirectory(topography_generator)
add_subdirectory(track_analyzing)
add_subdirectory(track_generator)
omim_add_tool_subdirectory(track_generator)
if (NOT SKIP_DESKTOP)
add_subdirectory(qt)
add_subdirectory(skin_generator)
omim_add_tool_subdirectory(skin_generator)
endif()
endif()

Expand Down
8 changes: 8 additions & 0 deletions cmake/OmimHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ function(omim_add_test_subdirectory subdir)
endif()
endfunction()

function(omim_add_tool_subdirectory subdir)
if (NOT SKIP_TOOLS)
add_subdirectory(${subdir})
else()
message("SKIP_TOOLS: Skipping subdirectory ${subdir}")
endif()
endfunction()

function(omim_add_pybindings_subdirectory subdir)
if (PYBINDINGS)
add_subdirectory(${subdir})
Expand Down
8 changes: 4 additions & 4 deletions generator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ omim_add_test_subdirectory(generator_tests_support)
omim_add_test_subdirectory(generator_tests)
omim_add_test_subdirectory(generator_integration_tests)

add_subdirectory(generator_tool)
add_subdirectory(complex_generator)
add_subdirectory(feature_segments_checker)
add_subdirectory(srtm_coverage_checker)
omim_add_tool_subdirectory(generator_tool)
omim_add_tool_subdirectory(complex_generator)
omim_add_tool_subdirectory(feature_segments_checker)
omim_add_tool_subdirectory(srtm_coverage_checker)
add_subdirectory(world_roads_builder)
2 changes: 1 addition & 1 deletion generator/mwm_diff/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ target_link_libraries(${PROJECT_NAME}
coding
)

add_subdirectory(mwm_diff_tool)
omim_add_tool_subdirectory(mwm_diff_tool)

omim_add_test_subdirectory(mwm_diff_tests)
2 changes: 1 addition & 1 deletion generator/world_roads_builder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ target_link_libraries(${PROJECT_NAME}
geometry
)

add_subdirectory(world_roads_builder_tool)
omim_add_tool_subdirectory(world_roads_builder_tool)
2 changes: 1 addition & 1 deletion kml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ target_link_libraries(${PROJECT_NAME} indexer)
omim_add_test_subdirectory(kml_tests)

if(PLATFORM_DESKTOP)
add_subdirectory(kmb_to_kml)
omim_add_tool_subdirectory(kmb_to_kml)
endif()
4 changes: 2 additions & 2 deletions map/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ omim_add_test_subdirectory(mwm_tests)
omim_add_test_subdirectory(style_tests)

if (PLATFORM_DESKTOP)
add_subdirectory(benchmark_tool)
add_subdirectory(extrapolation_benchmark)
omim_add_tool_subdirectory(benchmark_tool)
omim_add_tool_subdirectory(extrapolation_benchmark)
endif()
4 changes: 2 additions & 2 deletions openlr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ target_link_libraries(${PROJECT_NAME}
pugixml
)

add_subdirectory(openlr_match_quality)
add_subdirectory(openlr_stat)
omim_add_tool_subdirectory(openlr_match_quality)
omim_add_tool_subdirectory(openlr_stat)

omim_add_test_subdirectory(openlr_tests)
2 changes: 1 addition & 1 deletion poly_borders/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ target_link_libraries(${PROJECT_NAME} generator)

omim_add_test_subdirectory(poly_borders_tests)

add_subdirectory(poly_borders_tool)
omim_add_tool_subdirectory(poly_borders_tool)
2 changes: 1 addition & 1 deletion routing/routes_builder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ target_link_libraries(${PROJECT_NAME}
storage
)

add_subdirectory(routes_builder_tool)
omim_add_tool_subdirectory(routes_builder_tool)
2 changes: 1 addition & 1 deletion routing/routing_quality/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ target_link_libraries(${PROJECT_NAME}
)

add_subdirectory(api)
add_subdirectory(routing_quality_tool)
omim_add_tool_subdirectory(routing_quality_tool)

omim_add_test_subdirectory(routing_quality_tests)
8 changes: 4 additions & 4 deletions search/search_quality/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ target_link_libraries(${PROJECT_NAME}
)

if (NOT SKIP_DESKTOP)
add_subdirectory(assessment_tool)
omim_add_tool_subdirectory(assessment_tool)
endif()

add_subdirectory(features_collector_tool)
add_subdirectory(samples_generation_tool)
add_subdirectory(search_quality_tool)
omim_add_tool_subdirectory(features_collector_tool)
omim_add_tool_subdirectory(samples_generation_tool)
omim_add_tool_subdirectory(search_quality_tool)

omim_add_test_subdirectory(search_quality_tests)
2 changes: 1 addition & 1 deletion track_analyzing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ target_link_libraries(${PROJECT_NAME}
platform
)

add_subdirectory(track_analyzer)
omim_add_tool_subdirectory(track_analyzer)
omim_add_test_subdirectory(track_analyzing_tests)
2 changes: 1 addition & 1 deletion transit/world_feed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ target_link_libraries(${PROJECT_NAME}
opening_hours
)

add_subdirectory(gtfs_converter)
omim_add_tool_subdirectory(gtfs_converter)

omim_add_test_subdirectory(world_feed_tests)
omim_add_test_subdirectory(world_feed_integration_tests)

0 comments on commit 62f729d

Please sign in to comment.