From 230c8972f7edf1664a8de87a47bf3b5ccfe1fe5e Mon Sep 17 00:00:00 2001 From: Brad King Date: Sat, 1 Mar 2008 09:08:34 -0500 Subject: [PATCH] BUG: Do not place $(CMAKE_COMMAND) in link scripts. --- Modules/Platform/Windows-cl.cmake | 8 ++++---- Source/cmLocalGenerator.cxx | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake index 1751fb142..63f113e15 100644 --- a/Modules/Platform/Windows-cl.cmake +++ b/Modules/Platform/Windows-cl.cmake @@ -172,14 +172,14 @@ ENDIF(CMAKE_FORCE_WIN64) # default to Debug builds IF(MSVC_VERSION GREATER 1310) # for 2005 make sure the manifest is put in the dll with mt - SET(CMAKE_CXX_CREATE_SHARED_LIBRARY "$(CMAKE_COMMAND) -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_LIBRARY}") - SET(CMAKE_CXX_CREATE_SHARED_MODULE "$(CMAKE_COMMAND) -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_MODULE}") + SET(CMAKE_CXX_CREATE_SHARED_LIBRARY " -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_LIBRARY}") + SET(CMAKE_CXX_CREATE_SHARED_MODULE " -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_MODULE}") # create a C shared library SET(CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY}") # create a C shared module just copy the shared library rule SET(CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE}") - SET(CMAKE_CXX_LINK_EXECUTABLE "$(CMAKE_COMMAND) -E vs_link_exe ${CMAKE_CXX_LINK_EXECUTABLE}") - SET(CMAKE_C_LINK_EXECUTABLE "$(CMAKE_COMMAND) -E vs_link_exe ${CMAKE_C_LINK_EXECUTABLE}") + SET(CMAKE_CXX_LINK_EXECUTABLE " -E vs_link_exe ${CMAKE_CXX_LINK_EXECUTABLE}") + SET(CMAKE_C_LINK_EXECUTABLE " -E vs_link_exe ${CMAKE_C_LINK_EXECUTABLE}") SET(CMAKE_BUILD_TYPE_INIT Debug) SET (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR") diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index abf4a303f..5fca1f392 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -938,6 +938,12 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable, return replaceValues.LinkLibraries; } } + if(variable == "CMAKE_COMMAND") + { + const char* cmcommand = + this->GlobalGenerator->GetCMakeInstance()->GetCMakeCommand(); + return this->Convert(cmcommand, FULL, SHELL); + } std::vector enabledLanguages; this->GlobalGenerator->GetEnabledLanguages(enabledLanguages); // loop over language specific replace variables