FindParaview.cmake 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # 防止重复引用
  2. if(PARAVIEW_ALREADY_INCLUDED)
  3. return()
  4. endif()
  5. set(PARAVIEW_ALREADY_INCLUDED 1)
  6. # find_path 搜索包含某个文件的路径
  7. # 如果在某个路径下发现了该文件,该结果会被存储到该变量中;如果没有找到,存储的结果将会是<VAR>-NOTFOUND
  8. find_path(PARAVIEW_DIRS
  9. NAMES
  10. pvpython.exe
  11. PATHS
  12. ${CMAKE_SOURCE_DIR}/extlib/ParaView
  13. NO_SYSTEM_ENVIRONMENT_PATH
  14. NO_CMAKE_SYSTEM_PATH
  15. )
  16. # MODTRAN版本号设置
  17. set(PARAVIEW_VERSION_MAJOR 5)
  18. set(PARAVIEW_VERSION_MINOR 11)
  19. set(PARAVIEW_VERSION_PATCH 1)
  20. set(PARAVIEW_VERSION "${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}.${PARAVIEW_VERSION_PATCH}")
  21. if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
  22. set(PARAVIEW_EXECUTABLE "${PARAVIEW_DIRS}/pvpython.exe")
  23. endif()
  24. include(FindPackageHandleStandardArgs)
  25. # 如果找到所有需要的变量,并且版本匹配,则将CFD_FOUND变量设置为TRUE
  26. find_package_handle_standard_args(PARAVIEW
  27. FOUND_VAR
  28. PARAVIEW_FOUND
  29. REQUIRED_VARS
  30. PARAVIEW_DIRS
  31. PARAVIEW_EXECUTABLE
  32. VERSION_VAR
  33. PARAVIEW_VERSION
  34. )