From 9c2eebfaebf38e6a918889719cbafda2dec22eb9 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 4 Jan 2016 16:52:39 -0800 Subject: [PATCH] don't attempt to find nsight multiple times per run --- cmake/macros/TargetNsight.cmake | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cmake/macros/TargetNsight.cmake b/cmake/macros/TargetNsight.cmake index edd3a66708..09b056d07a 100644 --- a/cmake/macros/TargetNsight.cmake +++ b/cmake/macros/TargetNsight.cmake @@ -7,9 +7,18 @@ # macro(TARGET_NSIGHT) if (WIN32 AND USE_NSIGHT) - # try to find the Nsight package and add it to the build if we find it - find_package(NSIGHT) - + + # grab the global CHECKED_FOR_NSIGHT_ONCE property + get_property(NSIGHT_CHECKED GLOBAL PROPERTY CHECKED_FOR_NSIGHT_ONCE) + + if (NOT NSIGHT_CHECKED) + # try to find the Nsight package and add it to the build if we find it + find_package(NSIGHT) + + # set the global CHECKED_FOR_NSIGHT_ONCE property so that we only debug that we couldn't find it once + set_property(GLOBAL PROPERTY CHECKED_FOR_NSIGHT_ONCE TRUE) + endif () + if (NSIGHT_FOUND) include_directories(${NSIGHT_INCLUDE_DIRS}) add_definitions(-DNSIGHT_FOUND)