Hi guys, I am using Rational Purify for runtime error checks in C++. To use it, you have to call purify instead of the C++ linker at link phase. To do so, I have the following cmake file:
//------------ project(myproject ) option (USE_PURIFY "Use Rational Purify for runtime error checks" OFF) IF (USE_PURIFY) set(CMAKE_CXX_LINK_EXECUTABLE "purify ${CMAKE_CXX_LINK_EXECUTABLE}") ENDIF (USE_PURIFY) add_executable (myproject HelloWorld.cc) //------------ This adds the option and changes the linker (prepending with "purify"). This works fine. Now I would like to trigger the IF() line from a make target. Say, when I type "make myproject_purify", I would like to set the option (or prepend the linker, whichever is best). I am quite uncertain how to do it with cmake. I did not find any hint if I can set options from cmake itself or not. Also, whenever I define a new make target, I have to supply a shell command and it seems I cannot execute cmake commands there. So my question: how would you set an option via a make target? Any hints? Thanks, Mc -- 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