https://github.com/Kitware/CMake
Revision 2509c7678feb2efab79a384fd0b0b35cee8d02b0 authored by Stephen Kelly on 13 January 2014, 12:04:03 UTC, committed by Stephen Kelly on 13 January 2014, 14:53:00 UTC
Commit 5bb53f6b (cmTarget: Deprecate COMPILE_DEFINITIONS_ properties
with a policy., 2013-12-30) deprecated the config-specific
COMPILE_DEFINITIONS_* properties in favour of using generator
expressions.

Set the directory property in UseQt4.cmake to match the
INTERFACE_COMPILE_DEFINITIONS on the Qt4::QtCore and Qt5::Core
IMPORTED targets.  Setting QT_NO_DEBUG is sufficient because qglobal.h
sets the corresponding QT_DEBUG definition if required.
1 parent 325ca1f
Raw File
Tip revision: 2509c7678feb2efab79a384fd0b0b35cee8d02b0 authored by Stephen Kelly on 13 January 2014, 12:04:03 UTC
Qt4: Use generator expression in COMPILE_DEFINITIONS (#14692)
Tip revision: 2509c76
cmUnsetCommand.cxx
/*============================================================================
  CMake - Cross Platform Makefile Generator
  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium

  Distributed under the OSI-approved BSD License (the "License");
  see accompanying file Copyright.txt for details.

  This software is distributed WITHOUT ANY WARRANTY; without even the
  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the License for more information.
============================================================================*/
#include "cmUnsetCommand.h"

// cmUnsetCommand
bool cmUnsetCommand::InitialPass(std::vector<std::string> const& args,
                                 cmExecutionStatus &)
{
  if(args.size() < 1 || args.size() > 2)
    {
    this->SetError("called with incorrect number of arguments");
    return false;
    }

  const char* variable = args[0].c_str();

  // unset(ENV{VAR})
  if (cmHasLiteralPrefix(variable, "ENV{") && strlen(variable) > 5)
    {
    // what is the variable name
    char *envVarName = new char [strlen(variable)];
    strncpy(envVarName,variable+4,strlen(variable)-5);
    envVarName[strlen(variable)-5] = '\0';

#ifdef CMAKE_BUILD_WITH_CMAKE
    cmSystemTools::UnsetEnv(envVarName);
#endif
    delete[] envVarName;
    return true;
    }
  // unset(VAR)
  else if (args.size() == 1)
    {
    this->Makefile->RemoveDefinition(variable);
    return true;
    }
  // unset(VAR CACHE)
  else if ((args.size() == 2) && (args[1] == "CACHE"))
    {
    this->Makefile->RemoveCacheDefinition(variable);
    return true;
    }
  // unset(VAR PARENT_SCOPE)
  else if ((args.size() == 2) && (args[1] == "PARENT_SCOPE"))
    {
    this->Makefile->RaiseScope(variable, 0);
    return true;
    }
  // ERROR: second argument isn't CACHE or PARENT_SCOPE
  else
    {
    this->SetError("called with an invalid second argument");
    return false;
    }
}

back to top