[CMake] Solution folders

John Drescher drescherjm at gmail.com
Sat Feb 19 11:33:53 EST 2011


On Sat, Feb 19, 2011 at 11:22 AM, Robert Bielik
<robert.bielik at xponaut.se> wrote:
> Hi all,
>
> Running CMake 2.8.2 and generating build files for VS 9 (2008), I'm trying
> to "tidy up" the workspace by putting projects in solution folders.
> So I do:
>
> add_library(MyLib .....)
>
> set_target_properties(MyLib
>  PROPERTIES
>  FOLDER "Libraries");
>
> add_executable(MyExe .....)
>
> set_target_properties(MyLib
>  PROPERTIES
>  FOLDER "Executables");
>
> But nothing happens. All projects are still top level as usual. Ideas ?

You need this at the top of your main CMakeLists.txt

#Use solution folders.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

John


More information about the CMake mailing list