I have just upgrade my CMake from version 2.8 to 3.2.
It\'s working like a charm in CMake 2.8 but, after the upgrade, it\'s failing.
I\'m trying to build thi
I was having the same problem building a library in a computer in which CMake had not support to https protocol.
I had to build cmake myself with the option -DCMAKE_USE_OPENSSL=ON as suggested by @dekkard's comment.
I will often just modify the url from https to http.
In my ExternalProject_Add()
, I have use GIT_REPOSITORY
insted of URL
option.
#URL https://github.com/keplerproject/luacov/archive/v0.7.tar.gz
GIT_REPOSITORY https://github.com/keplerproject/luacov.git
And luacov
download and build successfully.
For any https
protocol use DOWNLOAD_COMMAND
option of ExternalProject_Add()
function.
DOWNLOAD_COMMAND wget https://github.com/keplerproject/luacov/archive/v0.7.tar.gz
and its working as expected.
Thanks.
The problem may be that the CURL library shipped with CMake isn't build with SSL support by default. I had to compile cmake with:
./bootstrap --system-curl
make
sudo make install
... and that worked, because my system's curl has SSL support.
Looks like with Cmake 3.2.1 it works as expected.
Here's my sample project/CMakeLists.txt:
PROJECT(TestDownload)
SET(CMAKE_CXX_COMPILER "/path/to/bin/g++")
SET(CMAKE_C_COMPILER "/path/to/bin/gcc")
SET(CMAKE_CXX_FLAGS "")
SET(CMAKE_C_FLAGS "")
cmake_minimum_required(VERSION 3.2)
include(ExternalProject)
ExternalProject_Add(
luacov
URL https://github.com/keplerproject/luacov/archive/v0.7.tar.gz
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/luacov
UPDATE_COMMAND ""
PATCH_COMMAND ""
INSTALL_COMMAND ""
)
And the commands:
$ cd project
$ mkdir build && cd build
$ cmake ..
...
$ make all
Scanning dependencies of target luacov
[ 12%] Creating directories for 'luacov'
[ 25%] Performing download step (download, verify and extract) for 'luacov'
-- downloading...
src='https://github.com/keplerproject/luacov/archive/v0.7.tar.gz'
dst='/tmp/project/build/luacov/v0.7.tar.gz'
timeout='none'
-- [download 7% complete]
-- [download 21% complete]
-- [download 76% complete]
-- [download 100% complete]
-- downloading... done
-- verifying file...
file='/tmp/project/build/luacov/v0.7.tar.gz'
-- verifying file... warning: did not verify file - no URL_HASH specified?
-- extracting...
src='/tmp/project/build/luacov/v0.7.tar.gz'
dst='/tmp/project/build/luacov-prefix/src/luacov'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 37%] No patch step for 'luacov'
[ 50%] No update step for 'luacov'
...
What it worked for me is the following:
Update openssl
sudo apt-get install openssl libssl-dev
Modify bootstrap file to enable CMAKE_USE_OPENSSL. Replace this line by:
cmake_options="-DCMAKE_BOOTSTRAP=1 -DCMAKE_USE_OPENSSL=ON"
Run bootstrap script normally in cmake folder
/@path_to_cmake/bootstrap