I know that we can configure a file using cmake as discussed in Can CMake generate configure file? for example.
My problem is that I want to update just one line of a file. For instance, assume that this line contains app version:
my_header_version.h.in:
#include "${CMAKE_SOURCE_DIR}/src/definitions.h"
CMakeLists.txt:
...
configure_file(my_header_version.h.in my_header_version.h)
...
my_header_version.h:
#include "/home/myusr/dev/src/definitions.h"
The problem is that if I change my_header_version.h into:
#include <some_lib.h>
#include "/home/myusr/dev/src/definitions.h"
and after that I run cmake ..
command, then the line #include <some_lib.h>
gets lost.
What should I do if I want to change my_header_version.h directly without changing my_header_version.h.in anytime?!