File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.16 )
2
2
project (matplotlib_cpp )
3
3
4
- set (CMAKE_CXX_STANDARD 14 )
4
+ set (CMAKE_CXX_STANDARD 11 )
5
5
6
6
find_package (Python COMPONENTS Development NumPy )
7
7
@@ -12,17 +12,16 @@ message("Python_LIBRARIES:${Python_LIBRARIES}")
12
12
message ("Python_INCLUDE_DIRS:${Python_INCLUDE_DIRS} " )
13
13
message ("Python_NumPy_INCLUDE_DIRS:${Python_NumPy_INCLUDE_DIRS} " )
14
14
15
- set (includes matplotlibcpp.h ${Python_INCLUDE_DIRS} ${Python_NumPy_INCLUDE_DIRS} )
15
+ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /examples/build )
16
16
17
- set (libraries ${Python_LIBRARIES} )
17
+ add_library (matplotlibcpp INTERFACE )
18
+ target_include_directories (matplotlibcpp INTERFACE include ${Python_INCLUDE_DIRS} ${Python_NumPy_INCLUDE_DIRS} )
19
+ target_link_libraries (matplotlibcpp INTERFACE ${Python_LIBRARIES} )
18
20
19
21
set (targets minimal basic animation bar colorbar fill fill_inbetween imshow
20
22
lines3d modern nonblock quiver subplot subplot2grid surface update xkcd )
21
23
22
- set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /examples/build )
23
-
24
24
foreach (target ${targets} )
25
25
add_executable (${target} examples/${target}.cpp )
26
- target_include_directories (${target} PRIVATE ${includes} )
27
- target_link_libraries (${target} ${libraries} )
26
+ target_link_libraries (${target} matplotlibcpp )
28
27
endforeach ()
You can’t perform that action at this time.
0 commit comments