[CMake] cmake - two targets that depends on single static library that should be compiled based on the target that is being built

Marc Herbert marc.herbert at gmail.com
Wed Jul 17 10:38:05 EDT 2019


>
>
> I have a static library and two target executables, let's call them
> **libA**, **EXE1**, **EXE2**.
>
> If I am building EXE2, I need to disabled the macros in libA and don't
> link to another library.
> [...]
> I don't want to create two targets with same source files.
>

I'm curious why you wanted two executable targets but not the corresponding
two library targets, I don't think you said why. I would have thought you'd
want A. either to be able to build both configurations at the same time, B.
or one project configuration at a time. So why want A for executables but B
for libraries?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190717/5b1b5553/attachment.html>


More information about the CMake mailing list