externalproject_add没有查找正确的目录?

时间:2017-10-29 11:26:10

标签: cmake portaudio

我出于某种原因遇到了cmake问题,以及外部项目的配置步骤。它以某种方式使用了与我指定的路径不同的路径?

INCLUDE(ExternalProject)
ExternalProject_Add(project_portaudio
    GIT_REPOSITORY      https://git.assembla.com/portaudio.git
    PREFIX              lib/portaudio
    CONFIGURE_COMMAND   ${SOURCE_DIR}/configure
    BUILD_IN_SOURCE     0
    BUILD_COMMAND       make
    INSTALL_COMMAND     sudo make install
)
ExternalProject_Get_Property(project_portaudio BINARY_DIR)
ExternalProject_Get_Property(project_portaudio SOURCE_DIR)

但是当我做到了

make 
[ 11%] Built target record
[ 22%] Built target spectogram
[ 33%] Built target database
[ 44%] Built target match
[ 55%] Built target cmakeDemo
[ 61%] Performing update step for 'project_portaudio'
Current branch master is up to date.
[ 66%] Performing configure step for 'project_portaudio'
/bin/sh: /configure: No such file or directory
make[2]: *** [src/include/record/lib/portaudio/src/project_portaudio-stamp/project_portaudio-configure] Error 127
make[1]: *** [src/include/record/CMakeFiles/project_portaudio.dir/all] Error 2
make: *** [all] Error 2

在这里可以看到..配置步骤应该在$ {SOURCE_DIR}而不是$ {stamp_dir}

怎么回事?

1 个答案:

答案 0 :(得分:1)

您可能希望使用<SOURCE_DIR>代替${SOURCE_DIR}

后者指的是 CMake变量,它很少存在,但前者将扩展到一个目录,分配为 SOURCE 一个用于ExternalProject&#39。s。