[cmake-developers] [CMake 0013617]: use $(MAKE) -C instead of cd <path> && /usr/bin/gmake
Mantis Bug Tracker
mantis at public.kitware.com
Tue Oct 30 12:11:30 EDT 2012
The following issue has been SUBMITTED.
======================================================================
http://public.kitware.com/Bug/view.php?id=13617
======================================================================
Reported By: Bartłomiej Palmowski
Assigned To:
======================================================================
Project: CMake
Issue ID: 13617
Category: CMake
Reproducibility: N/A
Severity: feature
Priority: normal
Status: new
======================================================================
Date Submitted: 2012-10-30 12:11 EDT
Last Modified: 2012-10-30 12:11 EDT
======================================================================
Summary: use $(MAKE) -C instead of cd <path> &&
/usr/bin/gmake
Description:
Hi,
in case of add_custom_target or add_custom_command if one uses
${CMAKE_MAKE_PROGRAM} like this:
[...]
COMMAND ${CMAKE_MAKE_PROGRAM}
[...]
Unix make generator will translate it as:
cd <path> && /usr/bin/gmake
which kills jobserver, I know that cmake code is agnostic of what is generated,
but it would be nice if actually $(MAKE) -C <path> was generated.
Steps to Reproduce:
[palmowsk at suzuki bug]$ cat CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(feature_request)
add_custom_target(run_make
COMMAND ${CMAKE_MAKE_PROGRAM} -f ${PROJECT_SOURCE_DIR}/test.mk
)
[palmowsk at suzuki bug]$ cat test.mk
.PHONY: all
all: a b c
.DEFAULT:
echo $@
sleep 5
[palmowsk at suzuki bug]$ mkdir build
[palmowsk at suzuki bug]$ cd build/
[palmowsk at suzuki build]$ cmake ..
-- The C compiler identification is GNU 4.4.6
-- The CXX compiler identification is GNU 4.4.6
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/palmowsk/bug/build
[palmowsk at suzuki build]$ make run_make
Scanning dependencies of target run_make
a
b
c
Built target run_make
[palmowsk at suzuki build]$ make run_make -j3 # jobserver isn't going to work
gmake[4]: warning: jobserver unavailable: using -j1. Add `+' to parent make
rule.
a
b
c
Built target run_make
[palmowsk at suzuki build]$
Additional Information:
cmake version 2.8.8
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2012-10-30 12:11 Bartłomiej PalmowskiNew Issue
======================================================================
More information about the cmake-developers
mailing list