Skip to content

Commit ae331bf

Browse files
gsjaardemabartlettroscoe
authored andcommitted
Add code to find CGNS tools (#187)
Add code that will find CGNS tools -- cgnscheck, cgnsdiff, cgnslist, cgnscompress, cgnsconvert, cgnsnames, cgnsupdate. For each of these that is found, the symbol CGNS_{command_uppercase}_BINARY will be defined. These are useful for tests of applications/routines that access CGNS files -- the testing code can check whether a specific command exists and act accordingly. The NetCDF and HDF5 Find routines contain similar code and naming conventions.
1 parent 70af117 commit ae331bf

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tribits/common_tpls/find_modules/FindCGNS.cmake

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,21 @@ else(CGNS_LIBRARIES AND CGNS_INCLUDE_DIRS)
254254
endif()
255255
endif(CGNS_LIBRARIES AND CGNS_INCLUDE_DIRS )
256256

257+
# Search for CGNS tools
258+
set(_cgns_TOOLS cgnscheck cgnsdiff cgnslist cgnscompress cgnsconvert cgnsnames cgnsupdate)
259+
set(CGNS_TOOLS_FOUND)
260+
foreach( tool ${_cgns_TOOLS})
261+
string(TOUPPER "${tool}" tool_uc)
262+
set(_cgns_VAR_NAME CGNS_${tool_uc}_BINARY)
263+
find_program(${_cgns_VAR_NAME}
264+
${tool}
265+
HINTS ${_cgns_BINARY_SEARCH_DIRS}
266+
${_cgns_FIND_OPTIONS})
267+
if (${_cgns_VAR_NAME})
268+
list(APPEND CGNS_TOOLS_FOUND ${tool})
269+
endif()
270+
endforeach()
271+
257272
# Send useful message if everything is found
258273
find_package_handle_standard_args(CGNS DEFAULT_MSG
259274
CGNS_LIBRARIES
@@ -272,6 +287,7 @@ if ( NOT CGNS_FIND_QUIETLY )
272287
# Create a not found list
273288
message(STATUS "\tCGNS_INCLUDE_DIRS = ${CGNS_INCLUDE_DIRS}")
274289
message(STATUS "\tCGNS_LIBRARIES = ${CGNS_LIBRARIES}")
290+
message(STATUS "\tCGNS_TOOLS_FOUND = ${CGNS_TOOLS_FOUND}")
275291

276292
endif()
277293
# For compatability with TriBITS:

0 commit comments

Comments
 (0)