[CMake] How to create a custom solution with Visual Studio 2010 generator?

J Decker d3ck0r at gmail.com
Mon Sep 21 10:50:16 EDT 2015


CMake's PROJECT directive maps to 'Solution'  (should only be one
project() per chain) ... use set( PROJECT projectname) and then
reference ${PROJECT} later instead of ${PROJECT_NAME} for easy
conversion.

add_library, add_executable map to 'project'

from http://www.cmake.org/Wiki/CMake_Useful_Variables

you can wrap the projects you want to omit with If's

if( NOT MSVC10 )
   add_library( one I don't want in 2010)
endif( NOT MSVC10 )




On Sun, Sep 20, 2015 at 11:20 PM, Golebiewski, Jakub
<Jakub.Golebiewski at dnvgl.com> wrote:
> Hi,
>
>
>
> I’m trying to create a solution with custom set of projects (in VS sense)
> for Visual Studio 2010.
>
> I have a top level CMakeLists.txt with PROJECT() declared and then several
> CMakeLists.txt below in a tree also with PROJECT() in each of them.
>
> However for lower level PROJECT() directives I get all the targets that I
> specify in CMakeLists.txt and all the targets that they depend on.
>
>
>
> My goal is to have a solution only with a specific set of targets, without
> dependencies.
>
>
>
> Is there a  way to do that in cmake?
>
>
>
> Thanks for help,
>
> Jakub
>
>
> **************************************************************************************
> This e-mail and any attachments thereto may contain confidential information
> and/or information protected by intellectual property rights for the
> exclusive attention of the intended addressees named above. If you have
> received this transmission in error, please immediately notify the sender by
> return e-mail and delete this message and its attachments. Unauthorized use,
> copying or further full or partial distribution of this e-mail or its
> contents is prohibited.
> **************************************************************************************
>
> --
>
> 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


More information about the CMake mailing list