[CMake] Function for visibility definitions

Clinton Stimpson clinton at elemtech.com
Thu Feb 11 10:18:02 EST 2010


On 02/11/2010 07:40 AM, Hendrik Sattler wrote:
> Zitat von Bill Hoffman <bill.hoffman at kitware.com>:
>> That said, you could have CMake configure a .h file that had this stuff
>> in it.  It might be nice if the function did that automatically, as it
>> is almost the same code for every project.  Then once your project was
>> built with CMake, you would install the configured .h files and other
>> build systems could still use the software.
>
> OTOH, cmake is a build system, not a code generator.
> This export stuff is so simple[1], why all the hassle to generate it?
>
> HS
>
> [1]: you only have too cases: Windows and gcc>=4. All compilers on 
> Windows use the same syntax.

If your library is only ever built as shared, sure, you don't cmake to 
generate code.
Otherwise, the code needs that bit of information from the build system.
I'd rather have a configured header file with that info in it.

Clint



More information about the CMake mailing list