On Tue, Nov 03, 2009 at 04:59:22PM +0100, Thomas wrote:
> I want to write a test, that needs pregenerated test data. What is the
> correct way to access and store it?
> 
> My idea is to put it into the source tree like:
> 
> File structure:
> /mylib/<library files>
> /mylib/test/CMakeLists.txt
> /mylib/test/data.txt <- pregenerated test data
> /mylib/test/test.cpp
> 
> In CMakeLists.txt:
> add_definitions(-DTEST_PATH=${CMAKE_CURRENT_SOURCE_DIR})
> 
> In C++ (test.cpp):
> string testPath = TEST_PATH;

This looks reasonable. Did you try it to see if it works? What's your
question, exactly?

tyler
_______________________________________________
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