Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMake ExternalProject_Add Git

I have a git-bare-repository on my desktop and I would like to clone it with CMake. My repository has this path C:\Users\demoUser\Desktop\learnGIT\prog. My CMakeLists.txt looks like this:

cmake_minimum_required(VERSION 2.8)
project(Demo)
include(ExternalProject)

ExternalProject_Add(demo
  GIT_REPOSITORY C:/Users/demoUser/Desktop/learnGIT/prog
  GIT_TAG master
  UPDATE_COMMAND ""
  INSTALL_COMMAND ""
)

but in the generated folder prog-build is just wast. The generated folder structure doesn't include any of my files from the repository.

Does somebody has an idea?

like image 711
user3841904 Avatar asked Feb 03 '15 19:02

user3841904


1 Answers

  1. You have to have a target in your project that depends on external project

    add_dependencies(TargetName ExternalProjectName)
    
  2. The git clone happens on TargetName build (not on CMake reload)

like image 180
Oleg Avatar answered Sep 25 '22 18:09

Oleg