From: Chernyshev V. <ast...@ro...> - 2012-09-12 23:24:07
|
Hello. After various unsuccessful attempts to compile log4cplus on OS X from provided autotools-generated configure file using Clang compiler I've decided to try CMake build. And it turned out that some configure defines are simply missing. Here are the fixes that I've made. All paths are relative to project's root directory. 1. ./CMakeLists.txt https://gist.github.com/3710553 - added WITH_ICONV option that sets LOG4CPLUS_WITH_ICONV, the same is done when --with-iconv option is provided to configure system. 2. ./ConfigureChecks.cmake https://gist.github.com/3710633 - added very simple check to find system-provided iconv library, it may be required to use iconv* functions on some systems; - added checks for functions mbstowcs, wcstombs, nanosleep; - added check for __func__ symbol; - iconv* functions will now be checked only when LOG4CPLUS_WITH_ICONV is defined, it mimics behaviour of autotools build system; - added proper checks for DECLSPEC_EXPORT/IMPORT/PRIVATE, taken from autotools files; - added thread-local support detection; - added C++11 atomics detection. 3. ./src/CMakeLists.txt https://gist.github.com/3710658 - link iconv library if it is required to use iconv* functions and iconv support was requested. 4. ./include/log4cplus/config/defines.hxx.cmake.in https://gist.github.com/3710667 - added missing defines to make it on par with defines.hxx.in. There are additional things to tweak in CMake files, but it can be discussed later. |