[CMake] add_test and locating dependent DLL's on Windows

Werner Smekal smekal at iap.tuwien.ac.at
Thu May 14 07:01:48 EDT 2009


Hi Scott,
>
>> There is actually a possibility to tell Visual C++ directly where the
>> DLL is located (by changing the PATH variable for one configuration
>> inside VS), but I don't remember right now how and I'm just on the
>> wrong OS right now to have a look.
>>
>
> Obviously I want to avoid having the developer manually editing the  
> project that cmake has produced, so if such a feature exists, I'd  
> like to track down how to make cmake spit it out for me.

Just for the records: Start Visual C++ and right click on the Project,  
then choose Properties. Go to Configuration Properties->Debugging. In  
the Textbox "Environment" enter something like:

PATH=%PATH%;$(SolutionDir)\dll

So this would be independent of the system as long cmake takes care  
that all dlls are in this directory (and could be different for  
different configurations (debug/release)). So the only problem left is  
add this information to the project file, after cmake configuration  
stage - maybe cmake does that already? Alternatively, since the  
project file is a text file, you could just make these changes save it  
and find out what the differences between the the new file and the  
configured project file is. And add this differences after the cmake  
configuration stage to the project file with some clever script?

HTH,
Werner

>
> Once again, thanks for the quick response!
> -scott
>
> -- 
> Scott C. Gray
> Chief Technologist
> ANTs Software, Inc.
> Inventa Technologies, Inc.
> (W) 856-914-5212
> (C) 609-304-3429
>

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

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