summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-09-14 10:38:04 -0400
committerDavid Cole <david.cole@kitware.com>2011-09-14 10:38:04 -0400
commitc336778c528a82d66cd986c642c11156b5da1524 (patch)
treed62aea915cf464651fde0f2f604a8f0f3f1b5ea1 /CMakeLists.txt
parent2a3441b65ffb0b50cd0c05827b3b5ff877ad32b7 (diff)
downloadcmake-c336778c528a82d66cd986c642c11156b5da1524.tar.gz
CMake: Reference test targets only when BUILD_TESTING is ON
You cannot set a property on a target that's not there, and these targets are not there when BUILD_TESTING is OFF. Thanks to Sankhesh Jhaveri for the bug report.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 10 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cf948c2a12..788b38677f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -231,11 +231,13 @@ MACRO (CMAKE_BUILD_UTILITIES)
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}_c "${kwsys_folder}")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}EncodeExecutable "${kwsys_folder}")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}ProcessFwd9x "${kwsys_folder}")
- CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestDynload "${kwsys_folder}")
- CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestProcess "${kwsys_folder}")
- CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestsC "${kwsys_folder}")
- CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestsCxx "${kwsys_folder}")
- CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestSharedForward "${kwsys_folder}")
+ if(BUILD_TESTING)
+ CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestDynload "${kwsys_folder}")
+ CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestProcess "${kwsys_folder}")
+ CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestsC "${kwsys_folder}")
+ CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestsCxx "${kwsys_folder}")
+ CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestSharedForward "${kwsys_folder}")
+ endif()
#---------------------------------------------------------------------
# Setup third-party libraries.
@@ -598,7 +600,9 @@ ADD_SUBDIRECTORY(Source)
ADD_SUBDIRECTORY(Utilities)
ADD_SUBDIRECTORY(Tests)
-CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests")
+if(BUILD_TESTING)
+ CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests")
+endif()
CMAKE_SET_TARGET_FOLDER(cmw9xcom "Utilities/Win9xCompat")
CMAKE_SET_TARGET_FOLDER(documentation "Documentation")