Hi,

this is my second attempt on the topic. As I could not make myself any
clearer I re-post a question by William Deurwaarder on Apr 11, 2014.

Thanks,
Dirk Steenpass

-----------------------------------------------------
Summary: What is the reason that custom-targets that are needed by a
project and its dependencies are not added to the default-build in Visual
Studio in case that target is defined out-side the sub-directory tree of
this project?

I have the following directory-structure:

root/A -> in this CMakeLists.txt a custom-target is defined
root/B -> in this CMakeLists.txt a static-library is defined which depends
on A (A will generate files for this library)
root/C -> in this CMakeLists.txt the executable is defined which depends on
B (there is no dependency added for A; of course that could be done in this
case but my real case is much more complex and I do not want to explicit
lists all custom-target dependencies here)
root -> in this CMakeLists.txt all three sub-directories are added.

The real case is much more complex and I cannot add A under C, or put C in
the root, etc.

With Linux and make this works fine. For Windows and Visual Studio the
solution-file of C (in directory of C) does not add A to the default-build
(although it is added as a dependency for B). This means that A is not
executed which results in compiler-errors as B misses files that should
have been generated by A.

Looking into the code I see that the line to add A to the default-build
(IsPartOfDefaultBuild) is conditional for UTILITY-targets (it is only added
if there is a direct dependency that means or is part of the sub-directory
of C or has a direct dependency which is added by add_dependencies). My
question is what is the reason to exclude A from the default-build in case
it has a transitive dependency (via B)? Would it be possible to change that
so in case A is needed via a transitive dependency A is also included to
the default-build.

Thanks for your insight and answers,

William Deurwaarder
-- 

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://www.cmake.org/mailman/listinfo/cmake

Reply via email to