View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011431CMakeCMakepublic2010-11-10 00:542011-01-31 15:56
ReporterMike McQuaid 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 2.8.3 
Target VersionCMake 2.8.4Fixed in VersionCMake 2.8.4 
Summary0011431: Allow enabling specific system libraries in bootstrap mode
DescriptionI'm packaging CMake for Homebrew and previously we've just manually edited the CMakeLists.txt to disable LibArchive and LibXmlRpc from using the system versions (as they aren't available on a clean OSX installation). It would be great if we could use the system versions for all the other libraries other than these two.

Let me know if a patch would be accepted for this and if I'd be best to modify the CMakeLists.txt to have OSX-specific behaviour or if I should modify the bootstrap file.

Thanks!
TagsNo tags attached.
Attached Filespatch file icon 8dba266a+0001-bootstrap-Granular-system-library-selection-11431.patch [^] (8,716 bytes) 2011-01-10 09:34 [Show Content]

 Relationships

  Notes
(0023120)
Rolf Eike Beer (developer)
2010-11-10 02:26

This shouldn't be a MacOS-specific option. It would also be nice to have this option when packaging for different Linux distros. E.g. openSUSE 11.0 has a perfectly usable zlib and openssl, but no libarchive. Later versions may have fixed that.
(0023126)
David Cole (manager)
2010-11-10 06:00

Why do you need this in bootstrap mode?

Bootstrap to get a working CMake on the system, and then using that, do another build of CMake (non-bootstrap) and set all the USE_SYSTEM_* options accordingly...

Bootstrap should be the simplest bare-bones build you can possibly do in order to have a working CMake. It should not be the equivalent of "building a full CMake using CMake" but from source only...
(0023134)
Mike McQuaid (reporter)
2010-11-10 11:24

Bootstrap mode is needed if you're compiling from source without CMake already installed, fairly typical for a source-based distribution like ours. It's not sensible for us to simply build it twice as that will increase the time taken for our users.

As said, we're already got a naive patch for this which makes it work the way we want it to but I thought it would be good open-source citizenship and easier for both CMake and us to maintain things if this was done properly upstream.

Basically, I just want to be able to set some of the USE_SYSTEM options at initial bootstrap or at add another option to be smart about which ones are already installed on OSX.
(0023136)
David Cole (manager)
2010-11-10 11:27

Please attach your proposed patch and let's see what's involved...

Thanks.
(0023137)
Mike McQuaid (reporter)
2010-11-10 11:32

I'll make a clean one and submit it to you guys in the next few weeks, thanks!
(0023183)
Brad King (manager)
2010-11-11 14:04

FYI, xmlrpc is no longer built inside CMake. It is only useable as a system library, but it isn't really needed for anything except "Dart2" dashboard submissions. Since CDash replaced Dart we don't need it at all.

> I just want to be able to set some of the USE_SYSTEM options at initial bootstrap

You can do this already. Use bootstrap's "--init=" option to specify an initial cache file like one might with cmake's "-C" option:

  $ cat init.cmake
  set(CMAKE_USE_SYSTEM_BZIP2 ON CACHE BOOL "" FORCE)
  set(CMAKE_USE_SYSTEM_CURL ON CACHE BOOL "" FORCE)
  set(CMAKE_USE_SYSTEM_EXPAT ON CACHE BOOL "" FORCE)
  set(CMAKE_USE_SYSTEM_ZLIB ON CACHE BOOL "" FORCE)
  set(CMAKE_USE_SYSTEM_LIBARCHIVE OFF CACHE BOOL "" FORCE)
  $ ../cmake-src/bootstrap --init=init.cmake
(0023191)
Mike McQuaid (reporter)
2010-11-11 21:08

This is great and worked well, thanks. I guess it would be good if the help text for --init was a bit more helpful. Rather than "use FILE for cmake initialization" you could perhaps say "include FILE into bootstrap CMake process" or something.
(0023192)
Mike McQuaid (reporter)
2010-11-11 21:18

Actually, this still doesn't work as well as I'd hoped. It would be nice if I could do this an only specify the libarchive in the cmake file, rather than having to manually enable system dependencies whenever CMake adds new ones.
(0023338)
Brad King (manager)
2010-11-17 10:24

Okay, in that case I'll happily review a proposed patch.

I think the main CMakeLists.txt logic can be taught to interpret CMAKE_USE_SYSTEM_LIBRARIES as either a boolean (as it is now) or as a list. The case of a list should be identified when it starts with "NOT", and the rest of the list is the libraries to *not* take from the system. Then one can add

  -DCMAKE_USE_SYSTEM_LIBRARIES="NOT;LIBARCHIVE"

to enable all system libraries except those in the list.
(0023372)
Mike McQuaid (reporter)
2010-11-18 00:10

Cool, thanks, I'll try and look at a patch for this.
(0024526)
Mike McQuaid (reporter)
2011-01-09 16:40

First attempt pull request here: https://github.com/Kitware/CMake/pull/3 [^]
(0024529)
Brad King (manager)
2011-01-10 09:37

Great, I like the approach. I created patch

  8dba266a+0001-bootstrap-Granular-system-library-selection-11431.patch

based on your starting point. Please test it.

A few comments from your original:

(1) Please base work on 'master'. The 'next' branch is only for integration of topics for testing before merging back to master.

(2) The documentation for the "no-system-*" options switched the name to "system-no-*".

(3) The cmake_bootstrap_system_libs variable was set to at most 1 option at a time. It needs to accumulate them.

(4) The logic in CMakeLists.txt file has some subtleties due to a distinction between local CMake variables and cached values.
(0024634)
Mike McQuaid (reporter)
2011-01-12 16:53

Looks great to me and seems to work well for my use-case. Thanks!
(0024635)
Mike McQuaid (reporter)
2011-01-12 16:54

You can merge this as far as I'm concerned. Let me know when you have so I can have Homebrew download the patch from your git. Thanks!
(0024636)
Brad King (manager)
2011-01-12 17:05

Fixed:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=60d72b56 [^]

Plus a documentation tweak:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bace6500 [^]
(0024637)
Brad King (manager)
2011-01-12 17:06

Thanks for the patch and for testing my version.

 Issue History
Date Modified Username Field Change
2010-11-10 00:54 Mike McQuaid New Issue
2010-11-10 02:26 Rolf Eike Beer Note Added: 0023120
2010-11-10 06:00 David Cole Note Added: 0023126
2010-11-10 11:24 Mike McQuaid Note Added: 0023134
2010-11-10 11:27 David Cole Note Added: 0023136
2010-11-10 11:32 Mike McQuaid Note Added: 0023137
2010-11-11 14:04 Brad King Note Added: 0023183
2010-11-11 21:08 Mike McQuaid Note Added: 0023191
2010-11-11 21:18 Mike McQuaid Note Added: 0023192
2010-11-11 21:31 Mike McQuaid Note Added: 0023193
2010-11-11 21:50 Mike McQuaid Note Added: 0023194
2010-11-11 21:51 Mike McQuaid Note Deleted: 0023194
2010-11-11 21:52 Mike McQuaid Note Deleted: 0023193
2010-11-17 10:20 Brad King Assigned To => Brad King
2010-11-17 10:20 Brad King Status new => assigned
2010-11-17 10:24 Brad King Note Added: 0023338
2010-11-18 00:10 Mike McQuaid Note Added: 0023372
2011-01-09 16:40 Mike McQuaid Note Added: 0024526
2011-01-10 09:34 Brad King File Added: 8dba266a+0001-bootstrap-Granular-system-library-selection-11431.patch
2011-01-10 09:37 Brad King Note Added: 0024529
2011-01-12 16:53 Mike McQuaid Note Added: 0024634
2011-01-12 16:54 Mike McQuaid Note Added: 0024635
2011-01-12 17:05 Brad King Note Added: 0024636
2011-01-12 17:06 Brad King Note Added: 0024637
2011-01-12 17:06 Brad King Status assigned => closed
2011-01-12 17:06 Brad King Resolution open => fixed
2011-01-31 15:56 David Cole Fixed in Version => CMake 2.8.4
2011-01-31 15:56 David Cole Target Version => CMake 2.8.4


Copyright © 2000 - 2018 MantisBT Team