[CMake] ExternalProjects with Visual Studio

David Cole david.cole at kitware.com
Tue Oct 16 13:47:33 EDT 2012


If you want "real" vcxproj references, then use add_subdirectory
instead of ExternalProject to build things directly.

Or is there some reason you can't do that?

If we made "real" vcxproj files directly, then we'd have to run
configure on all the sub-projects at the outer project configure time.
(Which is nigh impossible seeing as how even downloading the source
code is deferred to build time...)

This would be directly opposed to one of the main design goals of
ExternalProject: defer ALL time-consuming operations to build time.


HTH,
David


On Mon, Oct 15, 2012 at 9:31 AM, Titus von Boxberg <titus at v9g.de> wrote:
> Hi all,
>
> my C++ sources are split into several (static) libraries and
> an executable that uses the static libs.
> All of those source modules have CMake configurations.
>
> I'm using ExternalProject_Add in the executable's CMakeLists.txt
> together with target_link_libraries
> to add the static libs to the executable's project.
>
> All that works well under UNIX and Windows.
>
> However, when opening the sln with Visual Studio, the project files
> of the libraries do not contain the sources; they are only placeholders
> to build the libraries for the executable.
> That's clear to me since the "real" vcxproj files within the
> libraries are generated during the configure step of the
> ExternalProject build and are unavailable at the time the
> executable's sln or vcxproj are generated by cmake.
>
> My question is: Is there an automatic way to get sln and vcxproj
> files for the executable that reference the "real" vcxproj files
> of the libraries instead of the placeholders?
>
> Thanks in advance
>
> Regards
> Titus
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list