CMakeLists.txt 796 B

1234567891011121314151617181920212223242526272829303132333435
  1. cmake_minimum_required(VERSION 3.10)
  2. # Set the project name
  3. project(NumpyCExample LANGUAGES C)
  4. find_package(PkgConfig)
  5. pkg_check_modules(PLPlot REQUIRED plplot)
  6. find_package(plplot REQUIRED)
  7. find_package(Python3 COMPONENTS Development REQUIRED)
  8. find_package(Python3 COMPONENTS NumPy REQUIRED)
  9. include_directories(
  10. ${Python3_INCLUDE_DIRS}
  11. ${Python3_NumPy_INCLUDE_DIRS}
  12. ${PLPlot_INCLUDE_DIRS}
  13. )
  14. add_executable(demo2 src/demo2.c)
  15. add_executable(demo3 src/demo3.c)
  16. # Link against the Python library
  17. target_link_libraries(
  18. demo2
  19. ${Python3_LIBRARIES}
  20. ${PLPlot_LIBRARIES}
  21. )
  22. target_link_libraries(
  23. demo3
  24. ${Python3_LIBRARIES}
  25. ${PLPlot_LIBRARIES}
  26. )
  27. message(STATUS "PLplot libraries: ${PLPlot_LIBRARIES}")
  28. message(STATUS "Python libraries: ${Python3_LIBRARIES}")