[CMake] Dealing with .def and .rc files needed on Windows.

Rick McGuire object.rexx at gmail.com
Mon Sep 29 19:36:31 EDT 2014


We have a project that gets built on a variety of platforms, but it mostly
boils down to "windows" and "not windows".  For our libraries to build on
Windows, we need to also specify a .def and a .rc file in the library
source files list.  We have a strategy for adding these in using an extra
platform specific variable that's working fine.

However, cmake seems to be so good at sorting out differences like this
that I was wondering if I might be missing an easier strategy of dealing
with these extra requirements.  I tried adding those files to the list
unconditionally in the hope that cmake would figure out that these files
were a Windows-only thing and ignore them, but that didn't really work.  Is
there some easier way to do this?  What we have is working well, but I'm
always looking for ways to reduce the number of conditional tests we
require in the build script.

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140929/b84da32d/attachment-0001.html>


More information about the CMake mailing list