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@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to