Browse Source

Genex: Fix COMPILE_LANGUAGE messages to allow file(GENERATE) with Xcode

When rejecting the `COMPILE_LANGUAGE` generator expression on include
directories and compile definitions with Xcode, add `file(GENERATE)` to
the allowed set in the message.  It is allowed and already covered
by the `RunCMake.File_Generate` test `COMPILE_LANGUAGE-genex` case.
Brad King 8 years ago
parent
commit
0f6f7c8ab1

+ 2 - 2
Source/cmGeneratorExpressionNode.cxx

@@ -838,8 +838,8 @@ static const struct CompileLanguageNode : public cmGeneratorExpressionNode
                          dagChecker->EvaluatingIncludeDirectories())) {
         reportError(
           context, content->GetOriginalExpression(),
-          "$<COMPILE_LANGUAGE:...> may only be used with COMPILE_OPTIONS "
-          "with the Xcode generator.");
+          "$<COMPILE_LANGUAGE:...> may only be used for COMPILE_OPTIONS "
+          "and file(GENERATE) with the Xcode generator.");
         return std::string();
       }
     } else {

+ 2 - 2
Tests/RunCMake/COMPILE_LANGUAGE-genex/CompileDefinitions-stderr-Xcode.txt

@@ -3,7 +3,7 @@ CMake Error at CompileDefinitions.cmake:5 \(target_compile_definitions\):
 
     \$<COMPILE_LANGUAGE:CXX>
 
-  \$<COMPILE_LANGUAGE:...> may only be used with COMPILE_OPTIONS with the
-  Xcode generator.
+  \$<COMPILE_LANGUAGE:...> may only be used for COMPILE_OPTIONS and
+  file\(GENERATE\) with the Xcode generator.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)

+ 2 - 2
Tests/RunCMake/COMPILE_LANGUAGE-genex/IncludeDirectories-stderr-Xcode.txt

@@ -3,7 +3,7 @@ CMake Error at IncludeDirectories.cmake:5 \(target_include_directories\):
 
     \$<COMPILE_LANGUAGE:CXX>
 
-  \$<COMPILE_LANGUAGE:...> may only be used with COMPILE_OPTIONS with the
-  Xcode generator.
+  \$<COMPILE_LANGUAGE:...> may only be used for COMPILE_OPTIONS and
+  file\(GENERATE\) with the Xcode generator.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)