[CMake] Building arguments to target_comple_definitions()

Rob Boehne robb at datalogics.com
Thu Oct 11 16:07:42 EDT 2018


They were elided for brevity –

So in CMake parlance, what type is the last argument to target_compile_definitions?  Is it a list, string or something else?

From: Chuck Atkins <chuck.atkins at kitware.com>
Date: Thursday, October 11, 2018 at 2:55 PM
To: Rob Boehne <robb at datalogics.com>
Cc: CMake Mail List <cmake at cmake.org>
Subject: Re: [CMake] Building arguments to target_comple_definitions()

So, are you suggesting that I make a “dummy” target and fill it with the common options in compile_definitions() and include_directories() (et. al.)
Then make my OBJECT libraries (and the shared library) depend on the “dummy” target?

If that’s not the suggestion, I’m afraid I don’t see how I can use this to set the common flags

That's certainly one way you can solve the problem, i.e. making an interface library with the common defs, and a good idea at that, but that's not what I was referring to.  I was simply tying to explain that the error your getting trying to pass arguments to target_compile_options is because you're missing the visibility argument.

- Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20181011/f6fdfcef/attachment-0001.html>


More information about the CMake mailing list