Re: [CMake] runtime dependencies for tests

2012-02-03 Thread Massaro Alessio
OK, one step forward. The following works as suggested in
http://www.cmake.org/pipermail/cmake/2009-May/029425.html

set(newPath "${Boost_LIBRARY_DIRS};$ENV{PATH}")
string(REPLACE ";" "\\;" newPath "${newPath}")
set_tests_properties(${mod_name} PROPERTIES ENVIRONMENT 
"PATH=${newPath}")


-Original Message-
From: Massaro Alessio 
Sent: 03 February 2012 10:28
To: 'Michael Hertling'; cmake@cmake.org
Subject: RE: [CMake] runtime dependencies for tests

Thanks to everyone for the feedback!

The following does not work, afaics

add_test(NAME ${mod_name} COMMAND ${mod_name}) set_tests_properties(${mod_name} 
PROPERTIES ENVIRONMENT "PATH=${Boost_LIBRARY_DIRS};$ENV{PATH}")

Am I doing something stupid?



-Original Message-
From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of 
Michael Hertling
Sent: 01 February 2012 02:20
To: cmake@cmake.org
Subject: Re: [CMake] runtime dependencies for tests

On 01/31/2012 02:43 PM, Massaro Alessio wrote:
> Hi There
> 
> I googled near and far, but could not find a way to tell CTest where to find 
> the 3rd-party DLLs required to run the test executables.
> In particular my executable targets link with a few Boost DLLs/SOs and 
> obviously require them to run.
> 
> I understand on the Linux/Solaris I can use RPATH support in CMake.
> But I can't find a way to do it on my primary target platform, WIN32-msvc9.
> 
> I've already tried several variants of calling configure_file in a function 
> the following way:
> 
>configure_file("${some_dbg_boost_dll_file}" 
> "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}" COPYONLY)
> 
> I'm open to all sorts of solutions: copy DLLs in place, set the PATH 
> environment variable, ... anything!
> 
> I just need a pointer to show me some way to do it.
> 
> Thank you in advance!

IMO, the easiest approach is to use the ENVIRONMENT test property to tweak the 
PATH environment variable for the tests, e.g. by appending/ prepending 
${Boost_LIBRARY_DIRS} etc. A more radical but cumbersome approach is to use the 
BundleUtilities to perform a completed test installation - preferably beneath 
the build tree - and run the tests therein. Finally, you might copy the 
required libraries to the build tree by a custom target or custom commands, or 
by a test on its own in conjunction with the DEPENDS test property, but that's 
even more cumbersome.

Regards,

Michael
--

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


Re: [CMake] runtime dependencies for tests

2012-02-03 Thread Massaro Alessio
Thanks to everyone for the feedback!

The following does not work, afaics

add_test(NAME ${mod_name} COMMAND ${mod_name})
set_tests_properties(${mod_name} PROPERTIES ENVIRONMENT 
"PATH=${Boost_LIBRARY_DIRS};$ENV{PATH}")

Am I doing something stupid?



-Original Message-
From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of 
Michael Hertling
Sent: 01 February 2012 02:20
To: cmake@cmake.org
Subject: Re: [CMake] runtime dependencies for tests

On 01/31/2012 02:43 PM, Massaro Alessio wrote:
> Hi There
> 
> I googled near and far, but could not find a way to tell CTest where to find 
> the 3rd-party DLLs required to run the test executables.
> In particular my executable targets link with a few Boost DLLs/SOs and 
> obviously require them to run.
> 
> I understand on the Linux/Solaris I can use RPATH support in CMake.
> But I can't find a way to do it on my primary target platform, WIN32-msvc9.
> 
> I've already tried several variants of calling configure_file in a function 
> the following way:
> 
>configure_file("${some_dbg_boost_dll_file}" 
> "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}" COPYONLY)
> 
> I'm open to all sorts of solutions: copy DLLs in place, set the PATH 
> environment variable, ... anything!
> 
> I just need a pointer to show me some way to do it.
> 
> Thank you in advance!

IMO, the easiest approach is to use the ENVIRONMENT test property to tweak the 
PATH environment variable for the tests, e.g. by appending/ prepending 
${Boost_LIBRARY_DIRS} etc. A more radical but cumbersome approach is to use the 
BundleUtilities to perform a completed test installation - preferably beneath 
the build tree - and run the tests therein. Finally, you might copy the 
required libraries to the build tree by a custom target or custom commands, or 
by a test on its own in conjunction with the DEPENDS test property, but that's 
even more cumbersome.

Regards,

Michael
--

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


Re: [CMake] runtime dependencies for tests

2012-01-31 Thread Michael Hertling
On 01/31/2012 02:43 PM, Massaro Alessio wrote:
> Hi There
> 
> I googled near and far, but could not find a way to tell CTest where to find 
> the 3rd-party DLLs required to run the test executables.
> In particular my executable targets link with a few Boost DLLs/SOs and 
> obviously require them to run.
> 
> I understand on the Linux/Solaris I can use RPATH support in CMake.
> But I can't find a way to do it on my primary target platform, WIN32-msvc9.
> 
> I've already tried several variants of calling configure_file in a function 
> the following way:
> 
>configure_file("${some_dbg_boost_dll_file}" 
> "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}" COPYONLY)
> 
> I'm open to all sorts of solutions: copy DLLs in place, set the PATH 
> environment variable, ... anything!
> 
> I just need a pointer to show me some way to do it.
> 
> Thank you in advance!

IMO, the easiest approach is to use the ENVIRONMENT test property to
tweak the PATH environment variable for the tests, e.g. by appending/
prepending ${Boost_LIBRARY_DIRS} etc. A more radical but cumbersome
approach is to use the BundleUtilities to perform a completed test
installation - preferably beneath the build tree - and run the tests
therein. Finally, you might copy the required libraries to the build
tree by a custom target or custom commands, or by a test on its own
in conjunction with the DEPENDS test property, but that's even more
cumbersome.

Regards,

Michael
--

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] runtime dependencies for tests

2012-01-31 Thread Jean-Christophe Fillion-Robin
Hi Alessio,

You could either use a "forwarded" launcher is it's done in paraview.
See 
Applications/ParaView/CMakeLists.txt,
CMake/pv-forward.c.in,
add_executable_with_forwarding

Or you could also use the CTKAppLauncher. See
http://www.commontk.org/index.php/Tools:_Application_launcher.

See also how the CTK app launcher is integrated in Slicer:
https://github.com/Slicer/Slicer/blob/master/Applications/SlicerQT/CMakeLists.txt#L206

Hth
Jc

On Tue, Jan 31, 2012 at 8:43 AM, Massaro Alessio <
alessio.mass...@mediobanca.co.uk> wrote:

> Hi There
>
> I googled near and far, but could not find a way to tell CTest where to
> find the 3rd-party DLLs required to run the test executables.
> In particular my executable targets link with a few Boost DLLs/SOs and
> obviously require them to run.
>
> I understand on the Linux/Solaris I can use RPATH support in CMake.
> But I can't find a way to do it on my primary target platform, WIN32-msvc9.
>
> I've already tried several variants of calling configure_file in a
> function the following way:
>
>   configure_file("${some_dbg_boost_dll_file}"
> "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}" COPYONLY)
>
> I'm open to all sorts of solutions: copy DLLs in place, set the PATH
> environment variable, ... anything!
>
> I just need a pointer to show me some way to do it.
>
> Thank you in advance!
> --
>
> 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
>



-- 
+1 919 869 8849
--

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] runtime dependencies for tests

2012-01-31 Thread Massaro Alessio
Hi There

I googled near and far, but could not find a way to tell CTest where to find 
the 3rd-party DLLs required to run the test executables.
In particular my executable targets link with a few Boost DLLs/SOs and 
obviously require them to run.

I understand on the Linux/Solaris I can use RPATH support in CMake.
But I can't find a way to do it on my primary target platform, WIN32-msvc9.

I've already tried several variants of calling configure_file in a function the 
following way:

   configure_file("${some_dbg_boost_dll_file}" 
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}" COPYONLY)

I'm open to all sorts of solutions: copy DLLs in place, set the PATH 
environment variable, ... anything!

I just need a pointer to show me some way to do it.

Thank you in advance!
--

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