From e151188285de85815080e9612b0115a4d67fddf1 Mon Sep 17 00:00:00 2001 From: Caleb Schilly Date: Thu, 11 Jul 2024 16:48:44 -0400 Subject: [PATCH 1/4] #2321: link with specified gtest lib --- cmake/link_vt.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/link_vt.cmake b/cmake/link_vt.cmake index 80d9574582..e9a5c9c1e7 100644 --- a/cmake/link_vt.cmake +++ b/cmake/link_vt.cmake @@ -90,7 +90,7 @@ function(link_target_with_vt) if (${ARG_DEBUG_LINK}) message(STATUS "link_target_with_vt: gtest=${ARG_LINK_GTEST}") endif() - target_link_libraries(${ARG_TARGET} PRIVATE gtest) + target_link_libraries(${ARG_TARGET} PRIVATE ${GOOGLETEST_LIBRARY}) endif() if (NOT DEFINED ARG_LINK_UNWIND AND ${ARG_DEFAULT_LINK_SET} OR ARG_LINK_UNWIND) From 65e40325ceab29bc5768a523c1ef625f48c8a241 Mon Sep 17 00:00:00 2001 From: Caleb Schilly Date: Wed, 17 Jul 2024 10:38:48 -0400 Subject: [PATCH 2/4] #2321: isolate zlib include dirs --- cmake/link_vt.cmake | 3 +++ cmake/load_zlib_package.cmake | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/link_vt.cmake b/cmake/link_vt.cmake index e9a5c9c1e7..6db03d74ed 100644 --- a/cmake/link_vt.cmake +++ b/cmake/link_vt.cmake @@ -165,6 +165,9 @@ function(link_target_with_vt) target_link_libraries( ${ARG_TARGET} PUBLIC ${ARG_BUILD_TYPE} ${ZLIB_LIBRARIES} ) + target_include_directories( + ${ARG_TARGET} PUBLIC $ + ) endif() if (NOT DEFINED ARG_LINK_FMT AND ${ARG_DEFAULT_LINK_SET} OR ARG_LINK_FMT) diff --git a/cmake/load_zlib_package.cmake b/cmake/load_zlib_package.cmake index 5ee01cec50..e49ecb293d 100644 --- a/cmake/load_zlib_package.cmake +++ b/cmake/load_zlib_package.cmake @@ -4,8 +4,6 @@ # find_package(ZLIB REQUIRED) -if(ZLIB_FOUND) - include_directories(${ZLIB_INCLUDE_DIRS}) -else() +if(NOT ZLIB_FOUND) message("zlib is required for tracing") -endif(ZLIB_FOUND) +endif(NOT ZLIB_FOUND) From 4432be46b35a7438a246f879d9a90dc497a3fa94 Mon Sep 17 00:00:00 2001 From: Caleb Schilly Date: Wed, 17 Jul 2024 12:41:34 -0400 Subject: [PATCH 3/4] #2321: remove dead code and move find_package(zlib) to load_packages --- cmake/load_packages.cmake | 2 +- cmake/load_zlib_package.cmake | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 cmake/load_zlib_package.cmake diff --git a/cmake/load_packages.cmake b/cmake/load_packages.cmake index 7bf97150c9..fa7939d109 100644 --- a/cmake/load_packages.cmake +++ b/cmake/load_packages.cmake @@ -7,7 +7,7 @@ include(cmake/load_local_packages.cmake) include(cmake/load_mpi_package.cmake) # ZLIB package -include(cmake/load_zlib_package.cmake) +find_package(ZLIB REQUIRED) # Perl is used to build the PMPI wrappers find_package(Perl) diff --git a/cmake/load_zlib_package.cmake b/cmake/load_zlib_package.cmake deleted file mode 100644 index e49ecb293d..0000000000 --- a/cmake/load_zlib_package.cmake +++ /dev/null @@ -1,9 +0,0 @@ - -# -# Load Zlib settings (required) -# - -find_package(ZLIB REQUIRED) -if(NOT ZLIB_FOUND) - message("zlib is required for tracing") -endif(NOT ZLIB_FOUND) From eeae60dc27e435cadfb9bf8f8133283dba701064 Mon Sep 17 00:00:00 2001 From: Caleb Schilly Date: Wed, 17 Jul 2024 14:03:52 -0400 Subject: [PATCH 4/4] #2321: remove target_include_directories from zlib linking --- cmake/link_vt.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmake/link_vt.cmake b/cmake/link_vt.cmake index 6db03d74ed..e9a5c9c1e7 100644 --- a/cmake/link_vt.cmake +++ b/cmake/link_vt.cmake @@ -165,9 +165,6 @@ function(link_target_with_vt) target_link_libraries( ${ARG_TARGET} PUBLIC ${ARG_BUILD_TYPE} ${ZLIB_LIBRARIES} ) - target_include_directories( - ${ARG_TARGET} PUBLIC $ - ) endif() if (NOT DEFINED ARG_LINK_FMT AND ${ARG_DEFAULT_LINK_SET} OR ARG_LINK_FMT)