Hello,

I couldn't find any solution's for this problem even after posting the
question on Reddit/stack overflow, so I am posting it here.

My question is as follows:

I have a static library and two target executables, let's call them
**libA**, **EXE1**, **EXE2**.

**libA** has pre-processor macros which needs to be enabled or disabled and
another static library which needs to be linked or ignored based on the
target executable that I am building.

Let's say, if I am building EXE1. Then I need to enable the macros in libA
and link another static library to it.

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 am confused on how to solve this issue. Please kindly help in solving
this issue.
-- 

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

Reply via email to