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.
This commit is contained in:
parent
2a3441b65f
commit
c336778c52
|
@ -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")
|
||||
|
||||
|
|
Loading…
Reference in New Issue