From ca5d28d12711531211ca6e0e5ff723445ebded09 Mon Sep 17 00:00:00 2001 From: Andrey Morozov Date: Fri, 16 Dec 2011 07:14:55 +0000 Subject: [PATCH] added experimental feature for parallel build solution under Windows --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index cc54d1000f..97171f1254 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,6 +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} ") + endif() + if(NOT BUILD_WITH_DEBUG_INFO) string(REPLACE "/debug" "" CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}") string(REPLACE "/DEBUG" "" CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")