Merge topic 'fix-OLD-CMP0021'

eef6df5 Fix OLD behavior of CMP0021.
This commit is contained in:
Brad King 2013-08-26 10:27:29 -04:00 committed by CMake Topic Stage
commit 32ea090a70
5 changed files with 35 additions and 1 deletions

View File

@ -3303,9 +3303,12 @@ static void processIncludeDirectories(cmTarget *tgt,
if (!noMessage) if (!noMessage)
{ {
tgt->GetMakefile()->IssueMessage(messageType, e.str().c_str()); tgt->GetMakefile()->IssueMessage(messageType, e.str().c_str());
if (messageType == cmake::FATAL_ERROR)
{
return; return;
} }
} }
}
if (testIsOff && !cmSystemTools::IsOff(li->c_str())) if (testIsOff && !cmSystemTools::IsOff(li->c_str()))
{ {

View File

@ -0,0 +1,14 @@
cmake_policy(SET CMP0021 OLD)
add_executable(cmp0021exe main.cpp)
if(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/includes")
execute_process(COMMAND ${CMAKE_COMMAND} -E
copy_directory
"${CMAKE_CURRENT_SOURCE_DIR}/includes"
"${CMAKE_CURRENT_BINARY_DIR}/includes"
)
endif()
set_property(TARGET cmp0021exe PROPERTY
INCLUDE_DIRECTORIES includes/cmp0021)

View File

@ -0,0 +1,2 @@
#define CMP0021_DEFINE

View File

@ -0,0 +1,11 @@
#include "cmp0021.h"
#ifndef CMP0021_DEFINE
#error Expected CMP0021_DEFINE
#endif
int main(int, char **)
{
return 0;
}

View File

@ -86,3 +86,7 @@ get_target_property(incs empty_entry_test INCLUDE_DIRECTORIES)
if (NOT incs STREQUAL ";/one/two") if (NOT incs STREQUAL ";/one/two")
message(SEND_ERROR "Empty include_directories entry was not ignored.") message(SEND_ERROR "Empty include_directories entry was not ignored.")
endif() endif()
if(NOT CMAKE_GENERATOR STREQUAL Xcode AND NOT CMAKE_GENERATOR STREQUAL Ninja)
add_subdirectory(CMP0021)
endif()