Attached Files | undefined_variable_warnings.diff [^] (21,243 bytes) 2008-03-01 14:34 [Show Content] [Hide Content]? undefined_variable_warnings.diff
Index: Modules/CMakeCInformation.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeCInformation.cmake,v
retrieving revision 1.20
diff -u -r1.20 CMakeCInformation.cmake
--- Modules/CMakeCInformation.cmake 1 Feb 2008 13:56:00 -0000 1.20
+++ Modules/CMakeCInformation.cmake 1 Mar 2008 19:33:26 -0000
@@ -71,16 +71,16 @@
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
# default build type is none
IF(NOT CMAKE_NO_BUILD_TYPE)
- SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
+ SET (CMAKE_BUILD_TYPE $ALLOWUNDEF{CMAKE_BUILD_TYPE_INIT} CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
ENDIF(NOT CMAKE_NO_BUILD_TYPE)
- SET (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING
+ SET (CMAKE_C_FLAGS_DEBUG "$ALLOWUNDEF{CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING
"Flags used by the compiler during debug builds.")
- SET (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING
+ SET (CMAKE_C_FLAGS_MINSIZEREL "$ALLOWUNDEF{CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING
"Flags used by the compiler during release minsize builds.")
- SET (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE_INIT}" CACHE STRING
+ SET (CMAKE_C_FLAGS_RELEASE "$ALLOWUNDEF{CMAKE_C_FLAGS_RELEASE_INIT}" CACHE STRING
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
- SET (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
+ SET (CMAKE_C_FLAGS_RELWITHDEBINFO "$ALLOWUNDEF{CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
"Flags used by the compiler during Release with Debug Info builds.")
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
Index: Modules/CMakeCXXInformation.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeCXXInformation.cmake,v
retrieving revision 1.24
diff -u -r1.24 CMakeCXXInformation.cmake
--- Modules/CMakeCXXInformation.cmake 1 Feb 2008 13:56:00 -0000 1.24
+++ Modules/CMakeCXXInformation.cmake 1 Mar 2008 19:33:26 -0000
@@ -101,7 +101,7 @@
ENDIF(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
- SET(CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
+ SET(CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH $ALLOWUNDEF{CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
IF(NOT CMAKE_INCLUDE_FLAG_CXX)
@@ -109,12 +109,12 @@
ENDIF(NOT CMAKE_INCLUDE_FLAG_CXX)
IF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
- SET(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C})
+ SET(CMAKE_INCLUDE_FLAG_SEP_CXX $ALLOWUNDEF{CMAKE_INCLUDE_FLAG_SEP_C})
ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
# repeat for modules
IF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
- SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
+ SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS $ALLOWUNDEF{CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
IF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
@@ -122,11 +122,11 @@
ENDIF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
IF(NOT CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG)
- SET(CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_MODULE_RUNTIME_FLAG})
+ SET(CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG $ALLOWUNDEF{CMAKE_SHARED_MODULE_RUNTIME_FLAG})
ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG)
IF(NOT CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG_SEP)
- SET(CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_MODULE_RUNTIME_FLAG_SEP})
+ SET(CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG_SEP $ALLOWUNDEF{CMAKE_SHARED_MODULE_RUNTIME_FLAG_SEP})
ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG_SEP)
# Initialize CXX link type selection flags from C versions.
Index: Modules/CMakeCommonLanguageInclude.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeCommonLanguageInclude.cmake,v
retrieving revision 1.4
diff -u -r1.4 CMakeCommonLanguageInclude.cmake
--- Modules/CMakeCommonLanguageInclude.cmake 26 Jul 2006 17:19:34 -0000 1.4
+++ Modules/CMakeCommonLanguageInclude.cmake 1 Mar 2008 19:33:26 -0000
@@ -3,65 +3,65 @@
# cache values that can be initialized in the platform-compiler.cmake file
# it may be included by more than one language.
-SET (CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}
+SET (CMAKE_EXE_LINKER_FLAGS $ALLOWUNDEF{CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}
CACHE STRING "Flags used by the linker.")
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
# default build type is none
IF(NOT CMAKE_NO_BUILD_TYPE)
- SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
+ SET (CMAKE_BUILD_TYPE $ALLOWUNDEF{CMAKE_BUILD_TYPE_INIT} CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
ENDIF(NOT CMAKE_NO_BUILD_TYPE)
- SET (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
+ SET (CMAKE_EXE_LINKER_FLAGS_DEBUG $ALLOWUNDEF{CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
"Flags used by the linker during debug builds.")
- SET (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT} CACHE STRING
+ SET (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL $ALLOWUNDEF{CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT} CACHE STRING
"Flags used by the linker during release minsize builds.")
- SET (CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
+ SET (CMAKE_EXE_LINKER_FLAGS_RELEASE $ALLOWUNDEF{CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
"Flags used by the linker during release builds.")
SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
- ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
+ $ALLOWUNDEF{CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
"Flags used by the linker during Release with Debug Info builds.")
- SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
+ SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG $ALLOWUNDEF{CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
"Flags used by the linker during debug builds.")
- SET (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL ${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT}
+ SET (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL $ALLOWUNDEF{CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT}
CACHE STRING
"Flags used by the linker during release minsize builds.")
- SET (CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
+ SET (CMAKE_SHARED_LINKER_FLAGS_RELEASE $ALLOWUNDEF{CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
"Flags used by the linker during release builds.")
SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
- ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
+ $ALLOWUNDEF{CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
"Flags used by the linker during Release with Debug Info builds.")
- SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG ${CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
+ SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG $ALLOWUNDEF{CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
"Flags used by the linker during debug builds.")
- SET (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL ${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT}
+ SET (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL $ALLOWUNDEF{CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT}
CACHE STRING
"Flags used by the linker during release minsize builds.")
- SET (CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
+ SET (CMAKE_MODULE_LINKER_FLAGS_RELEASE $ALLOWUNDEF{CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
"Flags used by the linker during release builds.")
SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
- ${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
+ $ALLOWUNDEF{CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
"Flags used by the linker during Release with Debug Info builds.")
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
# shared linker flags
-SET (CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}
+SET (CMAKE_SHARED_LINKER_FLAGS $ALLOWUNDEF{CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}
CACHE STRING "Flags used by the linker during the creation of dll's.")
# module linker flags
-SET (CMAKE_MODULE_LINKER_FLAGS ${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}
+SET (CMAKE_MODULE_LINKER_FLAGS $ALLOWUNDEF{CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}
CACHE STRING "Flags used by the linker during the creation of modules.")
SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL
Index: Modules/CMakeDetermineCCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineCCompiler.cmake,v
retrieving revision 1.52
diff -u -r1.52 CMakeDetermineCCompiler.cmake
--- Modules/CMakeDetermineCCompiler.cmake 25 Feb 2008 14:23:14 -0000 1.52
+++ Modules/CMakeDetermineCCompiler.cmake 1 Mar 2008 19:33:26 -0000
@@ -43,7 +43,9 @@
IF(CMAKE_C_COMPILER_INIT)
SET(CMAKE_C_COMPILER_LIST ${CMAKE_C_COMPILER_INIT})
ELSE(CMAKE_C_COMPILER_INIT)
- SET(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}gcc ${_CMAKE_TOOLCHAIN_PREFIX}cc cl bcc xlc)
+ SET(CMAKE_C_COMPILER_LIST
+ $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}gcc
+ $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}cc cl bcc xlc)
ENDIF(CMAKE_C_COMPILER_INIT)
# Find the compiler.
Index: Modules/CMakeDetermineCXXCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineCXXCompiler.cmake,v
retrieving revision 1.45
diff -u -r1.45 CMakeDetermineCXXCompiler.cmake
--- Modules/CMakeDetermineCXXCompiler.cmake 25 Feb 2008 14:23:14 -0000 1.45
+++ Modules/CMakeDetermineCXXCompiler.cmake 1 Mar 2008 19:33:26 -0000
@@ -42,7 +42,9 @@
IF(CMAKE_CXX_COMPILER_INIT)
SET(CMAKE_CXX_COMPILER_LIST ${CMAKE_CXX_COMPILER_INIT})
ELSE(CMAKE_CXX_COMPILER_INIT)
- SET(CMAKE_CXX_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ CC aCC cl bcc xlC)
+ SET(CMAKE_CXX_COMPILER_LIST
+ $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}c++
+ $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}g++ CC aCC cl bcc xlC)
ENDIF(CMAKE_CXX_COMPILER_INIT)
# Find the compiler.
Index: Modules/CMakeDetermineCompilerId.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineCompilerId.cmake,v
retrieving revision 1.18
diff -u -r1.18 CMakeDetermineCompilerId.cmake
--- Modules/CMakeDetermineCompilerId.cmake 25 Feb 2008 14:23:14 -0000 1.18
+++ Modules/CMakeDetermineCompilerId.cmake 1 Mar 2008 19:33:27 -0000
@@ -5,7 +5,7 @@
FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
# Make sure the compiler arguments are clean.
- STRING(STRIP "${CMAKE_${lang}_COMPILER_ARG1}" CMAKE_${lang}_COMPILER_ID_ARG1)
+ STRING(STRIP "$ALLOWUNDEF{CMAKE_${lang}_COMPILER_ARG1}" CMAKE_${lang}_COMPILER_ID_ARG1)
# Make sure user-specified compiler flags are used.
IF(CMAKE_${lang}_FLAGS)
@@ -13,7 +13,8 @@
ELSE(CMAKE_${lang}_FLAGS)
SET(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}})
ENDIF(CMAKE_${lang}_FLAGS)
- STRING(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
+ STRING(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST
+ "$ALLOWUNDEF{CMAKE_${lang}_COMPILER_ID_FLAGS}")
# Compute the directory in which to run the test.
SET(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang})
Index: Modules/CMakeFindBinUtils.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeFindBinUtils.cmake,v
retrieving revision 1.15
diff -u -r1.15 CMakeFindBinUtils.cmake
--- Modules/CMakeFindBinUtils.cmake 1 Mar 2008 17:51:07 -0000 1.15
+++ Modules/CMakeFindBinUtils.cmake 1 Mar 2008 19:33:27 -0000
@@ -18,7 +18,7 @@
# if it's the MS C/CXX compiler, search for link
-IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
+IF("$ALLOWUNDEF{CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
@@ -28,37 +28,37 @@
MARK_AS_ADVANCED(CMAKE_LINKER)
# in all other cases search for ar, ranlib, etc.
-ELSE("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
+ELSE("$ALLOWUNDEF{CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
- FIND_PROGRAM(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
- FIND_PROGRAM(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar)
+ FIND_PROGRAM(CMAKE_AR NAMES $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}ar PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
+ FIND_PROGRAM(CMAKE_AR NAMES $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}ar)
- FIND_PROGRAM(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
- FIND_PROGRAM(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib)
+ FIND_PROGRAM(CMAKE_RANLIB NAMES $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}ranlib ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
+ FIND_PROGRAM(CMAKE_RANLIB NAMES $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}ranlib)
IF(NOT CMAKE_RANLIB)
SET(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib")
ENDIF(NOT CMAKE_RANLIB)
- FIND_PROGRAM(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
- FIND_PROGRAM(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip)
+ FIND_PROGRAM(CMAKE_STRIP NAMES $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}strip PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
+ FIND_PROGRAM(CMAKE_STRIP NAMES $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}strip)
- FIND_PROGRAM(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
- FIND_PROGRAM(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld)
+ FIND_PROGRAM(CMAKE_LINKER NAMES $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}ld PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
+ FIND_PROGRAM(CMAKE_LINKER NAMES $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}ld)
- FIND_PROGRAM(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
- FIND_PROGRAM(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm)
+ FIND_PROGRAM(CMAKE_NM NAMES $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}nm PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
+ FIND_PROGRAM(CMAKE_NM NAMES $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}nm)
- FIND_PROGRAM(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
- FIND_PROGRAM(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump)
+ FIND_PROGRAM(CMAKE_OBJDUMP NAMES $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}objdump PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
+ FIND_PROGRAM(CMAKE_OBJDUMP NAMES $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}objdump)
- FIND_PROGRAM(CMAKE_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
- FIND_PROGRAM(CMAKE_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy)
+ FIND_PROGRAM(CMAKE_OBJCOPY NAMES $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}objcopy PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
+ FIND_PROGRAM(CMAKE_OBJCOPY NAMES $ALLOWUNDEF{_CMAKE_TOOLCHAIN_PREFIX}objcopy)
MARK_AS_ADVANCED(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER CMAKE_NM CMAKE_OBJDUMP CMAKE_OBJCOPY)
-ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
+ENDIF("$ALLOWUNDEF{CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
Index: Source/cmCommandArgumentParserHelper.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommandArgumentParserHelper.cxx,v
retrieving revision 1.20
diff -u -r1.20 cmCommandArgumentParserHelper.cxx
--- Source/cmCommandArgumentParserHelper.cxx 6 Jun 2007 20:20:02 -0000 1.20
+++ Source/cmCommandArgumentParserHelper.cxx 1 Mar 2008 19:33:27 -0000
@@ -87,12 +87,16 @@
}
return this->EmptyVariable;
}
+ else if ( strcmp(key, "ALLOWUNDEF") == 0 )
+ {
+ return this->ExpandVariable(var, true);
+ }
cmSystemTools::Error("Key ", key,
- " is not used yet. For now only $ENV{..} is allowed");
+ " is not used yet. For now only $ENV{..} and $ALLOWUNDEF{..} is allowed");
return 0;
}
-char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
+char* cmCommandArgumentParserHelper::ExpandVariable(const char* var, bool suppress_undefined_warning)
{
if(!var)
{
@@ -109,6 +113,21 @@
return this->AddString(ostr.str().c_str());
}
const char* value = this->Makefile->GetDefinition(var);
+
+ if(!value &&
+ !suppress_undefined_warning &&
+ !this->Makefile->IsOn("CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS"))
+ {
+ cmOStringStream ostr;
+ ostr << "WARNING: Referencing undefined variable '" << var << "' in "
+ << this->FileName;
+ if(this->FileLine >= 0)
+ {
+ ostr << " at line " << this->FileLine;
+ }
+ cmSystemTools::Message(ostr.str().c_str());
+ }
+
if(!value && !this->RemoveEmpty)
{
return 0;
Index: Source/cmCommandArgumentParserHelper.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommandArgumentParserHelper.h,v
retrieving revision 1.11
diff -u -r1.11 cmCommandArgumentParserHelper.h
--- Source/cmCommandArgumentParserHelper.h 6 Jun 2007 20:20:02 -0000 1.11
+++ Source/cmCommandArgumentParserHelper.h 1 Mar 2008 19:33:27 -0000
@@ -58,7 +58,7 @@
char* CombineUnions(char* in1, char* in2);
char* ExpandSpecialVariable(const char* key, const char* var);
- char* ExpandVariable(const char* var);
+ char* ExpandVariable(const char* var, bool suppress_undefined_warning=false);
char* ExpandVariableForAt(const char* var);
void SetResult(const char* value);
Index: Source/cmCoreTryCompile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCoreTryCompile.cxx,v
retrieving revision 1.5
diff -u -r1.5 cmCoreTryCompile.cxx
--- Source/cmCoreTryCompile.cxx 6 Dec 2007 14:56:02 -0000 1.5
+++ Source/cmCoreTryCompile.cxx 1 Mar 2008 19:33:27 -0000
@@ -206,16 +206,22 @@
langFlags += lang;
langFlags += "_FLAGS";
fprintf(fout, "SET(CMAKE_VERBOSE_MAKEFILE 1)\n");
- fprintf(fout, "SET(CMAKE_%s_FLAGS \"", lang);
+ fprintf(fout, "IF(COMPILE_DEFINITIONS)\n");
+ fprintf(fout, " SET(CMAKE_%s_FLAGS \"", lang);
const char* flags = this->Makefile->GetDefinition(langFlags.c_str());
if(flags)
{
fprintf(fout, " %s ", flags);
}
fprintf(fout, " ${COMPILE_DEFINITIONS}\")\n");
- fprintf(fout, "INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES})\n");
+ fprintf(fout, "ENDIF(COMPILE_DEFINITIONS)\n");
+ fprintf(fout, "IF(INCLUDE_DIRECTORIES)\n");
+ fprintf(fout, " INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES})\n");
+ fprintf(fout, "ENDIF(INCLUDE_DIRECTORIES)\n");
fprintf(fout, "SET(CMAKE_SUPPRESS_REGENERATION 1)\n");
- fprintf(fout, "LINK_DIRECTORIES(${LINK_DIRECTORIES})\n");
+ fprintf(fout, "IF(LINK_DIRECTORIES)\n");
+ fprintf(fout, " LINK_DIRECTORIES(${LINK_DIRECTORIES})\n");
+ fprintf(fout, "ENDIF(LINK_DIRECTORIES)\n");
// handle any compile flags we need to pass on
if (compileFlags.size())
{
@@ -251,8 +257,10 @@
}
fprintf(fout, "ADD_EXECUTABLE(cmTryCompileExec \"%s\")\n",source.c_str());
+ fprintf(fout, "IF(LINK_LIBRARIES)\n");
fprintf(fout,
- "TARGET_LINK_LIBRARIES(cmTryCompileExec ${LINK_LIBRARIES})\n");
+ " TARGET_LINK_LIBRARIES(cmTryCompileExec ${LINK_LIBRARIES})\n");
+ fprintf(fout, "ENDIF(LINK_LIBRARIES)\n");
fclose(fout);
projectName = "CMAKE_TRY_COMPILE";
targetName = "cmTryCompileExec";
Index: Source/cmDocumentVariables.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentVariables.cxx,v
retrieving revision 1.17
diff -u -r1.17 cmDocumentVariables.cxx
--- Source/cmDocumentVariables.cxx 27 Feb 2008 22:10:45 -0000 1.17
+++ Source/cmDocumentVariables.cxx 1 Mar 2008 19:33:27 -0000
@@ -486,6 +486,12 @@
"add_executable(CMakeSetup WIN32 ${SRCS})\n",false,
"Variables That Change Behavior");
+ cm->DefineProperty
+ ("CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS", cmProperty::VARIABLE,
+ "Tell cmake to not issue warnings when dereferencing "
+ "nonexistent variables.",false,
+ "Variables That Change Behavior");
+
// Variables defined by CMake that describe the system
CMakeLists.txt [^] (429 bytes) 2008-03-01 14:35 [Show Content] [Hide Content]PROJECT(test_unassigned)
# Variable expansion seems to work
SET(foo ${nonexistent})
ADD_EXECUTABLE(bar bar.cc ${nonexistent})
SET(real "Hello There")
STRING(LENGTH ${real} real_len)
MESSAGE(STATUS "length of string is ${real_len} another ${nonexistent} here")
# Test the special keyword
SET(secret $ALLOWUNDEF{possibly_empty_var})
# Test overriding variable
SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1)
SET(foo ${bar})
|