Crascit/DownloadProject

Project not being built after download

Closed this issue · 2 comments

I'm trying to automate the download and build of mariadb-connector-c and added this to he CMakeLists.txt where I define my tests (not the one at the root of my project):

download_project(PROJ               mariadb-connector-c
                 GIT_REPOSITORY     https://github.com/MariaDB/mariadb-connector-c
                 GIT_TAG            master
                 ${UPDATE_DISCONNECTED_IF_AVAILABLE}
)
add_subdirectory(${mariadb-connector-c_SOURCE_DIR} ${mariadb-connector-c_BINARY_DIR})

While the source code is downloaded, the result of running CMake on the connector is stored in the -download folder and the product is not built or configured, I need to run cmake manually again.

Is there a way to go around this?

I can't see anything obviously wrong with the small piece of code you pasted. You would need to provide more information (i.e. a small test case that reproduces the problem) before any further advice could be provided for what might be going wrong in your project.

Very simply this in a CMakeLists.txt file. I ended up fixing it my manually running CMake:

download_project(
  PROJ				mariadb-connector-c
  GIT_REPOSITORY	https://github.com/MariaDB/mariadb-connector-c.git
  GIT_TAG			master
  ${UPDATE_DISCONNECTED_IF_AVAILABLE}
)
execute_process(COMMAND ${CMAKE_COMMAND} -G Ninja WORKING_DIRECTORY ${mariadb-connector-c_SOURCE_DIR}/../mariadb-connector-c-src)
execute_process(COMMAND ninja WORKING_DIRECTORY ${mariadb-connector-c_SOURCE_DIR}/../mariadb-connector-c-src)
include_directories(${mariadb-connector-c_SOURCE_DIR}/include/)

I'm going to close this issue as I've fixed my problem.