>From cmGlobalVisualStudioGenerator.cxx (line 92ff):

#if 0
      // Can't activate this code because we want ALL_BUILD
      // selected as the default "startup project" when first
      // opened in Visual Studio... And if it's nested in a
      // folder, then that doesn't happen.
      //
      // Organize in the "predefined targets" folder:
      //
      if (this->UseFolderProperty())
        {
        allBuild->SetProperty("FOLDER", this->GetPredefinedTargetsFolder());
        }
#endif

Ok, this makes it pretty clear. But "we" don't want ALL_BUILD always to be 
selected as default "startup project". How about something like this:

      if (this->UseFolderProperty())
        {
        const char* prop = this->GetCMakeInstance()->GetState()
          ->GetGlobalProperty("ALL_BUILD_TARGET_FOLDER");
        if(prop)
          {
          allBuild->SetProperty("FOLDER", prop);
         }
        }

This would allow relocating the ALL_BUILD target, but it must be done 
explicitly using a new global property ALL_BUILD_TARGET_FOLDER.

If it's acceptable I'd submit a patch for this.

best regards,
Michael


From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Stuermer, Michael 
SP/HZA-ZSEP
Sent: Friday, January 29, 2016 3:43 PM
To: cmake@cmake.org
Subject: [CMake] Setting target property FOLDER on target ALL_BUILD

I would like to move the ALL_BUILD target tot he "CMakePredefinedTargets", 
however this seems not be possible straight away. At least even at the very end 
of the very last CMakeLists.txt I still cannot call

set_target_properties(ALL_BUILD
    PROPERTIES
    FOLDER " CMakePredefinedTargets ")

without getting an error that the target does not exist. Can it be done at all?

best regards,
Michael

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to