[CMake] Bug or misusage ???

Philippe Poilbarbe Philippe.Poilbarbe at cls.fr
Mon Mar 6 10:25:44 EST 2006


Hello,

I build some files extracted from a compressed one and I have the
following declaration:

#############
  ADD_CUSTOM_TARGET(gshhs_f.b ALL
            ${CMAKE_CURRENT_SOURCE_DIR}/UnzipFile.pl
${CMAKE_CURRENT_SOURCE_DIR}/gshhs_data_files.zip gshhs_f.b
            DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gshhs_data_files.zip)
#############

and cmake in creates a file named CMakeFiles/gshhs_f.b.dir/build.make
where there is the following lines:

#############
# Utility rule file for gshhs_f.b.

gshhs_f.b: data/gshhs_data_files.zip
gshhs_f.b: data/CMakeFiles/gshhs_f.b.dir/build.make
    cd /home/su_php/dev2/BRAT/data && ./UnzipFile.pl
/home/su_php/dev2/BRAT/data/gshhs_data_files.zip gshhs_f.b

# Convenience name for target.
data/CMakeFiles/gshhs_f.b.dir/build: gshhs_f.b
#############

And in the Makefile there is:

#############
# Convenience name for target.
data/CMakeFiles/gshhs_f.b.dir/rule:
    cd /home/su_php/dev2/BRAT && $(MAKE) -f CMakeFiles/Makefile2
data/CMakeFiles/gshhs_f.b.dir/rule

# Convenience name for target.
gshhs_f.b: data/CMakeFiles/gshhs_f.b.dir/rule
#############

And as it is declared, the file is always extracted (the UnzipFile.pl
script changes the date of extracted file in order to be greater than
the one of the zip file avoiding a further extraction).
It is due to the dependency made on data/CMakeFiles/gshhs_f.b.dir/build
in build.make which does not exists and is never created (so building of
gshhs_f.b is always done).

Do I misuse CMake in this case or do you think it is a bug?
Redoing everything everytime is very long (extracting or building some
of these files is very time consuming).
I have done a workaround (this is the script which test the dates) but I
think this not the job of the building commands to test the dates
instead of make.

Regards,
Philippe Poilbarbe.
CLS - Space Oceanography Division

Environment: CMake 2.2-3, Linux and Windows (the behaviour is the same).




More information about the CMake mailing list