[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] dependency in custom command?
From:       "King, Steven R" <steven.r.king () intel ! com>
Date:       2009-08-31 17:12:25
Message-ID: C1C25359D0A5694980E3411F7FDE55BA02B8E4211B () orsmsx508 ! amr ! corp ! intel ! com
[Download RAW message or body]

> > add_test    (
> > test_my_module
> > ${CMAKE_BINARY_DIR}/bin/test_my_module
> > )
> 
> This will only work on Unix like systems. Doesn't CTest figure out
> that the program name is a target? I.e. doesn't this work (provided
> you did add_executable(test_my_module ...)):
> 
> add_test(test_my_module test_my_module)
 
Hi Michael,

I have the add_executable just as you show, but CTest gives up immediately since it \
can't find the test_my_module executable in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}.

Here are the bugs I think I've encountered with your collective help:

Bug 1: Cmake ignores ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} in the add_test() command.  \
Consequently ctest reports a failure due to not finding the test binary.

Bug 2: Locating a build output using the LOCATION property of a target is deprecated, \
but commands cannot substitute the target name for build output location.  In other \
words, commands like this fail:  add_executable( foo foo.cpp )
	add_custom_command( OUTPUT new_foo COMMAND $(CMAKE_COMMAND) -E copy foo new_foo )

Cmake should recognize 'foo' as a target and implicitly substitute foo's build \
output.


But back to the dll test problem: Changing ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} forces \
me to hack all the ctests in my whole build tree, which I'm unwilling to do.  I will \
stick with Clint's copy_if_different idea to move the dll to the binary directory of \
the test program.  
Thanks Clint, Michael, Philip Tyler and the list.  Community support here has been \
great even if the answers weren't what I hoped to hear.

Cheers,
-steve
_______________________________________________
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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic