Skip to content

Commit

Permalink
CMakeLists for all executables in examples folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryoris committed Oct 30, 2019
1 parent b959de0 commit a5cef23
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,4 @@ else()
add_definitions(-DWITHOUT_NUMPY)
endif()

# add_subdirectory("examples")
set(CMAKE_CXX_STANDARD 17)
add_executable(basic examples/basic.cpp matplotlibcpp.h)
target_link_libraries(basic ${Python3_LIBRARIES})
add_subdirectory(examples)
34 changes: 34 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
function(add_example basename)
# set C++ standard to C++17
set(CMAKE_CXX_STANDARD 17)

# add WITH_EIGEN, if specified
if(WITH_EIGEN)
add_definitions("-DWITH_EIGEN")
endif()

# add the exectuable and link it to the Python libs
add_executable(${basename} ${basename}.cpp ../matplotlibcpp.h)
target_link_libraries(${basename} ${Python3_LIBRARIES})
endfunction(add_example)

# add the executables
add_example(bar)
add_example(basic)
add_example(eigen)
add_example(errorbar)
add_example(fill_inbetween)
add_example(fill)
add_example(loglog)
add_example(minimal)
add_example(modern)
add_example(nonblock)
add_example(quiver)
add_example(semilogx)
add_example(semilogy)
add_example(small)
add_example(spy)
add_example(subplot)
add_example(surface)
add_example(update)
add_example(xkcd)

0 comments on commit a5cef23

Please sign in to comment.