[CMake] Supported configurations with Visual Studio builds

Philip Lowman philip at yhbt.com
Mon Oct 8 11:41:23 EDT 2007


Josef Karthauser wrote:
>>> Is this a bug or a feature, does anyone know?  If I rip out the
>> checks in cmGlobalVisualStudio7Generator:: GenerateConfigurations is
>> anything going to break?
>>>
>> If you rip out this I think you'll have an error with TRY_COMPILE. (be
>> aware to delete your CMakeLists.txt cache each time you test your
>> changes to be sure that the TRY_COMPILE is able to work correctly).
>>
> 
> There doesn't appear to be a problem with that.  It works fine with this
> patch,
> Joe
> 
> Index: cmGlobalVisualStudio7Generator.cxx
> ===================================================================
> --- cmGlobalVisualStudio7Generator.cxx  (revision 2619)
> +++ cmGlobalVisualStudio7Generator.cxx  (working copy)
> @@ -169,9 +169,7 @@
>          len = configTypes.size() - start;
>          }
>        config = configTypes.substr(start, len);
> -      if(config == "Debug" || config == "Release" ||
> -         config == "MinSizeRel" || config == "RelWithDebInfo")
> -        {
> +
>          // only add unique configurations
>          if(std::find(this->Configurations.begin(),
>                       this->Configurations.end(),
> @@ -179,14 +177,7 @@
>            {
>            this->Configurations.push_back(config);
>            }
> -        }
> -      else
> -        {
> -        cmSystemTools::Error(
> -          "Invalid configuration type in CMAKE_CONFIGURATION_TYPES: ",
> -          config.c_str(),
> -          " (Valid types are
> Debug,Release,MinSizeRel,RelWithDebInfo)");
> -        }
> +
>        start = endpos+1;
>        }
>      }

What about the debug/optimized flags for TARGET_LINK_LIBARIES()?  Do
these work right now by taking advantage of the fact that Debug,
Release, MinSizeRel, and RelWithDebInfo are hardcoded?


Also, judging by code in cmLocalVisualStudio7Generator.cxx any custom
build solutions that you would added would probably only work as release
libraries:

    if(strcmp(configName, "Debug") == 0
       || strcmp(configName, "RelWithDebInfo") == 0)
      {
      fout << "\t\t\t\tGenerateDebugInformation=\"TRUE\"\n";
      }


-- 
Philip Lowman
Sr. Simulation Development Engineer, Modeling and Simulation Technology
General Dynamics Land Systems
http://www.gdls.com


More information about the CMake mailing list