diff options
author | David Cole <david.cole@kitware.com> | 2011-10-25 19:34:23 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2011-10-25 19:34:23 (GMT) |
commit | 4701843974ef7404212f9a057cba4961076b07c8 (patch) | |
tree | 2cef0f6b5e7d016c20b2782013e0d37ebc253a00 /Modules | |
parent | 61b49402d789f5465a7cdc08e708d4448f3496c3 (diff) | |
parent | 66bd543b9b0b09d38697f2c321dda7e4aeb6916d (diff) | |
download | CMake-4701843974ef7404212f9a057cba4961076b07c8.zip CMake-4701843974ef7404212f9a057cba4961076b07c8.tar.gz CMake-4701843974ef7404212f9a057cba4961076b07c8.tar.bz2 |
Merge topic 'SourceGroupsForEclipse'
66bd543 Eclipse: fix #12417, don't create wrong src pathentries
70de8bd Eclipse: detect number of CPUs, set CMAKE_ECLIPSE_MAKE_ARGUMENTS accordigly
117f2b8 Eclipse: add Build and Clean targets to targets
c3f30bd Eclipse: move code for generating links to targets into separate function
cef6bd9 Eclipse: move code for generating links to projects into separate function
b6d4de7 Eclipse: add virtual folder for each target
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeFindEclipseCDT4.cmake | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Modules/CMakeFindEclipseCDT4.cmake b/Modules/CMakeFindEclipseCDT4.cmake index cf0984e..f7a6e29 100644 --- a/Modules/CMakeFindEclipseCDT4.cmake +++ b/Modules/CMakeFindEclipseCDT4.cmake @@ -54,8 +54,20 @@ ENDFUNCTION() _FIND_ECLIPSE_VERSION() +# Try to find out how many CPUs we have and set the -j argument for make accordingly +SET(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "") + +INCLUDE(ProcessorCount) +PROCESSORCOUNT(_CMAKE_ECLIPSE_PROCESSOR_COUNT) + +# Only set -j if we are under UNIX and if the make-tool used actually has "make" in the name +# (we may also get here in the future e.g. for ninja) +IF("${_CMAKE_ECLIPSE_PROCESSOR_COUNT}" GREATER 1 AND UNIX AND "${CMAKE_MAKE_PROGRAM}" MATCHES make) + SET(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "-j${_CMAKE_ECLIPSE_PROCESSOR_COUNT}") +ENDIF() + # This variable is used by the Eclipse generator and appended to the make invocation commands. -SET(CMAKE_ECLIPSE_MAKE_ARGUMENTS "" CACHE STRING "Additional command line arguments when Eclipse invokes make. Enter e.g. -j<some_number> to get parallel builds") +SET(CMAKE_ECLIPSE_MAKE_ARGUMENTS "${_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS}" CACHE STRING "Additional command line arguments when Eclipse invokes make. Enter e.g. -j<some_number> to get parallel builds") # This variable is used by the Eclipse generator in out-of-source builds only. SET(ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT FALSE CACHE BOOL "If enabled, CMake will generate a source project for Eclipse in CMAKE_SOURCE_DIR") |