Test support for OLD behavior of policy CMP0002

Policy CMP0002's OLD behavior allows duplicate non-custom targets.  We
test it with a project that builds two executables of the same name by
setting CMP0002 to OLD.
This commit is contained in:
Brad King 2009-09-28 17:34:34 -04:00
parent 0089f9cf8f
commit 65a78ec5b8
4 changed files with 13 additions and 0 deletions

View File

@ -124,6 +124,9 @@ IF(BUILD_TESTING)
ADD_TEST_MACRO(ExportImport ExportImport)
ADD_TEST_MACRO(Unset Unset)
ADD_TEST_MACRO(PolicyScope PolicyScope)
IF("${CMAKE_TEST_GENERATOR}" MATCHES "Make")
ADD_TEST_MACRO(Policy0002 Policy0002)
ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "Make")
SET(CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/COnly")
SET(CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/CMakeBuildCOnly")

View File

@ -0,0 +1 @@
add_executable(Policy0002 ../policy0002.c)

View File

@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 2.6)
project(Policy0002 C)
cmake_policy(SET CMP0002 OLD)
add_subdirectory(A)
add_executable(Policy0002 policy0002.c)

View File

@ -0,0 +1,4 @@
int main(void)
{
return 0;
}