[CMake] CONFIGURE_FILE output not cleaned up

Eduard Bloch edi at gmx.de
Fri Aug 25 11:01:52 EDT 2006


Hello,

thanks for answering, that solved the problem (see below). I have
another one:

CONFIGURE_FILE is used (see below) to adopt an autoconf-style config
file, however the result is not cleaned up when the clean target is run.
It is not that bad as long as the generated file is not shipped and so
the generation is triggered on users machine, but when something
unexpected happens then the build will get xconfig.h with wrong
contents.

How can I make sure that autogenerated files are removed? I tried
setting ADDITIONAL_MAKE_CLEAN_FILES even with complete path, it does not
help.

Or how can I make sure that the file is updated when the build
environment changes?

CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/xconfig.h.in ${CMAKE_CURRENT_SOURCE_DIR}/xconfig.h)
SET_SOURCE_FILES_PROPERTIES(xconfig.h PROPERTIES GENERATED 1)
LIST(APPEND tmps  ${CMAKE_CURRENT_SOURCE_DIR}/xconfig.h  ${CMAKE_CURRENT_SOURCE_DIR}/align.h)
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES tmps)

also tried

CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/xconfig.h.in ${CMAKE_CURRENT_SOURCE_DIR}/xconfig.h)
SET_SOURCE_FILES_PROPERTIES(xconfig.h PROPERTIES GENERATED 1)
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_CURRENT_SOURCE_DIR}/xconfig.h ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_CURRENT_SOURCE_DIR}/align.h)


* Brad King [Thu, Aug 24 2006, 12:25:25PM]:
> Eduard Bloch wrote:
> > It seems like install_manifest already contains hardcoded absolute
> > (wrong) directions when created. The workaround was adding an absolete
> > path based on CMAKE_BINARY_DIR to INSTALL targets:
> > 
> > SET(BINS_SET mkisofs/mkisofs cdrecord/wodim rscsi/rscsi readcd/readcd
> > mkisofs/devdump mkisofs/isodebug mkisofs/isodump
> > ->mkisofs/isoinfo mkisofs/isovfy 3rd-party/zisofs_tools/mkzftree
> > cdda2wav/cdda2wav cdda2wav/pitchplay cdda2wav/readmult
> > ->cdda2wav/cdda2mp3 cdda2wav/cdda2ogg)
> > FOREACH(app ${BINS_SET})
> >    install(PROGRAMS ${CMAKE_BINARY_DIR}/${app} DESTINATION bin)
> > ENDFOREACH(app ${BINS_SET})
> 
> Read the documentation of the INSTALL command.  In the section about
> install(PROGRAMS) it says "Use the TARGETS form to install targets built
> within the project."  In other words:
> 
> # mkisofs/CMakeLists.txt
> INSTALL(TARGETS mkisofs DESTINATION bin)

Okay. I wanted to avoid editing all the CMakeLists.txt in the subdirs
but after editing it it looks more clear now.



-- 
Naja, Garbage Collector eben. Holt den Müll sogar vom Himmel.
       (Heise Trollforum über Java in der Flugzeugsteuerung)


More information about the CMake mailing list