diff --git a/cmake/Config.cmake b/cmake/Config.cmake index b96e85ac..1d716d73 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -27,14 +27,11 @@ if(CMAKE_COMPILER_IS_GNUCXX) execute_process(COMMAND "${CMAKE_CXX_COMPILER}" "-dumpversion" OUTPUT_VARIABLE GCC_VERSION_OUTPUT) string(REGEX REPLACE "([0-9]+\\.[0-9]+).*" "\\1" GCC_VERSION "${GCC_VERSION_OUTPUT}") elseif(MSVC_VERSION EQUAL 1400) - set(COMPILER_MSVC 1) - set(MSVC_VERSION 2005) + set(COMPILER_MSVC 2005) elseif(MSVC_VERSION EQUAL 1500) - set(COMPILER_MSVC 1) - set(MSVC_VERSION 2008) + set(COMPILER_MSVC 2008) elseif(MSVC_VERSION EQUAL 1600) - set(COMPILER_MSVC 1) - set(MSVC_VERSION 2010) + set(COMPILER_MSVC 2010) else() message(WARNING "Unsupported compiler") return() diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake index 84ebe965..ba61e24c 100644 --- a/cmake/Macros.cmake +++ b/cmake/Macros.cmake @@ -33,8 +33,9 @@ macro(sfml_static_add_libraries target) if(NOT ${lib} MATCHES ".*\\.lib") set(lib ${lib}.lib) endif() - if(CMAKE_CONFIGURATION_TYPES) # this condition is true when generator is "Visual Studio solution" - # we add " so that the path will be put inside "", making possible to have spaces in it + if(MSVC_IDE AND COMPILER_MSVC LESS 2010) + # for Visual Studio projects < 2010, we must add double quotes + # around paths because they may contain spaces set(LIBRARIES "${LIBRARIES} "\\;${lib}"\\;") else() set(LIBRARIES "${LIBRARIES} ${lib}")