On 14. Nov, 2009, at 24:55 , Michael Jackson wrote:

Does anyone have any CMake code to find the designated temp folder location for each platform? Was thinking this might be in CMake somewhere but I did not seem to find anything.

Thanks


I think on WIN32 its TEMP and TMP and on all UNIX I kno of its TMPDIR.

So in a first, naive attempt I would do:

if(WIN32)
  set(TMPDIR "$ENV{TEMP}")
else()
  set(TMPDIR "$ENV{TMPDIR}")
endif()

if(NOT EXISTS "${TMPDIR}")
  message(FATAL_ERROR "OOOPS, can't determine temporary directory")
endif()

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

Reply via email to