← Back to team overview

kicad-developers team mailing list archive

Re: Boost building as an option

 

On 01/06/2014 06:34 PM, R P Herrold wrote:
On Mon, 6 Jan 2014, Maciej Sumiński wrote:

I can fully understand that it is much easier for many users not to deal with
building boost library, but on the other hand - there are many others who do
not need a separate copy of boost just for KiCad.
  ...
I look forward to your opinions. I tested it with boost 1.54.0-3 (that is the
reason why I put such version as required in CMakeLists.txt) and gcc 4.8.2.

Adding the new option to omit the local boost re-build makes
sense in all cases, as it can be defaulted to retain the
present behaviour during testing.  I have a build cycle of 75
minutes because of the Boost build, after a 'make clean',
rather than the ten or so for kicad otehrwise.

It is another good reason for giving user a choice.

An alternative approach would be do add a make target between
'make clean' and nothing, which only 'cleans' out the
non-Boost parts I suppose

That could help, but only for 'make clean' part. Myself I rarely do it, rather I create new branches or modify CMakeLists.txt that forces KiCad to rebuild boost.

Is this patch as to omiting the local kicad build of boost,
available via a 'git' branch, that I might test it?

I am not sure if it will that way, but you may try to trim the beginning and the end of the patch. If it does not work, the crucial part is:
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2013-12-31 10:42:25 +0000
+++ CMakeLists.txt	2014-01-06 16:25:26 +0000
@@ -44,6 +44,11 @@
     "Builds Kicad and all libraries static (except wx-widgets)"
     )

+option( KICAD_BUILD_BOOST
+ "Downloads and builds necessary boost components (you should enable the switch if your system "
+    "does not contain boost libraries)"
+    )
+
 # when option KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES is enabled:
 # PYTHON_EXECUTABLE can be defined when invoking cmake
 # ( use -DPYTHON_EXECUTABLE=<python path>/python.exe or python2 )
@@ -317,7 +322,17 @@

 # Download boost and possibly build parts of it
 #################################################
-include( download_boost )
+if( KICAD_BUILD_BOOST )
+    include( download_boost )
+else()
+ find_package( Boost 1.54.0 REQUIRED COMPONENTS context date_time filesystem iostreams locale + program_options regex system thread )
+
+    if( NOT Boost_FOUND )
+ message( FATAL_ERROR "Boost 1.54+ libraries are required. You have either to install " + "appropriate packages or build KiCad with KICAD_BUILD_BOOST switch enabled." )
+    endif()
+endif()

 ##########################
 # Find wxWidgets library #

The rest is merely cleaning stuff, it does not influence build time.

Thank you

You are welcome,
Orson

-- Russ herrold




Follow ups

References