From 673fbda3e8ce2af44923506e92ba9f9741834785 Mon Sep 17 00:00:00 2001 From: soblin Date: Mon, 14 Mar 2022 07:51:41 +0900 Subject: [PATCH] added cmake-format for pre-commit --- CMakeLists.txt | 1 - gallery/artist_animation/CMakeLists.txt | 6 +++--- .../images_contours_and_fields/CMakeLists.txt | 6 +++--- gallery/lines_bars_and_markers/CMakeLists.txt | 18 ++++++++++++++---- gallery/mplot3d/CMakeLists.txt | 6 +++--- gallery/scales/CMakeLists.txt | 6 +++--- gallery/shapes_and_collections/CMakeLists.txt | 6 +++--- gallery/statistics/CMakeLists.txt | 6 +++--- .../subplots_axes_and_figures/CMakeLists.txt | 9 +++++---- hello_world/CMakeLists.txt | 3 ++- tests/test_shared_lib/CMakeLists.txt | 8 ++++---- tests/test_static_lib/CMakeLists.txt | 8 ++++---- 12 files changed, 47 insertions(+), 36 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1334a6..8c61943 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,7 +129,6 @@ set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") # create .deb include("${PROJECT_SOURCE_DIR}/cmake/package.cmake") -# uninstall target. actually it's just `xargs rm < install_manifest.txt` # https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake if(NOT TARGET uninstall) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/uninstall.cmake.in" diff --git a/gallery/artist_animation/CMakeLists.txt b/gallery/artist_animation/CMakeLists.txt index dd742b0..0267d4d 100644 --- a/gallery/artist_animation/CMakeLists.txt +++ b/gallery/artist_animation/CMakeLists.txt @@ -2,11 +2,11 @@ add_demo(cla_pause cla_pause.cpp) add_demo(animate_decay animate_decay.cpp) add_demo(random_walk random_walk.cpp) -add_custom_target(artist_animation +add_custom_target( + artist_animation DEPENDS cla_pause animate_decay COMMAND cla_pause COMMAND animate_decay COMMAND random_walk COMMENT "running artist_animation" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../images" -) + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../images") diff --git a/gallery/images_contours_and_fields/CMakeLists.txt b/gallery/images_contours_and_fields/CMakeLists.txt index 68c01bf..56ce421 100644 --- a/gallery/images_contours_and_fields/CMakeLists.txt +++ b/gallery/images_contours_and_fields/CMakeLists.txt @@ -1,10 +1,10 @@ add_demo(quiver_demo quiver_demo.cpp) add_demo(contourf_log contourf_log) -add_custom_target(images_contours_and_fields +add_custom_target( + images_contours_and_fields DEPENDS quiver_demo contourf_log COMMAND quiver_demo COMMAND contourf_log COMMENT "running images_contours_and_fields" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../images" -) + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../images") diff --git a/gallery/lines_bars_and_markers/CMakeLists.txt b/gallery/lines_bars_and_markers/CMakeLists.txt index ca61696..bf86702 100644 --- a/gallery/lines_bars_and_markers/CMakeLists.txt +++ b/gallery/lines_bars_and_markers/CMakeLists.txt @@ -10,8 +10,19 @@ add_demo(errorbar_limits_simple errorbar_limits_simple.cpp) add_demo(errorbar_subsample errorbar_subsample.cpp) add_demo(step_demo step_demo.cpp) -add_custom_target(lines_bars_and_markers - DEPENDS bar_label_demo fill simple_plot scatter_symbol fill_between_demo fill_betweenx_demo scatter_with_legend scatter_hist errorbar_limits_simple errorbar_subsample step_demo +add_custom_target( + lines_bars_and_markers + DEPENDS bar_label_demo + fill + simple_plot + scatter_symbol + fill_between_demo + fill_betweenx_demo + scatter_with_legend + scatter_hist + errorbar_limits_simple + errorbar_subsample + step_demo COMMAND bar_label_demo COMMAND fill COMMAND simple_plot @@ -24,5 +35,4 @@ add_custom_target(lines_bars_and_markers COMMAND errorbar_subsample COMMAND step_demo COMMENT "running lines_bars_and_markers" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../images" -) + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../images") diff --git a/gallery/mplot3d/CMakeLists.txt b/gallery/mplot3d/CMakeLists.txt index c9583c4..bd52ed6 100644 --- a/gallery/mplot3d/CMakeLists.txt +++ b/gallery/mplot3d/CMakeLists.txt @@ -5,7 +5,8 @@ add_demo(subplot3d subplot3d.cpp) add_demo(errorbar3d errorbar3d.cpp) add_demo(surface3d surface3d) -add_custom_target(mplot3d +add_custom_target( + mplot3d DEPENDS lines3d lorenz_attractor contour3d subplot3d errorbar3d surface3d COMMAND lines3d COMMAND lorenz_attractor @@ -14,5 +15,4 @@ add_custom_target(mplot3d COMMAND errorbar3d COMMAND surface3d COMMENT "running mplot3d" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../images" -) + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../images") diff --git a/gallery/scales/CMakeLists.txt b/gallery/scales/CMakeLists.txt index 2bde8aa..535f8ef 100644 --- a/gallery/scales/CMakeLists.txt +++ b/gallery/scales/CMakeLists.txt @@ -1,8 +1,8 @@ add_demo(aspect_loglog aspect_loglog.cpp) -add_custom_target(scales +add_custom_target( + scales DEPENDS aspect_loglog COMMAND aspect_loglog COMMENT "running scales" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../images" -) + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../images") diff --git a/gallery/shapes_and_collections/CMakeLists.txt b/gallery/shapes_and_collections/CMakeLists.txt index 28be099..a826d5f 100644 --- a/gallery/shapes_and_collections/CMakeLists.txt +++ b/gallery/shapes_and_collections/CMakeLists.txt @@ -1,10 +1,10 @@ add_demo(patch_collection patch_collection.cpp) add_demo(patches_circle_rectangle patches_circle_rectangle.cpp) -add_custom_target(shapes_and_collections +add_custom_target( + shapes_and_collections DEPENDS patch_collection patches_circle_rectangle COMMAND patch_collection COMMAND patches_circle_rectangle COMMENT "running shapes_and_collections" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../images" -) + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../images") diff --git a/gallery/statistics/CMakeLists.txt b/gallery/statistics/CMakeLists.txt index be84ebb..09963e8 100644 --- a/gallery/statistics/CMakeLists.txt +++ b/gallery/statistics/CMakeLists.txt @@ -1,10 +1,10 @@ add_demo(hist hist.cpp) add_demo(errorbar errorbar.cpp) -add_custom_target(statitics +add_custom_target( + statitics DEPENDS hist errorbar COMMAND hist COMMAND errorbar COMMENT "running hist" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../images" -) + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../images") diff --git a/gallery/subplots_axes_and_figures/CMakeLists.txt b/gallery/subplots_axes_and_figures/CMakeLists.txt index 541f572..cbe490b 100644 --- a/gallery/subplots_axes_and_figures/CMakeLists.txt +++ b/gallery/subplots_axes_and_figures/CMakeLists.txt @@ -5,13 +5,14 @@ add_demo(colorbar_placement colorbar_placement.cpp) add_demo(subplots subplots.cpp) add_demo(two_scales two_scales.cpp) -add_custom_target(subplots_axes_and_figures - DEPENDS align_labels_demo gridspec_multicolumn multiple_figs_demo colorbar_placement two_scales +add_custom_target( + subplots_axes_and_figures + DEPENDS align_labels_demo gridspec_multicolumn multiple_figs_demo + colorbar_placement two_scales COMMAND align_labels_demo COMMAND gridspec_multicolumn COMMAND multiple_figs_demo COMMAND colorbar_placement COMMAND two_scales COMMENT "subplots_axes_and_figures" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -) + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/hello_world/CMakeLists.txt b/hello_world/CMakeLists.txt index c135dcc..8ced7a8 100644 --- a/hello_world/CMakeLists.txt +++ b/hello_world/CMakeLists.txt @@ -9,4 +9,5 @@ find_package(matplotlibcpp17 REQUIRED) add_executable(hello_world hello_world.cpp) target_include_directories(hello_world PUBLIC ${Python3_INCLUDE_DIRS}) -target_link_libraries(hello_world ${Python3_LIBRARIES} pybind11::embed matplotlibcpp17::matplotlibcpp17) +target_link_libraries(hello_world ${Python3_LIBRARIES} pybind11::embed + matplotlibcpp17::matplotlibcpp17) diff --git a/tests/test_shared_lib/CMakeLists.txt b/tests/test_shared_lib/CMakeLists.txt index 2b82e27..925d2dc 100644 --- a/tests/test_shared_lib/CMakeLists.txt +++ b/tests/test_shared_lib/CMakeLists.txt @@ -1,9 +1,9 @@ # create library -add_library(test_shared_lib SHARED - test_lib.cpp -) +add_library(test_shared_lib SHARED test_lib.cpp) target_compile_options(test_shared_lib PUBLIC "-fPIC") -target_include_directories(test_shared_lib PUBLIC ${Python3_INCLUDE_DIRS} ${matplotlibcpp17_INCLUDE_DIRS}) +target_include_directories( + test_shared_lib PUBLIC ${Python3_INCLUDE_DIRS} + ${matplotlibcpp17_INCLUDE_DIRS}) target_link_libraries(test_shared_lib ${Python3_LIBRARIES} pybind11::embed) # link it add_executable(test_lib_main test_lib_main.cpp) diff --git a/tests/test_static_lib/CMakeLists.txt b/tests/test_static_lib/CMakeLists.txt index 50e1ac1..3955dfe 100644 --- a/tests/test_static_lib/CMakeLists.txt +++ b/tests/test_static_lib/CMakeLists.txt @@ -1,9 +1,9 @@ # create library -add_library(test_static_lib STATIC - test_lib.cpp -) +add_library(test_static_lib STATIC test_lib.cpp) target_compile_options(test_static_lib PUBLIC "-fPIC") -target_include_directories(test_static_lib PUBLIC ${Python3_INCLUDE_DIRS} ${matplotlibcpp17_INCLUDE_DIRS}) +target_include_directories( + test_static_lib PUBLIC ${Python3_INCLUDE_DIRS} + ${matplotlibcpp17_INCLUDE_DIRS}) target_link_libraries(test_static_lib ${Python3_LIBRARIES} pybind11::embed) # link it add_executable(test_lib_static_main test_lib_main.cpp)