-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(plt): add usage of matplotlibcpp
- Loading branch information
1 parent
2ebf64a
commit bedd513
Showing
3 changed files
with
3,031 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# 声明要求的 cmake 最低版本 | ||
cmake_minimum_required(VERSION 3.12) | ||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
project(TEST) | ||
|
||
# 查找python库版本 | ||
# find_package(PythonLibs 3.6) | ||
|
||
|
||
# 指定头文件路径 | ||
set(PYTHON3.6_INLCUDE_DIRS "/usr/include/python3.6") | ||
|
||
# 添加头文件到工程 | ||
include_directories( | ||
${PYTHON3.6_INLCUDE_DIRS} | ||
) | ||
#这样配置可以使得matplotlib.h中找到python.h文件,通常这样设置就可以。 | ||
|
||
|
||
# 添加一个可执行程序 | ||
add_executable(test test.cpp) | ||
|
||
# 添加相关库文件链接到工程 | ||
target_include_directories(test PRIVATE ${PYTHON2_INCLUDE_DIRS}) | ||
# target_link_libraries(test ${PYTHON_LIBRARIES}) | ||
target_link_libraries(test /usr/lib/x86_64-linux-gnu/libpython3.6m.so) | ||
|
Oops, something went wrong.