From 11bc856cad573d16a37b2d458a9372ab7e16b62d Mon Sep 17 00:00:00 2001
From: shawnz <shawnz@nvidia.com>
Date: Mon, 10 Feb 2025 17:02:44 +0800
Subject: [PATCH] Turn on assert log for SimpleAssert and copy files to folder
 of executable for watershedSegmentationNPP

---
 Samples/0_Introduction/simpleAssert/CMakeLists.txt          | 3 +++
 .../watershedSegmentationNPP/CMakeLists.txt                 | 6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Samples/0_Introduction/simpleAssert/CMakeLists.txt b/Samples/0_Introduction/simpleAssert/CMakeLists.txt
index 0cc83371..2479c900 100644
--- a/Samples/0_Introduction/simpleAssert/CMakeLists.txt
+++ b/Samples/0_Introduction/simpleAssert/CMakeLists.txt
@@ -14,6 +14,9 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
     # set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G")  # enable cuda-gdb (expensive)
 endif()
 
+# Removes -DNDEBUG For Print specific logs in this sample.
+string(REPLACE "-DNDEBUG" "" CMAKE_CUDA_FLAGS_RELEASE "${CMAKE_CUDA_FLAGS_RELEASE}")
+
 # Include directories and libraries
 include_directories(../../../Common)
 
diff --git a/Samples/4_CUDA_Libraries/watershedSegmentationNPP/CMakeLists.txt b/Samples/4_CUDA_Libraries/watershedSegmentationNPP/CMakeLists.txt
index 70b0ecb3..a5125a23 100644
--- a/Samples/4_CUDA_Libraries/watershedSegmentationNPP/CMakeLists.txt
+++ b/Samples/4_CUDA_Libraries/watershedSegmentationNPP/CMakeLists.txt
@@ -41,19 +41,19 @@ target_link_libraries(watershedSegmentationNPP PRIVATE
 add_custom_command(TARGET watershedSegmentationNPP POST_BUILD
     COMMAND ${CMAKE_COMMAND} -E copy_if_different
     ${CMAKE_CURRENT_SOURCE_DIR}/../../../Common/data/teapot_512x512_8u_Gray.raw
-    ${CMAKE_CURRENT_BINARY_DIR}/
+    $<TARGET_FILE_DIR:watershedSegmentationNPP>/
 )
 
 # Copy data files to output directory
 add_custom_command(TARGET watershedSegmentationNPP POST_BUILD
     COMMAND ${CMAKE_COMMAND} -E copy_if_different
     ${CMAKE_CURRENT_SOURCE_DIR}/../../../Common/data/CT_skull_512x512_8u_Gray.raw
-    ${CMAKE_CURRENT_BINARY_DIR}/
+    $<TARGET_FILE_DIR:watershedSegmentationNPP>/
 )
 
 # Copy data files to output directory
 add_custom_command(TARGET watershedSegmentationNPP POST_BUILD
     COMMAND ${CMAKE_COMMAND} -E copy_if_different
     ${CMAKE_CURRENT_SOURCE_DIR}/../../../Common/data/Rocks_512x512_8u_Gray.raw
-    ${CMAKE_CURRENT_BINARY_DIR}/
+    $<TARGET_FILE_DIR:watershedSegmentationNPP>/
 )