help with CMake on win32

Brad King brad.king at kitware.com
Tue Feb 7 17:55:59 CET 2006


Peter Kümmel wrote:
> Brad King wrote:
>>In the case that we are building kdewin32 then the try-compile results 
>>should just be hard-coded to true for the functions provided.  I think 
>>this is what ConfigureChecksWin is supposed to do, but it should be 
>>included BEFORE the checks so that they are not done at all.
>>
> But if we use ConfigureChecksWin then we have to adjust it manually
> which is very error prone, there will be also changes to kdewin in future.
> 
> I would prefer some form of kdewin-pre-build.
> Maybe by some IFs in the CMakefiles or by calling a additional
> CMakefile for building kdewin before the configure process starts.

There are two approaches:

1.) Create a file in the kdewin32 build directory that just does

SET(HAVE_FOO 1)

for every function foo it provides.  This file could be included by 
ConfigureChecksWin.cmake.  Then the changes are always localized to the 
kdewin32 source directory.

2.) Use TRY_COMPILE to build the entire kdewin32 directory as a separate 
sub-project during the initial configuration stage before any of the 
other try-compiles run.  Then its functions will be available for the 
other try-compiles to find.

 From my experience writing CMake code for several large cross-platform 
projects I strongly suggest option #1.  Using option #2 will hide the 
kdewin32 build from the user and error messages will be obscure.  Also 
the try-compiles that #2 does are almost useless because they will do 
alot of work just to learn what option #1 says in one line.

-Brad


More information about the Kde-buildsystem mailing list