Skip to content

Commit

Permalink
added cmake-format for pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
soblin committed Mar 13, 2022
1 parent c77c415 commit 673fbda
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 36 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions gallery/artist_animation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
6 changes: 3 additions & 3 deletions gallery/images_contours_and_fields/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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")
18 changes: 14 additions & 4 deletions gallery/lines_bars_and_markers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
6 changes: 3 additions & 3 deletions gallery/mplot3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
6 changes: 3 additions & 3 deletions gallery/scales/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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")
6 changes: 3 additions & 3 deletions gallery/shapes_and_collections/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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")
6 changes: 3 additions & 3 deletions gallery/statistics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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")
9 changes: 5 additions & 4 deletions gallery/subplots_axes_and_figures/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
3 changes: 2 additions & 1 deletion hello_world/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
8 changes: 4 additions & 4 deletions tests/test_shared_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_static_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 673fbda

Please sign in to comment.