[CMake] adding external project

Owen Hogarth II gurenchan at gmail.com
Tue Dec 15 03:01:22 EST 2015


I have been reading this:
https://cmake.org/cmake/help/v3.0/module/ExternalProject.html

trying to add sdl external project but I am  having issues. I created a new
cmake project to test.

I already downloaded the sdl library and can build it correctly by manually
calling cmake commands but this is how I'd like to distribute sdl w/ my
library.

here's my new test cmake:

cmake_minimum_required(VERSION2.8)
project(sdl_external)

include(ExternalProject)

ExternalProject_Add(sdl
    HG_REPOSITORY clone http://hg.libsdl.org/SDL
    # PREFIX ${CMAKE_SOURCE_DIR}/sdl

    # SOURCE_DIR ${CMAKE_SOURCE_DIR}/sdl

    # INSTALL_COMMAND cmake ../ PREFIX=${CMAKE_CURRENT_BINARY_DIR}
    )

I get this build output:
cmake ../
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Hg: /usr/bin/hg (found version "3.1.2")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/blubee/sdk/test/build
Scanning dependencies of target sdl
[ 12%] Creating directories for 'sdl'
[ 25%] Performing download step (hg clone) for 'sdl'
-- Avoiding repeated hg clone, stamp file is up to date:
'/home/blubee/sdk/_b/build/test/
build/sdl-prefix/src/sdl-stamp/sdl-hginfo.txt'
[ 37%] No patch step for 'sdl'
[ 50%] Performing update step (hg pull) for 'sdl'
abort: no repository found in
' /home/blubee/sdk/test/build/sdl-prefix/src/sdl' (
.hg not found)!
CMakeFiles/sdl.dir/build.make:89: recipe for target
'sdl-prefix/src/sdl-stamp/sdl-update'
 failed
make[2]: *** [sdl-prefix/src/sdl-stamp/sdl-update] Error 255
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/sdl.dir/all' failed
make[1]: *** [CMakeFiles/sdl.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2

my external build file isn't very verbose but I don't get the error

why is it reporting that no repository found.
abort: no repository found in
'/home/blubee/sdk/test/build/sdl-prefix/src/sdl' (
.hg not found)!

Why isn't the mercurial project not being downloaded?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20151215/b9d7a1d5/attachment.html>


More information about the CMake mailing list