curl-library
Some fixes for cmake build.
Date: Mon, 29 Mar 2010 00:12:18 +0400
Hello all,
Recently I tried to build the latest stable version of curl
(7.20.0) with using cmake. To my surprise, the build on windows
succeeded without any issues. Then I tried the cmake build on
OpenSolaris, and the build failed.
After some investigation I discovered the following:
1. CMake build uses 'curlbuild.h' file that comes with the
distribution. This means that, in essence, curl build is just the
same as non-configure builds.
2. Tests that CMake does are not used afterwards; curlbuild.h that
CMake generates is not included. Besides, the generated
curlbuild.h file contains incorrect definitions (format strings
not enclosed in double quotes, etc).
So I fixed the cmake build so that it generates a correct curlbuild.h.
I also had to fix "curl/curl.h" file, because its original way of
including "curlbuild.h" does not work with out-of-source build
which is used by cmake.
So now the modified version builds nicely on the following OSes:
- Windows32 (MS Visual Studio 2005 and 2008)
- Ubuntu linux (gcc 4.2)
- Slackware 12
- OpenSolaris (SunStudio 12)
- FreeBSD 7.0
The patch is attached (I hope git will have no problems applying it:).
Note that there are still some issues with the cmake build system:
- Although in-source builds (as 'configure' does) are still allowed,
the curlbuild.h file that comes with the distro is not replaced with
a cmake-configured one. Perhaps we should issue a warning (or even
an error) when a user tries to build curl with cmake in-source.
- Before defining any of the CURL_PULL_* variables, cmake build should
do more tests. I have done the checks in a very striaghtforward way:
basically, if the headers were found during checks, the
corresponding CURL_PULL_*_H variable gets defined.
-- Best regards, Tetetest mailto:tetetest_at_rambler.ru
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
- application/octet-stream attachment: cmakebuild.patch