From eebfff3ffdebc67576bef6cec883b3f20577252d Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Mon, 16 Oct 2023 15:27:44 -0600 Subject: [PATCH] Update find of CGNS using modern cmake files. CGNS now contains a cgns-config.cmake file. Here, we are updating FindTPLCGNS.cmake to be able to find that. --- cmake/tribits/common_tpls/FindTPLCGNS.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/tribits/common_tpls/FindTPLCGNS.cmake b/cmake/tribits/common_tpls/FindTPLCGNS.cmake index d508636b7c..649ab49855 100644 --- a/cmake/tribits/common_tpls/FindTPLCGNS.cmake +++ b/cmake/tribits/common_tpls/FindTPLCGNS.cmake @@ -49,10 +49,14 @@ if ((CGNS_ALLOW_MODERN AND HDF5_FOUND_MODERN_CONFIG_FILE) OR CGNS_FORCE_MODERN) if (CGNS_FOUND) message("-- Found CGNS_CONFIG=${CGNS_CONFIG}") message("-- Generating CGNS::all_libs and CGNSConfig.cmake") + set(CGNS_TARGET CGNS::cgns_shared) + if(NOT TARGET CGNS::cgns_shared) + set(CGNS_TARGET CGNS::cgns_static) + endif() tribits_extpkg_create_imported_all_libs_target_and_config_file( CGNS INNER_FIND_PACKAGE_NAME CGNS - IMPORTED_TARGETS_FOR_ALL_LIBS cgns) + IMPORTED_TARGETS_FOR_ALL_LIBS ${CGNS_TARGET}) set(TPL_CGNS_NOT_FOUND FALSE) endif() @@ -107,4 +111,4 @@ tribits_tpl_find_include_dirs_and_libraries( CGNS REQUIRED_HEADERS ${REQUIRED_HEADERS} REQUIRED_LIBS_NAMES ${REQUIRED_LIBS_NAMES}) -endif() \ No newline at end of file +endif()