[CMake] avoiding building test targets

edA-qa mort-ora-y eda-qa at disemia.com
Thu Oct 7 07:56:23 EDT 2010


On 10/07/2010 11:28 AM, Michael Wild wrote:
> function(add_test_executable name)
>   add_executable(${name} EXCLUDE_FROM_ALL ${ARGN})
>   if(NOT TARGET test-exes)
>     add_custom_target(test-exes)
>   endif()
>   add_dependencies(test-exes ${name})
> endfunction()
> 
> add_custom_target(check
>   COMMAND ${CMAKE_CTEST_COMMAND}
>   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
>   COMMENT "Running ctest")
> add_dependencies(check test-exes)

That's great. Thank you.

-- 
edA-qa mort-ora-y
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

	BigTPoker - Poker fun and games

		http://BigTPoker.com/
	
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Sign: Please digitally sign your emails.
Encrypt: I'm also happy to receive encrypted mail.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101007/05ee7840/attachment.pgp>


More information about the CMake mailing list