[CMake] [CTest] DLLs, scripts, and build types

Werner Smekal smekal at iap.tuwien.ac.at
Sun Mar 1 17:11:29 EST 2009


Hello too,

We use something like

if(BUILD_SHARED_LIBS AND WIN32 AND NOT CYGWIN)
  SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dll)
endif(BUILD_SHARED_LIBS AND WIN32 AND NOT CYGWIN)

so that all DLLs end up in one directory (since we build many of them, 
otherwise they would be scattered around the whole build directory). As 
you write in (3) I start cmd.exe and run a script which sets the PATH. 
Then I run ctest or executables which find the dll without problems. 
There is also a variable like

EXECUTABLE_OUTPUT_PATH

so that all executables are built into this directory. This may help for 
(4).

HTH,
Werner

Gregory Sharp wrote:
> Hello,  I ran into a problem with getting the CTest to run when 
> linking with a DLL.
>
> 1) My program links with ITK, and I build this as a DLL on windows.
>
> 2) During testing, my program needs to find the ITK dll.  I do not
> wish to add to the global path.
>
> 3) My understanding is that the workaround for (2) is to create a 
> script which sets the path.  So I make a CMake script.  CTest launches
> the CMake script, which sets the path, and runs my executable.
>
> 4) However, my CMake script needs to know the name of the executable.
> The executable can be in Release, or Debug, or whatever.  
> Now I'm stuck, because I can't figure out how CMake can find the 
> right directory.  There is a similar issue for finding the ITK dll, 
> which can be in release or debug subdirectory.
>
> I appreciate any advice.  Maybe there is a simple way?
>
> Thank you,
>   


-- 
Dr. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria
DVR-Nr: 0005886

email: smekal at iap.tuwien.ac.at
web:   http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office)
       +43-(0)1-58801-13469 (laboratory)
fax:   +43-(0)1-58801-13499



More information about the CMake mailing list