[CMake] CMake 2.8.4-rc1 ready for testing!

David Cole david.cole at kitware.com
Fri Jan 14 07:28:47 EST 2011


On Thu, Jan 13, 2011 at 11:33 PM, Pau Garcia i Quiles
<pgquiles at elpauer.org> wrote:
> On Thu, Jan 13, 2011 at 3:15 PM, David Cole <david.cole at kitware.com> wrote:
>> I am happy to announce that CMake 2.8.4 has entered the release
>> candidate stage! You can find the source and binaries here:
>> http://www.cmake.org/files/v2.8/?C=M;O=D
>>
>> Following is the list of changes in this release. Please try this version
>> of CMake on your projects and report any issues to the list or the
>> bug tracker.
>>
>> Happy building!
>>
>> -Dave
>
> A couple of issues I'd noticed:
>
> - On Windows, FindZLIB.cmake is unable to find zlib if you built zlib
> using CMake. Apparently the zlib's CMake buildsystem uses library
> names different from the ones produced by other build methods.
>
> - FindPNG.cmake does not support libpng 1.5
>
> The attached path fixes both issues
>

Looks like a reasonable patch. I'll apply it later today. Thanks!


> One more thing I've noticed is ExternalProject_Add does not honor the
> CMAKE_BUILD_TYPE. For instance, if I have this:
>

It honors it if you pass it down. Same as all other CMake flags at the
top level.


> --8<----------------------------------
> project( winst )
>
> cmake_minimum_required(VERSION 2.8)
>
> include (ExternalProject)
> set(CMAKE_PREFIX_PATH ${PROJECT_SOURCE_DIR} )
>
> #find_package( PNG REQUIRED )
>
> ExternalProject_Add( zlib
>    DOWNLOAD_DIR ${PROJECT_SOURCE_DIR}/downloads
>    URL http://prdownloads.sourceforge.net/libpng/zlib125.zip
>    PATCH_COMMAND ${CMAKE_COMMAND} -E remove zconf.h
>    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${PROJECT_SOURCE_DIR}
> -DCMAKE_PREFIX_PATH:PATH=${PROJECT_SOURCE_DIR}
>    )
> --8<----------------------------------
>
> And I call CMake like "cmake -DCMAKE_BUILD_TYPE=Release", it will
> build zlib in Debug. It's easily fixable by adding
> "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" to the CMAKE_ARGS but I'd say
> it violates the principle of least surprise.
>

But... I'm a Visual Studio / Xcode user. If CMAKE_BUILD_TYPE is
defined, it would surprise *me*. So I don't think you can say it
violates the principle universally for all types of CMake users.

We do not assume any particular set of flags or defined variables to
pass down automatically for you. Since choosing some would surprise
some people, but not others... all variable passing via
ExternalProject_Add is left "up to the user".

In fact, part of the point of ExternalProject is that you can build
the thing you're building however you want *without* necessarily
inheriting the values of all the CMake variables at the top level.


Thanks for the discussion point, (and the patch!)
David


> --
> Pau Garcia i Quiles
> http://www.elpauer.org
> (Due to my workload, I may need 10 days to answer)
>


More information about the CMake mailing list