[CMake] Changing the actual "src" directory where VS project and/or sln files are rooted

Michael Powell mwpowellhtx at gmail.com
Sat Sep 16 17:49:49 EDT 2017


On Sat, Sep 16, 2017 at 5:44 PM, J Decker <d3ck0r at gmail.com> wrote:
>
>
> On Sat, Sep 16, 2017 at 2:25 PM, Michael Powell <mwpowellhtx at gmail.com>
> wrote:
>>
>> Hello,
>>
>> Sorry if this seems like a rookie/novice question. I'm not new to
>> CI/CD, however; this question may have been asked before, I don't
>> know.
>>
>> I'll preface with a little background. It's been a little while for me
>> using and truly "grokking" CMake, but if memory serves, CMake lifts
>> raw source inputs and drops them into what becomes a meta-description
>> for what is ultimately being built. That could overlay the source
>> directories, but may not. That's if memory serves.
>>
>> Now, I am trying to configure and generated CMake targeting the Visual
>> Studio 2015 environment.
>>
>> My repository is organized something like:
>>
>> $/CMakeLists.txt
>> $/src
>> $/src/CMakeLists.txt
>> $/src/... (for things like tests, etc)
>>
>> And so on.
>>
>> Solution files are landing in the $/ directory, but I want them to
>> land in the $/src directory as is customary for Visual Studio
>> solutions.
>
> Then you're doing an in-source build which is not really the proper thing...
> they should land in something like $/build or $/../build even.  and then it
> wouldn't matter where they were.

Ah, indeed, "in-source", thank you. The vocab escaped me. Yes, that
seemed odd to me as well, if my recollection served (which apparently
it does). Thanks for the clarification.

>>
>>
>> First, as far as I know, the OA (original author) is dropping
>> CMake-driven output in the same context as the source files. Maybe
>> that's good and/or acceptable, maybe not, considering the
>> meta-descriptive nature of CMake.
>>
>> So the first question is how to cause CMake to respect the $/src
>> objective. Otherwise, perhaps I simply have CMake generate the
>> penultimate build structure.
>>
>> Close behind those questions is how to avoid outputs like ALL_BUILD
>> and ZERO_CHECK. Those are not necessary, or perhaps are don't care,
>> especially if output can land in $/src as envisioned.
>>
>> Thank you!
>>
>> Regards,
>>
>> Michael Powell
>> --
>>
>> 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