Dear CMake community,
I am developing and maintaining the gtk-fortran project since 2011. Its main build system is CMake. Although I have learned since 2016 to maintain myself the CMake part, I am far from being an expert… I am now using CMake 3.22.1 under Ubuntu 22.04 and Fedora.
A gtkbuilder2
executable is built in the build/examples/
directory but it needs the file gtkbuilder.ui
(an XML file describing the Graphical User Interface to build) in the same directory. This is done with that line:
file(COPY gtkbuilder.ui DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ )
The problem is that I recently realized that if I modify the gtkbuilder.ui
file in the source directory, CMake does not see it has been updated and does not update the copy in the build directory.
After some research, it seems I could do that with something like:
configure_file(gtkbuilder.ui gtkbuilder.ui COPYONLY)
Am I on the right way?
Note that I had already use configure_file()
to substitutes variable values referenced as @VAR@
but I did not realized it could be used to simply copy a file without substitution.