[Cmake] 2 x configure_file

Dekeyser, Kris Kris.Dekeyser at lms.be
Mon Sep 20 11:39:47 EDT 2004


Consider three projects A, B and C and B depends on A and C depends on A. I
want to have a workspace with A and B and a separate one with A and C. So I
created:

SUBDIRS(A)
SUBDIRS(B)
SUBDIRS(EXCLUDE_FROM_ALL C)

and in subdir C:
SUBDIRS(../A)
SUBDIRS(C)

This worked fine until I rolled out a system where during the CMake run a
couple of files are generated in the binary dir that contain settings needed
by dependend projects (something like the PackageConfig system). I used
CONFIGURE_FILE( ... IMMEDIATE) for that.

The problem is that CMake encounters the project A twice and also tried to
run the CONFIGURE_FILE twice on the same file. This fails with:

CMake Error: Error in cmake code at
n:/edmvob/TecManager/LmsHq/Administration/DataServerBuild_v1/CMake/EdmMacros
/BuildMacros.cmake:265:
CONFIGURE_FILE Problem configuring file

I assume the file is still open by the first command.

I currently removed the duplicates to workaround, but is there another way
to get around this, keeping the (duplicate) dependent projects in the
sub-project's workspace and still generating all workspaces in one go?

My config: CMake 2.0.3 - WinXP SP1 - MsDev 6 SP5
+-+-+- Email Confidentiality Footer +-+-+- 
Privileged/Confidential Information may be contained in this message. If you
are not the addressee indicated in this message (or responsible for delivery
of the message to such person), you may not print, retain, copy nor
disseminate this message or any part of it to anyone and you should notify
the sender by reply email and destroy this message. Neglecting this clause
could be a breach of confidence. Please advise immediately if you or your
employer does not consent to Internet email for messages of this kind.
Opinions, conclusions and other information in this message that are not
related to the official business of my firm shall be understood as neither
given nor endorsed by it.



More information about the Cmake mailing list