2 # Find the native CGNS includes and library 4 # CGNS_INCLUDE_DIR - where to find cgns.h, etc. 5 # CGNS_LIBRARIES - List of fully qualified libraries to link against when using CGNS. 6 # CGNS_FOUND - Do not attempt to use CGNS if "no" or undefined. 8 find_path(CGNS_INCLUDE_DIR
14 DOC
"CGNS include directory")
15 mark_as_advanced(CGNS_INCLUDE_DIR)
17 find_library(CGNS_LIBRARY
21 mark_as_advanced(CGNS_LIBRARY)
24 file(STRINGS
"${CGNS_INCLUDE_DIR}/cgnslib.h" version
26 string(REGEX REPLACE
".*CGNS_DOTVERS *\([0-9.]*\).*" "\\1" CGNS_VERSION
"${version}")
29 set(CGNS_VERSION CGNS_VERSION-NOTFOUND)
32 # handle the QUIETLY and REQUIRED arguments and set CGNS_FOUND to TRUE if 33 # all listed variables are TRUE 34 include(FindPackageHandleStandardArgs)
35 find_package_handle_standard_args(CGNS
36 REQUIRED_VARS CGNS_INCLUDE_DIR CGNS_LIBRARY
37 VERSION_VAR CGNS_VERSION)
40 set(CGNS_LIBRARIES
"${CGNS_LIBRARY}")
41 set(CGNS_INCLUDE_DIRS
"${CGNS_INCLUDE_DIR}")
42 if (NOT TARGET CGNS::CGNS)
43 add_library(CGNS::CGNS UNKNOWN IMPORTED)
44 set_target_properties(CGNS::CGNS PROPERTIES
45 IMPORTED_LOCATION
"${CGNS_LIBRARY}" 46 INTERFACE_INCLUDE_DIRECTORIES
"${CGNS_INCLUDE_DIR}")