Re: [CMake] [CTest] Access test data from c++ code

2009-11-04 Thread Marcel Loose
Hi Thomas,

It depends. I would prefer to keep a clean source tree and put any
generated file in the build tree. That way you could (in principle) run
cmake from a read-only source tree. But it's not wrong the way you do
it.

Regards,
Marcel Loose.

On Tue, 2009-11-03 at 17:38 +0100, Thomas wrote:
 Yes it works. My questions was if this is the way it should be done.
 
 ___
 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

___
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


[CMake] [CTest] Access test data from c++ code

2009-11-03 Thread Thomas
Hallo,

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;

Is this correct?

Thank you :)

___
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


Re: [CMake] [CTest] Access test data from c++ code

2009-11-03 Thread Tyler Roscoe
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


Re: [CMake] [CTest] Access test data from c++ code

2009-11-03 Thread Thomas
Yes it works. My questions was if this is the way it should be done.

___
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