123456789101112131415161718192021222324252627282930313233343536373839 |
- # 防止重复引用
- if(PARAVIEW_ALREADY_INCLUDED)
- return()
- endif()
- set(PARAVIEW_ALREADY_INCLUDED 1)
- # find_path 搜索包含某个文件的路径
- # 如果在某个路径下发现了该文件,该结果会被存储到该变量中;如果没有找到,存储的结果将会是<VAR>-NOTFOUND
- find_path(PARAVIEW_DIRS
- NAMES
- pvpython.exe
- PATHS
- ${CMAKE_SOURCE_DIR}/extlib/ParaView
- NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH
- )
- # MODTRAN版本号设置
- set(PARAVIEW_VERSION_MAJOR 5)
- set(PARAVIEW_VERSION_MINOR 11)
- set(PARAVIEW_VERSION_PATCH 1)
- set(PARAVIEW_VERSION "${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}.${PARAVIEW_VERSION_PATCH}")
- if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
- set(PARAVIEW_EXECUTABLE "${PARAVIEW_DIRS}/pvpython.exe")
- endif()
- include(FindPackageHandleStandardArgs)
- # 如果找到所有需要的变量,并且版本匹配,则将CFD_FOUND变量设置为TRUE
- find_package_handle_standard_args(PARAVIEW
- FOUND_VAR
- PARAVIEW_FOUND
- REQUIRED_VARS
- PARAVIEW_DIRS
- PARAVIEW_EXECUTABLE
- VERSION_VAR
- PARAVIEW_VERSION
- )
|