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

Michael Jackson mike.jackson at bluequartz.net
Mon Jan 26 08:40:51 EST 2009


My personal suggestion would be to use the plain MakeFiles generator  
and then inside eclipse create a "C++ Makefile" project. You can then  
point the project settings at the build directory to find the makefile  
and also tell eclipse to use "make all install" as the build command  
instead of plain "make".

   Then implement everything that was suggested below. You should be  
able to create the CMake file in such a way as to have all the needed  
files to run your application from the build tree.


_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio



On Jan 26, 2009, at 7:22 AM, Michael Wild wrote:

>
> 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
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list