Open laoshanxi opened 2 months ago
This change works with with cmake_minimum_required(VERSION 3.5)
and -DCMAKE_POSITION_INDEPENDENT_CODE=ON
for libcurl
[root@51dba5857ef0 b]# cmake -DOPENSSL_ROOT_DIR=/usr/local/ssl ..
-- curlpp version=[0.8.1]
-- curlpp version num=[000801]
-- Looking for CURL
-- Found CURL version:
-- Using CURL include dir(s):
-- Using CURL lib(s):
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/curlpp/b
[root@51dba5857ef0 b]# make
Consolidate compiler generated dependencies of target curlpp
[ 4%] Linking CXX shared library libcurlpp.so
[ 50%] Built target curlpp
[ 54%] Building CXX object CMakeFiles/curlpp_static.dir/src/curlpp/Easy.cpp.o
[ 58%] Building CXX object CMakeFiles/curlpp_static.dir/src/curlpp/Exception.cpp.o
[ 62%] Building CXX object CMakeFiles/curlpp_static.dir/src/curlpp/Form.cpp.o
[ 66%] Building CXX object CMakeFiles/curlpp_static.dir/src/curlpp/Multi.cpp.o
[ 70%] Building CXX object CMakeFiles/curlpp_static.dir/src/curlpp/OptionBase.cpp.o
[ 75%] Building CXX object CMakeFiles/curlpp_static.dir/src/curlpp/Options.cpp.o
[ 79%] Building CXX object CMakeFiles/curlpp_static.dir/src/curlpp/cURLpp.cpp.o
[ 83%] Building CXX object CMakeFiles/curlpp_static.dir/src/curlpp/internal/CurlHandle.cpp.o
[ 87%] Building CXX object CMakeFiles/curlpp_static.dir/src/curlpp/internal/OptionList.cpp.o
[ 91%] Building CXX object CMakeFiles/curlpp_static.dir/src/curlpp/internal/OptionSetter.cpp.o
[ 95%] Building CXX object CMakeFiles/curlpp_static.dir/src/curlpp/internal/SList.cpp.o
[100%] Linking CXX static library libcurlpp.a
[100%] Built target curlpp_static
[root@51dba5857ef0 b]# git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f550b5..f30ea0b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,3 +1,4 @@
+cmake_minimum_required(VERSION 3.5)
project(curlpp)
The build with static libcurl.a will fail: