Skip to content

Conversation

CWehli
Copy link
Contributor

@CWehli CWehli commented Jun 24, 2025

I took up some ideas from @usamimikamen-sk's #234 and, based on @gjanssens' comments, tried to make copying files as a “custom_command”.

I start the build with the command cmake -G Ninja -S ../src -D CMAKE_INSTALL_PREFIX=..install -D WITH_HTML_INSTALL=ON, which copies all files to the build directory for each languages.

However, I could not figure out how to control the dependency between build and the copying of the files during the installation of a single component, with e.g. ninja de-html && ninja install de-html.
All files are always copied, even for the languages that are not activated.

Rather than making custom commands to simply copy files in place we can
depend on cmake' configure_file() command to do the right thing for us.
That is configure_file() will track any file changes for us and
automatically copies the updated files to where we told it initially.

This change requires an explicit rerun of cmake!
@jralls
Copy link
Member

jralls commented Jun 27, 2025

All files are always copied, even for the languages that are not activated.

@CWehli That's because it's independent of the target: "If the input file is modified the build system will re-run CMake to re-configure the file and generate the build system again. The generated file is modified and its timestamp updated on subsequent cmake runs only if its content is changed.". Buildsystem (meaning ninja here) targets don't apply to cmake.

@jralls
Copy link
Member

jralls commented Jun 27, 2025

I took up some ideas from @usamimikamen-sk's #234 and, based on @gjanssens' comments, tried to make copying files as a “custom_command”.

@gjanssens had a lot of comments on #234, and @usamimikamen-sk ultimately abandoned the PR and deleted their branches. Can you be a bit more specific about what is the goal of this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants