CMakeLists.txt 678 B

1234567891011121314151617181920212223242526272829
  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. # Link against the Python library
  16. target_link_libraries(
  17. demo2
  18. ${Python3_LIBRARIES}
  19. ${PLPlot_LIBRARIES}
  20. )
  21. message(STATUS "PLplot libraries: ${PLPlot_LIBRARIES}")
  22. message(STATUS "Python libraries: ${Python3_LIBRARIES}")