[CMake] RUN_TESTS which use dlls not in the executable direct ory

Iain Hull Iain.Hull at cr2.com
Thu Mar 15 11:35:32 EST 2007


I am not currently using Ctest, but for using running applications in vs7:
You should ensure that the directories you requires in the path are in the
list in
	tools->options->projects->VC++Directories->Executable Files.

I hope this helps.

Iain.

-----Original Message-----
From: Darby J Van Uitert [mailto:darbyb at sci.utah.edu] 
Sent: 15 March 2007 01:49
To: cmake at cmake.org
Subject: [CMake] RUN_TESTS which use dlls not in the executable directory

Hi,

My tests for my project need to load dlls which are not in the executable
directory, but in the system path. I'm using Visual Studio 7. 
I can run ctest from the command line but not using the RUN_TEST target in
Visual Studio. I found the following email from 2005 and was wondering how
people are dealing with this and if there is a work around? Thanks.

   -darby j

>/ 2. Does CTest use the PATH environment variable when launching the
executable ? It seems not since my program is not able to load some dlls
(not in the executable dir but in the system path) when run from the
run_test target, but work when run from the command line ! What's the
problem here ?
/
The PATH environment variable is used, but the behavior you are seeing is
actually due to a Visual Studio "feature".  When VS launches processes to
build its targets it does so in its own environment.  This environment
contains a PATH that includes the VS compiler directories and such.  It also
includes the system PATH that was in place WHEN VS WAS INSTALLED.  For some
reason it does not update this PATH each time it runs.  This is why it works
when you run ctest from the command line but not from the RUN_TESTS target.


--
Darby J Van Uitert
SCI Institute
University of Utah
Email: darbyb at sci.utah.edu
Phone: (301) 528-8469


_______________________________________________
CMake mailing list
CMake at cmake.org
http://www.cmake.org/mailman/listinfo/cmake

CR2


More information about the CMake mailing list