summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/command/if.rst9
-rw-r--r--Help/prop_tgt/CXX_STANDARD.rst2
-rw-r--r--Help/release/3.1.0.rst22
-rw-r--r--Modules/FindIce.cmake10
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx17
-rw-r--r--Source/kwsys/Terminal.c1
-rw-r--r--Tests/CMakeLists.txt1
-rw-r--r--Tests/CxxSubdirC/CMakeLists.txt4
-rw-r--r--Tests/CxxSubdirC/Cdir/CMakeLists.txt2
-rw-r--r--Tests/CxxSubdirC/Cdir/Cobj.c1
-rw-r--r--Tests/CxxSubdirC/main.cxx2
11 files changed, 59 insertions, 12 deletions
diff --git a/Help/command/if.rst b/Help/command/if.rst
index 79e5d21..d50b14c 100644
--- a/Help/command/if.rst
+++ b/Help/command/if.rst
@@ -42,11 +42,12 @@ Possible expressions are:
or a non-zero number. False if the constant is ``0``, ``OFF``,
``NO``, ``FALSE``, ``N``, ``IGNORE``, ``NOTFOUND``, the empty string,
or ends in the suffix ``-NOTFOUND``. Named boolean constants are
- case-insensitive. If the argument is not one of these constants, it
- is treated as a variable.
+ case-insensitive. If the argument is not one of these specific
+ constants, it is treated as a variable or string and the following
+ signature is used.
-``if(<variable>)``
- True if the variable is defined to a value that is not a false
+``if(<variable|string>)``
+ True if given a variable that is defined to a value that is not a false
constant. False otherwise. (Note macro arguments are not variables.)
``if(NOT <expression>)``
diff --git a/Help/prop_tgt/CXX_STANDARD.rst b/Help/prop_tgt/CXX_STANDARD.rst
index b50cdf9..6329e34 100644
--- a/Help/prop_tgt/CXX_STANDARD.rst
+++ b/Help/prop_tgt/CXX_STANDARD.rst
@@ -7,7 +7,7 @@ This property specifies the C++ standard whose features are requested
to build this target. For some compilers, this results in adding a
flag such as ``-std=gnu++11`` to the compile line.
-Supported values are ``98`` and ``11``.
+Supported values are ``98``, ``11`` and ``14``.
If the value requested does not result in a compile flag being added for
the compiler in use, a previous standard flag will be added instead. This
diff --git a/Help/release/3.1.0.rst b/Help/release/3.1.0.rst
index a5b3e8e..97a63f9 100644
--- a/Help/release/3.1.0.rst
+++ b/Help/release/3.1.0.rst
@@ -353,6 +353,28 @@ Deprecated and Removed Features
CMake 3.1 again requires the quotes for this to work correctly.
+* Prior to CMake 3.1 the Makefile generators did not escape ``#``
+ correctly inside make variable assignments used in generated
+ makefiles, causing them to be treated as comments. This made
+ code like::
+
+ add_compile_options(-Wno-#pragma-messages)
+
+ not work in Makefile generators, but work in other generators.
+ Now it is escaped correctly, making the behavior consistent
+ across generators. However, some projects may have tried to
+ workaround the original bug with code like::
+
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-\\#pragma-messages")
+
+ This added the needed escape for Makefile generators but also
+ caused other generators to pass ``-Wno-\#pragma-messages`` to
+ the shell, which would work only in POSIX shells.
+ Unfortunately the escaping fix could not be made in a compatible
+ way so this platform- and generator-specific workaround no
+ longer works. Project code may test the :variable:`CMAKE_VERSION`
+ variable value to make the workaround version-specific too.
+
* Callbacks established by the :command:`variable_watch` command will no
longer receive the ``ALLOWED_UNKNOWN_READ_ACCESS`` access type when
the undocumented ``CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS`` variable is
diff --git a/Modules/FindIce.cmake b/Modules/FindIce.cmake
index 76cecc1..8493d80 100644
--- a/Modules/FindIce.cmake
+++ b/Modules/FindIce.cmake
@@ -282,21 +282,21 @@ function(_Ice_FIND)
PATH_SUFFIXES ${ice_library_suffixes}
DOC "Ice ${component} library")
mark_as_advanced("${component_cache}")
- if("${component_cache}")
+ if(${component_cache})
set("${component_found}" ON)
list(APPEND Ice_LIBRARY "${${component_cache}}")
endif()
mark_as_advanced("${component_found}")
set("${component_cache}" "${${component_cache}}" PARENT_SCOPE)
set("${component_found}" "${${component_found}}" PARENT_SCOPE)
- if("${component_found}")
- if ("Ice_FIND_REQUIRED_${component}")
+ if(${component_found})
+ if (Ice_FIND_REQUIRED_${component})
list(APPEND Ice_LIBS_FOUND "${component} (required)")
else()
list(APPEND Ice_LIBS_FOUND "${component} (optional)")
endif()
else()
- if ("Ice_FIND_REQUIRED_${component}")
+ if (Ice_FIND_REQUIRED_${component})
set(Ice_REQUIRED_LIBS_FOUND OFF)
list(APPEND Ice_LIBS_NOTFOUND "${component} (required)")
else()
@@ -356,7 +356,7 @@ if(Ice_FOUND)
set(_Ice_component_cache "Ice_${_Ice_component_upcase}_LIBRARY")
set(_Ice_component_lib "Ice_${_Ice_component_upcase}_LIBRARIES")
set(_Ice_component_found "${_Ice_component_upcase}_FOUND")
- if("${_Ice_component_found}")
+ if(${_Ice_component_found})
set("${_Ice_component_lib}" "${${_Ice_component_cache}}")
endif()
unset(_Ice_component_upcase)
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index e344df4..a05719d 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -110,13 +110,26 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules()
<< "\n\n";
#endif
+ // Write rules for languages compiled in this target.
std::set<std::string> languages;
- this->GetTarget()->GetLanguages(languages,
- this->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"));
+ std::vector<cmSourceFile*> sourceFiles;
+ this->GetTarget()->GetSourceFiles(sourceFiles,
+ this->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"));
+ for(std::vector<cmSourceFile*>::const_iterator
+ i = sourceFiles.begin(); i != sourceFiles.end(); ++i)
+ {
+ const std::string& lang = (*i)->GetLanguage();
+ if(!lang.empty())
+ {
+ languages.insert(lang);
+ }
+ }
for(std::set<std::string>::const_iterator l = languages.begin();
l != languages.end();
++l)
+ {
this->WriteLanguageRules(*l);
+ }
}
const char *cmNinjaNormalTargetGenerator::GetVisibleTypeName() const
diff --git a/Source/kwsys/Terminal.c b/Source/kwsys/Terminal.c
index e13003f..d13f79a 100644
--- a/Source/kwsys/Terminal.c
+++ b/Source/kwsys/Terminal.c
@@ -175,6 +175,7 @@ static const char* kwsysTerminalVT100Names[] =
"xterm-88color",
"xterm-color",
"xterm-debian",
+ "xterm-termite",
0
};
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index a9cad14..f654330 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -255,6 +255,7 @@ if(BUILD_TESTING)
endif()
ADD_TEST_MACRO(COnly COnly)
ADD_TEST_MACRO(CxxOnly CxxOnly)
+ ADD_TEST_MACRO(CxxSubdirC CxxSubdirC)
ADD_TEST_MACRO(IPO COnly/COnly)
ADD_TEST_MACRO(OutDir runtime/OutDir)
ADD_TEST_MACRO(ObjectLibrary UseCshared)
diff --git a/Tests/CxxSubdirC/CMakeLists.txt b/Tests/CxxSubdirC/CMakeLists.txt
new file mode 100644
index 0000000..52474f8
--- /dev/null
+++ b/Tests/CxxSubdirC/CMakeLists.txt
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.0)
+project(CxxSubdirC CXX)
+add_subdirectory(Cdir)
+add_executable(CxxSubdirC main.cxx $<TARGET_OBJECTS:Cobj>)
diff --git a/Tests/CxxSubdirC/Cdir/CMakeLists.txt b/Tests/CxxSubdirC/Cdir/CMakeLists.txt
new file mode 100644
index 0000000..08a8757
--- /dev/null
+++ b/Tests/CxxSubdirC/Cdir/CMakeLists.txt
@@ -0,0 +1,2 @@
+enable_language(C)
+add_library(Cobj OBJECT Cobj.c)
diff --git a/Tests/CxxSubdirC/Cdir/Cobj.c b/Tests/CxxSubdirC/Cdir/Cobj.c
new file mode 100644
index 0000000..75a0045
--- /dev/null
+++ b/Tests/CxxSubdirC/Cdir/Cobj.c
@@ -0,0 +1 @@
+int Cobj(void) { return 0; }
diff --git a/Tests/CxxSubdirC/main.cxx b/Tests/CxxSubdirC/main.cxx
new file mode 100644
index 0000000..049220f
--- /dev/null
+++ b/Tests/CxxSubdirC/main.cxx
@@ -0,0 +1,2 @@
+extern "C" int Cobj(void);
+int main() { return Cobj(); }