From 209aaac95c11454fc72d22851baada67eea73c9f Mon Sep 17 00:00:00 2001 From: Andrey Morozov Date: Mon, 19 Dec 2011 13:20:34 +0000 Subject: [PATCH] fixed parallel build under Windows --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97171f1254..f61f8082fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,11 +198,13 @@ if(MSVC) endforeach(flag_var) endif(BUILD_WITH_STATIC_CRT) - include(ProcessorCount) - ProcessorCount(N) - if(NOT N EQUAL 0) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP${N} ") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP${N} ") + if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8 AND NOT ${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} LESS 8.6) + include(ProcessorCount) + ProcessorCount(N) + if(NOT N EQUAL 0) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP${N} ") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP${N} ") + endif() endif() if(NOT BUILD_WITH_DEBUG_INFO)