> 
> Essentially, I'd like to hear your views on handling resource copying. Is
> there an obvious method I've overlooked? What are other projects doing to
> handle resources? Any ideas with respect to other methods of handling 
> resources?


You could do your resources like this:

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

set(inres ${CMAKE_CURRENT_SOURCE_DIR}/myres.txt)
set(outres ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/myres.txt)
add_custom_command(OUTPUT "${outres}"
  COMMAND "${CMAKE_COMMAND}" -E copy "${inres}" "${outres}")

add_library(foo foo.cpp ${outres})

The custom command will be part of building the library, and will run anytime 
myres.txt is out-of-date.
You could make a macro or function if you need to repeat that code often.

Also, installers can easily be made with things scattered around a build tree.  
The cmake install() commands  help you put it where you want in the installer.  
So, I suggest saving your install() commands for making installers, not for 
handling external libraries.

Clint
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to