[CMake] does cmake scripts execute sequentially?

Carlton Banks noflaco at gmail.com
Sat Oct 28 19:36:53 EDT 2017


I seem to have some problems executing one of my submodules cmakelist. 

MESSAGE(“In record CMAKELIST”)

# Include externalproject {portaudio} if lib/portaudio don't exist.
MESSAGE(“Download external project”) 

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     1
    BUILD_COMMAND       make
    INSTALL_COMMAND     sudo make install
)
ExternalProject_Get_Property(project_portaudio BINARY_DIR)
ExternalProject_Get_Property(project_portaudio SOURCE_DIR)

SET(portaudio_lib_dir "${BINARY_DIR}/lib/.libs")
SET(portaudio_inc_dir "${SOURCE_DIR}/include")

add_library(record STATIC record.cpp record.h)
add_library(libaudio libportaudio.a PATHS ${portaudio_lib_dir})



#
# this makes sure we have compiler flags that allow class::class() = default (>= C++11)
target_compile_features(record PUBLIC cxx_defaulted_functions)




target_include_directories(record PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${project_portaudio})


It cannot find libportaudio.a as externalproject_add() is not being executed, the command it executes add_library, which fails as the project has not been downloaded…


what is wrong here?


More information about the CMake mailing list