I managed to build the library using refactored CMake, however it outputs a lot of warnings:
Scanning dependencies of target curlcpp
[ 7%] Building CXX object src/CMakeFiles/curlcpp.dir/curl_easy.cpp.obj
In file included from curlcpp/include/curl_easy.h:35,
from curlcpp\src\curl_easy.cpp:6:
curlcpp/include/curl_pair.h: In member function 'const curl_httppost* curl::curl_pair<T, curl::curl_form>::second() const':
curlcpp/include/curl_pair.h:156:27: warning: invalid use of incomplete type 'const class curl::curl_form'
156 | return (this->value).get();
| ~~~~~~~^~~~~~
In file included from curlcpp/include/curl_easy.h:35,
from curlcpp\src\curl_easy.cpp:6:
curlcpp/include/curl_pair.h:35:11: note: forward declaration of 'class curl::curl_form'
35 | class curl_form;
| ^~~~~~~~~
In file included from curlcpp/include/curl_easy.h:35,
from curlcpp\src\curl_easy.cpp:6:
curlcpp/include/curl_pair.h: In member function 'const curl_slist* curl::curl_pair<T, curl::curl_header>::second() const':
curlcpp/include/curl_pair.h:187:27: warning: invalid use of incomplete type 'const class curl::curl_header'
187 | return (this->value).get();
| ~~~~~~~^~~~~~
In file included from curlcpp/include/curl_easy.h:35,
from curlcpp\src\curl_easy.cpp:6:
curlcpp/include/curl_pair.h:36:11: note: forward declaration of 'class curl::curl_header'
36 | class curl_header;
| ^~~~~~~~~~~
[ 14%] Building CXX object src/CMakeFiles/curlcpp.dir/curl_header.cpp.obj
In file included from curlcpp\src\curl_header.cpp:6:
curlcpp/include/curl_header.h: In copy constructor 'curl::curl_header::curl_header(const curl::curl_header&)':
curlcpp/include/curl_header.h:83:28: warning: 'curl::curl_header::headers' will be initialized after [-Wreorder]
83 | struct curl_slist *headers;
| ^~~~~~~
curlcpp/include/curl_header.h:82:13: warning: 'int curl::curl_header::size' [-Wreorder]
82 | int size;
| ^~~~
curlcpp/include/curl_header.h:92:12: warning: when initialized here [-Wreorder]
92 | inline curl_header::curl_header(const curl_header &header) : headers(nullptr), size(0) {
| ^~~~~~~~~~~
[ 21%] Building CXX object src/CMakeFiles/curlcpp.dir/curl_global.cpp.obj
[ 28%] Building CXX object src/CMakeFiles/curlcpp.dir/curl_form.cpp.obj
In file included from curlcpp/include/curl_form.h:35,
from curlcpp\src\curl_form.cpp:7:
curlcpp/include/curl_pair.h: In member function 'const curl_httppost* curl::curl_pair<T, curl::curl_form>::second() const':
curlcpp/include/curl_pair.h:156:27: warning: invalid use of incomplete type 'const class curl::curl_form'
156 | return (this->value).get();
| ~~~~~~~^~~~~~
In file included from curlcpp/include/curl_form.h:35,
from curlcpp\src\curl_form.cpp:7:
curlcpp/include/curl_pair.h:35:11: note: forward declaration of 'class curl::curl_form'
35 | class curl_form;
| ^~~~~~~~~
In file included from curlcpp/include/curl_form.h:35,
from curlcpp\src\curl_form.cpp:7:
curlcpp/include/curl_pair.h: In member function 'const curl_slist* curl::curl_pair<T, curl::curl_header>::second() const':
curlcpp/include/curl_pair.h:187:27: warning: invalid use of incomplete type 'const class curl::curl_header'
187 | return (this->value).get();
| ~~~~~~~^~~~~~
In file included from curlcpp/include/curl_form.h:35,
from curlcpp\src\curl_form.cpp:7:
curlcpp/include/curl_pair.h:36:11: note: forward declaration of 'class curl::curl_header'
36 | class curl_header;
| ^~~~~~~~~~~
[ 35%] Building CXX object src/CMakeFiles/curlcpp.dir/curl_multi.cpp.obj
In file included from curlcpp/include/curl_easy.h:35,
from curlcpp/include/curl_multi.h:33,
from curlcpp\src\curl_multi.cpp:6:
curlcpp/include/curl_pair.h: In member function 'const curl_httppost* curl::curl_pair<T, curl::curl_form>::second() const':
curlcpp/include/curl_pair.h:156:27: warning: invalid use of incomplete type 'const class curl::curl_form'
156 | return (this->value).get();
| ~~~~~~~^~~~~~
In file included from curlcpp/include/curl_easy.h:35,
from curlcpp/include/curl_multi.h:33,
from curlcpp\src\curl_multi.cpp:6:
curlcpp/include/curl_pair.h:35:11: note: forward declaration of 'class curl::curl_form'
35 | class curl_form;
| ^~~~~~~~~
In file included from curlcpp/include/curl_easy.h:35,
from curlcpp/include/curl_multi.h:33,
from curlcpp\src\curl_multi.cpp:6:
curlcpp/include/curl_pair.h: In member function 'const curl_slist* curl::curl_pair<T, curl::curl_header>::second() const':
curlcpp/include/curl_pair.h:187:27: warning: invalid use of incomplete type 'const class curl::curl_header'
187 | return (this->value).get();
| ~~~~~~~^~~~~~
In file included from curlcpp/include/curl_easy.h:35,
from curlcpp/include/curl_multi.h:33,
from curlcpp\src\curl_multi.cpp:6:
curlcpp/include/curl_pair.h:36:11: note: forward declaration of 'class curl::curl_header'
36 | class curl_header;
| ^~~~~~~~~~~
In file included from curlcpp\src\curl_multi.cpp:6:
curlcpp/include/curl_multi.h: In constructor 'curl::curl_multi::curl_multi(curl::curl_multi&&)':
curlcpp/include/curl_multi.h:332:19: warning: 'curl::curl_multi::curl' will be initialized after [-Wreorder]
332 | multi_ptr curl;
| ^~~~
curlcpp/include/curl_multi.h:331:13: warning: 'int curl::curl_multi::active_transfers' [-Wreorder]
331 | int active_transfers;
| ^~~~~~~~~~~~~~~~
curlcpp\src\curl_multi.cpp:30:1: warning: when initialized here [-Wreorder]
30 | curl_multi::curl_multi(curl_multi&& other) NOEXCEPT
| ^~~~~~~~~~
In file included from curlcpp\src\curl_multi.cpp:6:
curlcpp/include/curl_multi.h:331:13: warning: 'curl::curl_multi::active_transfers' will be initialized after [-Wreorder]
331 | int active_transfers;
| ^~~~~~~~~~~~~~~~
curlcpp/include/curl_multi.h:330:13: warning: 'int curl::curl_multi::message_queued' [-Wreorder]
330 | int message_queued;
| ^~~~~~~~~~~~~~
curlcpp\src\curl_multi.cpp:30:1: warning: when initialized here [-Wreorder]
30 | curl_multi::curl_multi(curl_multi&& other) NOEXCEPT
| ^~~~~~~~~~
[ 42%] Building CXX object src/CMakeFiles/curlcpp.dir/curl_share.cpp.obj
In file included from curlcpp/include/curl_share.h:30,
from curlcpp\src\curl_share.cpp:6:
curlcpp/include/curl_pair.h: In member function 'const curl_httppost* curl::curl_pair<T, curl::curl_form>::second() const':
curlcpp/include/curl_pair.h:156:27: warning: invalid use of incomplete type 'const class curl::curl_form'
156 | return (this->value).get();
| ~~~~~~~^~~~~~
In file included from curlcpp/include/curl_share.h:30,
from curlcpp\src\curl_share.cpp:6:
curlcpp/include/curl_pair.h:35:11: note: forward declaration of 'class curl::curl_form'
35 | class curl_form;
| ^~~~~~~~~
In file included from curlcpp/include/curl_share.h:30,
from curlcpp\src\curl_share.cpp:6:
curlcpp/include/curl_pair.h: In member function 'const curl_slist* curl::curl_pair<T, curl::curl_header>::second() const':
curlcpp/include/curl_pair.h:187:27: warning: invalid use of incomplete type 'const class curl::curl_header'
187 | return (this->value).get();
| ~~~~~~~^~~~~~
In file included from curlcpp/include/curl_share.h:30,
from curlcpp\src\curl_share.cpp:6:
curlcpp/include/curl_pair.h:36:11: note: forward declaration of 'class curl::curl_header'
36 | class curl_header;
| ^~~~~~~~~~~
[ 50%] Building CXX object src/CMakeFiles/curlcpp.dir/curl_info.cpp.obj
[ 57%] Building CXX object src/CMakeFiles/curlcpp.dir/curl_cookie.cpp.obj
In file included from curlcpp/include/curl_easy.h:35,
from curlcpp/include/curl_cookie.h:33,
from curlcpp\src\curl_cookie.cpp:8:
curlcpp/include/curl_pair.h: In member function 'const curl_httppost* curl::curl_pair<T, curl::curl_form>::second() const':
curlcpp/include/curl_pair.h:156:27: warning: invalid use of incomplete type 'const class curl::curl_form'
156 | return (this->value).get();
| ~~~~~~~^~~~~~
In file included from curlcpp/include/curl_easy.h:35,
from curlcpp/include/curl_cookie.h:33,
from curlcpp\src\curl_cookie.cpp:8:
curlcpp/include/curl_pair.h:35:11: note: forward declaration of 'class curl::curl_form'
35 | class curl_form;
| ^~~~~~~~~
In file included from curlcpp/include/curl_easy.h:35,
from curlcpp/include/curl_cookie.h:33,
from curlcpp\src\curl_cookie.cpp:8:
curlcpp/include/curl_pair.h: In member function 'const curl_slist* curl::curl_pair<T, curl::curl_header>::second() const':
curlcpp/include/curl_pair.h:187:27: warning: invalid use of incomplete type 'const class curl::curl_header'
187 | return (this->value).get();
| ~~~~~~~^~~~~~
In file included from curlcpp/include/curl_easy.h:35,
from curlcpp/include/curl_cookie.h:33,
from curlcpp\src\curl_cookie.cpp:8:
curlcpp/include/curl_pair.h:36:11: note: forward declaration of 'class curl::curl_header'
36 | class curl_header;
| ^~~~~~~~~~~
In file included from curlcpp/include/cookie_datetime.h:30,
from curlcpp/include/cookie.h:32,
from curlcpp/include/curl_cookie.h:34,
from curlcpp\src\curl_cookie.cpp:8:
curlcpp/include/cookie_time.h: At global scope:
curlcpp/include/cookie_time.h:64:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
64 | const unsigned int get_hour() const NOEXCEPT;
| ^~~~~
curlcpp/include/cookie_time.h:68:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
68 | const unsigned int get_minutes() const NOEXCEPT;
| ^~~~~
curlcpp/include/cookie_time.h:72:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
72 | const unsigned int get_seconds() const NOEXCEPT;
| ^~~~~
[ 64%] Building CXX object src/CMakeFiles/curlcpp.dir/curl_exception.cpp.obj
[ 71%] Building CXX object src/CMakeFiles/curlcpp.dir/cookie.cpp.obj
In file included from curlcpp/include/cookie_datetime.h:30,
from curlcpp/include/cookie.h:32,
from curlcpp\src\cookie.cpp:6:
curlcpp/include/cookie_time.h:64:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
64 | const unsigned int get_hour() const NOEXCEPT;
| ^~~~~
curlcpp/include/cookie_time.h:68:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
68 | const unsigned int get_minutes() const NOEXCEPT;
| ^~~~~
curlcpp/include/cookie_time.h:72:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
72 | const unsigned int get_seconds() const NOEXCEPT;
| ^~~~~
[ 78%] Building CXX object src/CMakeFiles/curlcpp.dir/cookie_date.cpp.obj
[ 85%] Building CXX object src/CMakeFiles/curlcpp.dir/cookie_time.cpp.obj
In file included from curlcpp\src\cookie_time.cpp:6:
curlcpp/include/cookie_time.h:64:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
64 | const unsigned int get_hour() const NOEXCEPT;
| ^~~~~
curlcpp/include/cookie_time.h:68:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
68 | const unsigned int get_minutes() const NOEXCEPT;
| ^~~~~
curlcpp/include/cookie_time.h:72:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
72 | const unsigned int get_seconds() const NOEXCEPT;
| ^~~~~
curlcpp\src\cookie_time.cpp:36:1: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
36 | const unsigned int curl::cookie_time::get_hour() const NOEXCEPT {
| ^~~~~
curlcpp\src\cookie_time.cpp:41:1: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
41 | const unsigned int curl::cookie_time::get_minutes() const NOEXCEPT {
| ^~~~~
curlcpp\src\cookie_time.cpp:46:1: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
46 | const unsigned int curl::cookie_time::get_seconds() const NOEXCEPT {
| ^~~~~
[ 92%] Building CXX object src/CMakeFiles/curlcpp.dir/cookie_datetime.cpp.obj
In file included from curlcpp/include/cookie_datetime.h:30,
from curlcpp\src\cookie_datetime.cpp:6:
curlcpp/include/cookie_time.h:64:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
64 | const unsigned int get_hour() const NOEXCEPT;
| ^~~~~
curlcpp/include/cookie_time.h:68:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
68 | const unsigned int get_minutes() const NOEXCEPT;
| ^~~~~
curlcpp/include/cookie_time.h:72:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
72 | const unsigned int get_seconds() const NOEXCEPT;
| ^~~~~
[100%] Linking CXX static library libcurlcpp.a
[100%] Built target curlcpp
I managed to build the library using refactored CMake, however it outputs a lot of warnings: