[CMake] How to link in different prebuilt objects based on configuration

Daniel Schepler dschepler at scalable-networks.com
Thu Dec 13 13:27:09 EST 2018


We have a build here where a large portion of our product is in source code available to customers, but then there is a core which we only distribute as prebuilt "private objects".  However, then when we test the customer-type build on Windows, we get an error like:

---
CMake Error in CMakeLists.txt:
Target "exata" has source files which vary by configuration. This is not
supported by the "Visual Studio 15 2017 Win64" generator.

Config "Debug":

E:/EXata_7_0/qualnet_dev_13_Dec18/kernel/obj/exata-main-windows-x64-vc14d.obj

Config "Release":

E:/EXata_7_0/qualnet_dev_13_Dec18/kernel/obj/exata-main-windows-x64-vc14.obj
---

(This object file is marked with source file property EXTERNAL_OBJECT=1.)

Is this a limitation in Visual Studio projects, or a limitation in CMake?  In either case, what workaround could allow this build to support generating Visual Studio projects?
--
Daniel Schepler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20181213/7b6b0aa4/attachment.html>


More information about the CMake mailing list