The other items in your list looks like you have figured out so I'll just make a suggestion for #3:

I tried the following and it does work:


# All the following in its own CMakeLists.txt file that
# will be called with add_subdirectory() from the top level
# CMakeLists.txt file.
project(UnitTests)
add_executable(foo_test foo_test.c)
target_link_Libraries(foo_test ...... )
set_target_properties(foo_test PROPERTIES
                RUNTIME_OUTPUT_DIRECTORY ${UnitTests_BINARY_DIR})
add_test(foo_test ${UnitTests_BINARY_DIR}/foo_test)


If you can wade through the Boost sources there is an experimental CMake build system that I believe does a lot of this. You could probably distill all of this down to a Macro that you could invoke to do all of the above with just a few arguments.

Hope that helps.
_________________________________________________________
Mike Jackson                  [email protected]
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio



On Mar 9, 2009, at 2:49 PM, kent williams wrote:

3. Test programs should NOT get thrown in with the actual 'product'
programs, and ideally stay in ${LOCALDIR_BINARY_DIR} for the local
project.

_______________________________________________
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