123456789101112131415161718192021222324252627282930313233343536373839 |
- # 防止重复引用
- if(MODTRAN_ALREADY_INCLUDED)
- return()
- endif()
- set(MODTRAN_ALREADY_INCLUDED 1)
- # find_path 搜索包含某个文件的路径
- # 如果在某个路径下发现了该文件,该结果会被存储到该变量中;如果没有找到,存储的结果将会是<VAR>-NOTFOUND
- find_path(MODTRAN_DIRS
- NAMES
- Mod4v1r1.exe
- PATHS
- ${CMAKE_SOURCE_DIR}/extlib/Modran4
- NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH
- )
- # MODTRAN版本号设置
- set(MODTRAN_VERSION_MAJOR 4)
- set(MODTRAN_VERSION_MINOR 0)
- set(MODTRAN_VERSION_PATCH 0)
- set(MODTRAN_VERSION "${MODTRAN_VERSION_MAJOR}.${MODTRAN_VERSION_MINOR}.${MODTRAN_VERSION_PATCH}")
- if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
- set(MODTRAN_EXECUTABLE "${MODTRAN_DIRS}/Mod4v1r1.exe")
- endif()
- include(FindPackageHandleStandardArgs)
- # 如果找到所有需要的变量,并且版本匹配,则将CFD_FOUND变量设置为TRUE
- find_package_handle_standard_args(MODTRAN
- FOUND_VAR
- MODTRAN_FOUND
- REQUIRED_VARS
- MODTRAN_DIRS
- MODTRAN_EXECUTABLE
- VERSION_VAR
- MODTRAN_VERSION
- )
|