[CMake] Two issues with CMake 2.4.6 on VC71

Rob Mathews Rob.Mathews at varolii.com
Tue May 8 13:42:56 EDT 2007


(I'd report these issues directly, but I don't have reporting access to
the bug system ...)

Here goes: 

1) MIDL compiler doesn't accept defines with quotes, and CMake supplies
defines with quotes. 

To be precise, if you define something like [PRODUCT_NAME="FLY BY NITE"]
and [VERSION=9], and then have an .idl file in your project, CMake will
generate something like

PreprocessorDefinitions="&quote;PRODUCT_NAME=\&quote;FLY BY
NITE\&quote;&quote;&quote;VERSION=9&quote;"

That'll generate a MIDL warning about an illegal option, followed by not
actually generating the type library. MIDL seems mixes up the quotes
when it does the commandline processing.

One fix is simply to have CMake clean the defines by to not emitting any
-D arguments with quotes for the MIDL tool. 

2) INCLUDE_DIRECTORIES has changed behaviour since 1.8.1. Not sure if it
is intentional ...

It used to be if you said: 

INCLUDE_DIRECTORIES("../" )

that ".." would refer to the project where the .vcproj file was
generated. So, you could set INCLUDE_DIRECTORIES to ".." in a
CMakeLists.txt file above everything, then use SUBDIRS to recurse down a
level the where the .vcproj file was actually generated, and CMake would
do the right thing. (well, ok, actually it would do nothing at all - it
just left the relative pathname alone - but same difference. ). Now it
tacks on the absolute pathname of where the CMakelists.txt file that has
the INCLUDE_DIRECTORIES command is, which is completely useless for
making a master default. 



More information about the CMake mailing list