[CMake] changing Visual Studio project environment setting with CMake

Neuhaus Jochen j.neuhaus at dkfz-heidelberg.de
Fri Apr 3 06:04:28 EDT 2009


Hi,

in Visual Studio, you can add custom environment variables that will
exist if you run your application from visual studio. They are at
[execuatable project]-->Properties-->Configuration
Properties-->Debugging-->Environment
My project needs to have a debug version of ITKCommon.dll in its PATH
when running in Debug mode and a Release version of the DLL in Release
mode respectively. 
Setting the project environment setting to
"PATH=%ITK_DIR%\bin\$(OutType);%PATH%" allows me to automatically use
the correct path, as is suggested in the VTK FAQ
(<http://vtkedge.org/Wiki/VTK_FAQ#Shared_builds_of_VTK_and_debugging_QVT
KWidget_using_Visual_Studio>).

But how can I add this setting with CMake?

I tried the following without success:

ADD_EXECUTABLE(MyExecutable ${MAIN_APP_CPP})
IF(WIN32)
   SET_TARGET_PROPERTIES(MainApp PROPERTIES ENVIRONMENT_DEBUG 
 
"PATH=${ITK_DIR}/bin/$(OutDir);${VTK_DIR}/bin/$(OutDir);${QT_DIR}/bin;%P
ATH%")
   SET_TARGET_PROPERTIES(MainApp PROPERTIES ENVIRONMENT_RELEASE   
 
"PATH=${ITK_DIR}/bin/$(OutDir);${VTK_DIR}/bin/$(OutDir);${QT_DIR}/bin;%P
ATH%")
ENDIF(WIN32)


Any hints? 

Jochen Neuhaus

---
MSc. Jochen Neuhaus
DKFZ
German Cancer Research Center (Deutsches Krebsforschungszentrum) 
Member of the Helmholtz Association
Division Medical and Biological Informatics E130
Im Neuenheimer Feld 280
D-69120 Heidelberg
Phone: 49-(0)6221-42-2329
Fax: 49-(0)6221-42-2345
E-Mail: j.neuhaus at dkfz-heidelberg.de
Web: http://www.dkfz-heidelberg.de/en/mbi/people/Jochen_Neuhaus.html

Confidentiality Note: This message is intended only for the use of the
named recipient(s) and may obtain confidential and/or privileged
information. If you are not the intended recipient, please contact the
sender and delete the message. Any unauthorized use of the information
contained in this message is prohibited.




More information about the CMake mailing list