Debian Codegraph @

cmake/tribits/common_tpls/FindTPLCGNS.cmake

raw
1 # @HEADER
2 # *****************************************************************************
3 # TriBITS: Tribal Build, Integrate, and Test System
4 #
5 # Copyright 2013-2016 NTESS and the TriBITS contributors.
6 # SPDX-License-Identifier: BSD-3-Clause
7 # *****************************************************************************
8 # @HEADER
9
10 #
11 # First, set up the variables for the (backward-compatible) TriBITS way of
12 # finding Netcdf. These are used in case find_package(NetCDF ...) is not
13 # called or does not find NetCDF. Also, these variables need to be non-null
14 # in order to trigger the right behavior in the function
15 # tribits_tpl_find_include_dirs_and_libraries().
16 #
17 set(REQUIRED_HEADERS cgnslib.h)
18 set(REQUIRED_LIBS_NAMES cgns)
19
20 #
21 # Second, search for Netcdf components (if allowed) using the standard
22 # find_package(CGNS ...).
23 #
24 tribits_tpl_allow_pre_find_package(CGNS CGNS_ALLOW_PREFIND)
25 if (CGNS_ALLOW_PREFIND)
26
27 message("-- Using find_package(CGNS ...) ...")
28
29 set(CMAKE_MODULE_PATH
30 "${CMAKE_MODULE_PATH}"
31 "${CMAKE_CURRENT_LIST_DIR}/find_modules"
32 "${CMAKE_CURRENT_LIST_DIR}/utils"
33 )
34
35 find_package(CGNS)
36
37 if (CGNS_FOUND)
38 set(TPL_CGNS_LIBRARIES ${CGNS_LIBRARIES} CACHE PATH
39 "List of semi-colon separated (full) paths to the CGNS libraries")
40 set(TPL_CGNS_INCLUDE_DIRS ${CGNS_INCLUDE_DIRS} CACHE PATH
41 "List of semi-colon separated list of directories containing CGNS header files")
42 endif()
43
44 endif()
45
46 #
47 # Third, call tribits_tpl_find_include_dirs_and_libraries()
48 #
49 tribits_tpl_find_include_dirs_and_libraries( CGNS
50 REQUIRED_HEADERS ${REQUIRED_HEADERS}
51 REQUIRED_LIBS_NAMES ${REQUIRED_LIBS_NAMES})