[CMake] Using Eclipse CDT, CMake resets Eclipse project configuration frequently

Michael Wild themiwi at gmail.com
Mon Jan 26 07:22:09 EST 2009


On 26. Jan, 2009, at 12:24, Jonatan Bijl wrote:

> Hi,
>
>
>
> I have created an out-of-source build tree (on Windows), with the
> installation directory as a subfolder of the build trees. The idea is
> that the compiled binary requires some DLL's, images, 3D models and
> configuration files, at a location relative to the executable. If the
> files are changed, they will be copied from the source tree to the
> installation tree again. Therefore, I need to run "make install all"
> before running the executable. Because of the executable's  
> dependency on
> the other files, I always want to build and install. (I don't expect a
> built file to work in itself because it won't be able to find the
> required files)


In such a situation I usually try to "configure_file" things into the  
build tree such that I can run the executable from the build tree.  
Also setting EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH for this  
purpose is very useful. If I need to configure some files differently  
for the build and install tree, I configure them twice into separate  
directories (the latter e.g. under ${CMAKE_BINARY_DIR}/InstallFiles).  
This way I can have different versions of the configured files for the  
build and install tree.



>
>
> However, sometimes the project settings are reset (I guess they are
> re-generated by cmake), so that I have to manually set it to do "make
> install all" again instead of "make all".
>
>
>
> Does anyone know a way to enforce the install after every build?
>
>
>
> Or does anyone know a better way to make sure all the required files  
> are
> updated from the src to the build tree if necessary?
>
>

As I said, configure_file does the job. If the original file changed,  
the process will be repeated. If you only need to copy a certain file,  
you can use the COPY_ONLY option.


HTH

Michael



More information about the CMake mailing list