CMake在ubuntu 16.04 docker image prepending上自动生成Makefile//&引用;对目标

CMake在ubuntu 16.04 docker image prepending上自动生成Makefile//&引用;对目标,makefile,docker,cmake,Makefile,Docker,Cmake,我创建了一个docker映像,如下所示: FROM ubuntu:latest MAINTAINER xyz COPY apt.conf /etc/apt/ RUN apt-get -y update RUN apt-get -y install cmake RUN apt-get -y install libc++-dev RUN apt-get -y install build-essential RUN apt-get -y install beignet opencl-headers

我创建了一个docker映像,如下所示:

FROM ubuntu:latest
MAINTAINER xyz
COPY apt.conf /etc/apt/
RUN apt-get -y update 
RUN apt-get -y  install cmake
RUN apt-get -y install libc++-dev
RUN apt-get -y install build-essential
RUN apt-get -y install beignet opencl-headers
RUN apt-get -y install mlocate
RUN updatedb
RUN mkdir /usr/local/code
COPY code /usr/local/code
RUN mkdir /usr/local/build
RUN cmake /usr/local/code/
CMD make
CMake自动生成的Makefile具有以下all目标:

全部: $(MAKE)-f CMakeFiles/Makefile2//all

为什么CMake要先添加这个额外的“/”

运行make失败,因为它找不到与目标//all关联的规则

make[1]: *** No rule to make target '//all'.  Stop.
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

使用Ubuntu(不带“/”)在另一台机器上自动生成的相同Makefile工作正常。请告知。

CMakeLists.txt,请。使用WORKDIR命令从源代码构建时,此功能正常。请使用WORKDIR命令从源代码构建时,此功能正常。