2013-05-31 21:26:08 +00:00
|
|
|
# This program source code file is part of KICAD, a free EDA CAD application.
|
|
|
|
#
|
|
|
|
# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
|
|
|
# Copyright (C) 2013 Kicad Developers, see AUTHORS.txt for contributors.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, you may find one here:
|
|
|
|
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
# or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
# or you may write to the Free Software Foundation, Inc.,
|
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
|
|
|
|
|
2013-05-31 04:46:02 +00:00
|
|
|
|
2013-08-20 18:03:21 +00:00
|
|
|
# Download a particular boost version, and patch it [and build it if BUILD_GITHUB_PLUGIN].
|
|
|
|
# Assumes include( ExternalProject ) was done inline previous to this file
|
|
|
|
# and that set( DOWNLOAD_DIR ... ) was set in a higher context.
|
|
|
|
|
|
|
|
|
|
|
|
#-----<configure>----------------------------------------------------------------
|
2013-05-31 04:46:02 +00:00
|
|
|
|
2013-09-21 07:30:23 +00:00
|
|
|
set( BOOST_RELEASE 1.54.0 )
|
|
|
|
set( BOOST_MD5 15cb8c0803064faef0c4ddf5bc5ca279 ) # re-calc this on every RELEASE change
|
2013-08-20 18:03:21 +00:00
|
|
|
|
|
|
|
# The boost headers [and static libs if built] go here, at the top of KiCad
|
|
|
|
# source tree in boost_root.
|
|
|
|
set( BOOST_ROOT "${PROJECT_SOURCE_DIR}/boost_root" )
|
|
|
|
|
|
|
|
|
2013-11-11 00:47:54 +00:00
|
|
|
# Space separated list which indicates the subset of boost libraries to compile.
|
|
|
|
# Chosen libraries are based on AVHTTP requirements, and possibly
|
|
|
|
# unit_test_framework for its own worth.
|
2013-12-29 22:05:06 +00:00
|
|
|
# tool_manager.cpp -> coroutine -> context (_jump_fcontext) (on OSX)
|
|
|
|
|
2013-11-11 00:47:54 +00:00
|
|
|
set( BOOST_LIBS_BUILT
|
2013-12-30 17:53:12 +00:00
|
|
|
context
|
2013-11-11 00:47:54 +00:00
|
|
|
#coroutine
|
|
|
|
date_time
|
|
|
|
#exception
|
|
|
|
filesystem
|
|
|
|
iostreams
|
|
|
|
locale
|
|
|
|
program_options
|
|
|
|
regex
|
|
|
|
#signals
|
|
|
|
system
|
|
|
|
thread
|
|
|
|
#unit_test_framework
|
|
|
|
)
|
2013-08-20 18:03:21 +00:00
|
|
|
#-----</configure>---------------------------------------------------------------
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
if( NOT BZIP2_FOUND )
|
|
|
|
find_package( BZip2 REQUIRED )
|
|
|
|
endif()
|
2013-05-31 21:22:34 +00:00
|
|
|
|
|
|
|
string( REGEX REPLACE "\\." "_" BOOST_VERS "${BOOST_RELEASE}" )
|
2013-05-31 04:46:02 +00:00
|
|
|
set( PREFIX ${DOWNLOAD_DIR}/boost_${BOOST_VERS} )
|
|
|
|
|
2013-06-01 04:04:56 +00:00
|
|
|
# <SOURCE_DIR> = ${PREFIX}/src/boost
|
|
|
|
# There is a Bazaar 'boost scratch repo' in <SOURCE_DIR>/boost and after committing pristine
|
|
|
|
# download, the patch is applied. This lets you regenerate a new patch at any time
|
|
|
|
# easily, simply by editing the working tree in <SOURCE_DIR> and doing "bzr diff" in there.
|
|
|
|
|
2013-08-20 18:03:21 +00:00
|
|
|
# path to the boost headers in the repo.
|
|
|
|
# repo = "${headers_src}/../.bzr" = "<SOURCE_DIR>/.bzr"
|
|
|
|
set( headers_src "${PREFIX}/src/boost/boost" )
|
2013-06-01 04:04:56 +00:00
|
|
|
|
2013-05-31 04:46:02 +00:00
|
|
|
|
2013-08-26 20:19:04 +00:00
|
|
|
function( set_boost_lib_names libs output )
|
|
|
|
foreach( lib ${libs} )
|
2013-09-21 19:20:31 +00:00
|
|
|
set( fullpath_lib "${BOOST_ROOT}/lib/libboost_${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}" )
|
|
|
|
list( APPEND results ${fullpath_lib} )
|
2013-08-20 18:03:21 +00:00
|
|
|
endforeach()
|
2013-09-21 19:20:31 +00:00
|
|
|
# set the results into variable represented by output into caller's scope
|
|
|
|
set( ${output} ${results} PARENT_SCOPE )
|
2013-08-20 18:03:21 +00:00
|
|
|
endfunction()
|
2013-05-31 04:46:02 +00:00
|
|
|
|
|
|
|
|
2013-11-11 00:47:54 +00:00
|
|
|
# (BTW "test" yields "unit_test_framework" when passed to bootstrap.sh ).
|
|
|
|
#message( STATUS "BOOST_LIBS_BUILT:${BOOST_LIBS_BUILT}" )
|
|
|
|
string( REPLACE "unit_test_framework" "test" boost_libs_list "${BOOST_LIBS_BUILT}" )
|
|
|
|
#message( STATUS "REPLACE libs_csv:${boost_libs_list}" )
|
2013-08-20 18:03:21 +00:00
|
|
|
|
2013-12-22 19:52:52 +00:00
|
|
|
# Default Toolset
|
|
|
|
set( BOOST_TOOLSET "toolset=gcc" )
|
|
|
|
|
2014-01-26 13:09:36 +00:00
|
|
|
if( KICAD_BUILD_STATIC OR APPLE )
|
2013-12-30 17:53:12 +00:00
|
|
|
set( BOOST_LINKTYPE "link=static" )
|
2013-12-30 15:53:09 +00:00
|
|
|
else()
|
2013-12-30 17:53:12 +00:00
|
|
|
unset( BOOST_LINKTYPE )
|
2013-12-30 15:53:09 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2014-04-03 11:55:02 +00:00
|
|
|
find_program(patch_bin NAMES patch patch.exe)
|
|
|
|
|
|
|
|
if( "${patch_bin}" STREQUAL "patch_bin-NOTFOUND" )
|
|
|
|
set( PATCH_STR_CMD ${PATCH_STR_CMD} )
|
|
|
|
else()
|
|
|
|
set( PATCH_STR_CMD ${patch_bin} -p0 -i )
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
if( MINGW AND NOT CMAKE_HOST_UNIX ) # building for MINGW on windows not UNIX
|
2013-11-11 00:47:54 +00:00
|
|
|
if( MSYS )
|
|
|
|
# The Boost system does not build properly on MSYS using bootstrap.sh. Running
|
|
|
|
# bootstrap.bat with cmd.exe does. It's ugly but it works. At least for Boost
|
|
|
|
# version 1.54.
|
|
|
|
set( bootstrap cmd.exe /c "bootstrap.bat mingw" )
|
2013-08-20 18:03:21 +00:00
|
|
|
else()
|
2013-11-11 00:47:54 +00:00
|
|
|
set( bootstrap ./bootstrap.bat mingw )
|
2013-10-07 19:49:44 +00:00
|
|
|
endif()
|
|
|
|
|
2013-11-11 00:47:54 +00:00
|
|
|
foreach( lib ${boost_libs_list} )
|
|
|
|
set( b2_libs ${b2_libs} --with-${lib} )
|
|
|
|
endforeach()
|
2013-12-29 19:36:30 +00:00
|
|
|
unset( BOOST_CFLAGS )
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
|
2013-11-11 00:47:54 +00:00
|
|
|
else()
|
|
|
|
string( REGEX REPLACE "\\;" "," libs_csv "${boost_libs_list}" )
|
|
|
|
#message( STATUS "libs_csv:${libs_csv}" )
|
|
|
|
|
|
|
|
set( bootstrap ./bootstrap.sh --with-libraries=${libs_csv} )
|
|
|
|
# pass to *both* C and C++ compilers
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
set( BOOST_CFLAGS "cflags=${PIC_FLAG}" )
|
|
|
|
set( BOOST_CXXFLAGS "cxxflags=${PIC_FLAG}" )
|
|
|
|
set( BOOST_INCLUDE "${BOOST_ROOT}/include" )
|
2013-11-11 00:47:54 +00:00
|
|
|
unset( b2_libs )
|
|
|
|
endif()
|
2013-10-13 21:33:58 +00:00
|
|
|
|
2013-12-30 17:53:12 +00:00
|
|
|
|
2013-12-22 14:55:05 +00:00
|
|
|
if( APPLE )
|
2014-11-28 17:34:00 +00:00
|
|
|
set( BOOST_CXXFLAGS "cxxflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -fno-common" )
|
|
|
|
set( BOOST_LINKFLAGS "linkflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -fno-common" )
|
2013-12-30 17:53:12 +00:00
|
|
|
set( BOOST_TOOLSET "toolset=darwin" )
|
|
|
|
|
2013-12-30 15:53:09 +00:00
|
|
|
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
|
|
|
set(BOOST_CXXFLAGS "${BOOST_CXXFLAGS} -fno-lto" )
|
|
|
|
set(BOOST_LINKFLAGS "${BOOST_LINKFLAGS} -fno-lto" )
|
|
|
|
endif()
|
2013-12-22 14:55:05 +00:00
|
|
|
|
|
|
|
if( CMAKE_OSX_ARCHITECTURES )
|
|
|
|
|
|
|
|
if( (CMAKE_OSX_ARCHITECTURES MATCHES "386" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc ") AND
|
|
|
|
(CMAKE_OSX_ARCHITECTURES MATCHES "64"))
|
2013-12-30 17:53:12 +00:00
|
|
|
message( "-- BOOST found 32/64 Address Model" )
|
2013-12-22 14:55:05 +00:00
|
|
|
|
2013-12-30 17:53:12 +00:00
|
|
|
set( BOOST_ADDRESSMODEL "address-model=32_64" )
|
2013-12-22 14:55:05 +00:00
|
|
|
endif()
|
|
|
|
|
2013-12-24 18:16:56 +00:00
|
|
|
if( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") AND
|
|
|
|
(CMAKE_OSX_ARCHITECTURES MATCHES "ppc"))
|
2013-12-30 15:53:09 +00:00
|
|
|
message("-- BOOST found ppc/x86 Architecture")
|
2013-12-22 14:55:05 +00:00
|
|
|
|
|
|
|
set(BOOST_ARCHITECTURE "architecture=combined")
|
2013-12-30 15:53:09 +00:00
|
|
|
elseif( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") )
|
|
|
|
message("-- BOOST found x86 Architecture")
|
|
|
|
|
|
|
|
set(BOOST_ARCHITECTURE "architecture=x86")
|
|
|
|
elseif( (CMAKE_OSX_ARCHITECTURES MATCHES "ppc64" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc") )
|
|
|
|
message("-- BOOST found ppc Architecture")
|
|
|
|
|
|
|
|
set(BOOST_ARCHITECTURE "architecture=ppc")
|
2013-12-22 14:55:05 +00:00
|
|
|
endif()
|
|
|
|
|
2013-12-30 17:53:12 +00:00
|
|
|
set( BOOST_CFLAGS "${BOOST_CFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" )
|
|
|
|
set( BOOST_CXXFLAGS "${BOOST_CXXFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" )
|
|
|
|
set( BOOST_LINKFLAGS "${BOOST_LINKFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" )
|
2013-12-22 14:55:05 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2013-11-11 00:47:54 +00:00
|
|
|
ExternalProject_Add( boost
|
|
|
|
PREFIX "${PREFIX}"
|
2014-01-22 13:44:02 +00:00
|
|
|
|
2013-11-11 00:47:54 +00:00
|
|
|
URL http://downloads.sourceforge.net/project/boost/boost/${BOOST_RELEASE}/boost_${BOOST_VERS}.tar.bz2
|
2014-01-22 13:44:02 +00:00
|
|
|
DOWNLOAD_DIR "${DOWNLOAD_DIR}"
|
2014-04-23 13:53:07 +00:00
|
|
|
TIMEOUT 1200 # 20 minutes
|
2013-11-11 00:47:54 +00:00
|
|
|
URL_MD5 ${BOOST_MD5}
|
2014-01-22 13:44:02 +00:00
|
|
|
# If download fails, then enable "LOG_DOWNLOAD ON" and try again.
|
|
|
|
# Upon a second failure with logging enabled, then look at these logs:
|
|
|
|
# <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-out.log
|
|
|
|
# <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-err.log
|
|
|
|
# If out.log does not show 100%, then try increasing TIMEOUT even more, or download the URL manually and put it
|
2014-01-27 06:41:40 +00:00
|
|
|
# into <src>/.downloads-by-cmake/ dir.
|
2014-01-22 13:44:02 +00:00
|
|
|
# LOG_DOWNLOAD ON
|
|
|
|
|
|
|
|
INSTALL_DIR "${BOOST_ROOT}"
|
2013-11-11 00:47:54 +00:00
|
|
|
|
|
|
|
# The patch command executes with the working directory set to <SOURCE_DIR>
|
2013-11-12 12:44:30 +00:00
|
|
|
# Revert the branch to pristine before applying patch sets as bzr patch
|
|
|
|
# fails when applying a patch to the branch twice and doesn't have a switch
|
|
|
|
# to ignore previously applied patches
|
|
|
|
PATCH_COMMAND bzr revert
|
2013-12-31 16:58:05 +00:00
|
|
|
# bzr revert is insufficient to remove "added" files:
|
2014-01-03 23:17:50 +00:00
|
|
|
COMMAND bzr clean-tree -q --force
|
2013-12-31 16:58:05 +00:00
|
|
|
|
2014-04-03 11:55:02 +00:00
|
|
|
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_minkowski.patch"
|
|
|
|
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_cstdint.patch"
|
2013-12-30 17:53:12 +00:00
|
|
|
|
2014-04-03 11:55:02 +00:00
|
|
|
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86.patch" #https://svn.boost.org/trac/boost/ticket/8266
|
2013-12-31 16:58:05 +00:00
|
|
|
# tell bzr about "added" files by last patch:
|
2013-12-30 17:53:12 +00:00
|
|
|
COMMAND bzr add libs/context/src/asm/jump_i386_x86_64_sysv_macho_gas.S
|
|
|
|
COMMAND bzr add libs/context/src/asm/make_i386_x86_64_sysv_macho_gas.S
|
|
|
|
|
2014-04-03 11:55:02 +00:00
|
|
|
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86_build.patch" #https://svn.boost.org/trac/boost/ticket/8266
|
|
|
|
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_older_openssl.patch" #https://svn.boost.org/trac/boost/ticket/9273
|
2013-11-11 00:47:54 +00:00
|
|
|
|
2014-04-03 11:55:02 +00:00
|
|
|
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw.patch" #https://svn.boost.org/trac/boost/ticket/7262
|
2014-08-23 15:22:50 +00:00
|
|
|
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw64_interlocked.patch"
|
|
|
|
|
2013-12-31 16:58:05 +00:00
|
|
|
# tell bzr about "added" files by last patch:
|
2013-12-30 17:53:12 +00:00
|
|
|
COMMAND bzr add libs/context/src/asm/make_i386_ms_pe_gas.S
|
|
|
|
COMMAND bzr add libs/context/src/asm/jump_i386_ms_pe_gas.S
|
|
|
|
COMMAND bzr add libs/context/src/asm/make_x86_64_ms_pe_gas.S
|
|
|
|
COMMAND bzr add libs/context/src/asm/jump_x86_64_ms_pe_gas.S
|
|
|
|
|
2014-04-03 11:55:02 +00:00
|
|
|
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/patch_macosx_context_ppc_v2.patch" #https://svn.boost.org/trac/boost/ticket/8266
|
2014-01-04 02:13:18 +00:00
|
|
|
COMMAND bzr add libs/context/build/Jamfile.v2
|
|
|
|
COMMAND bzr add libs/context/build/architecture.jam
|
|
|
|
COMMAND bzr add libs/context/src/asm/jump_combined_sysv_macho_gas.S
|
|
|
|
COMMAND bzr add libs/context/src/asm/jump_ppc32_sysv_macho_gas.S
|
|
|
|
COMMAND bzr add libs/context/src/asm/jump_ppc64_sysv_macho_gas.S
|
|
|
|
COMMAND bzr add libs/context/src/asm/make_combined_sysv_macho_gas.S
|
|
|
|
COMMAND bzr add libs/context/src/asm/make_ppc32_sysv_macho_gas.S
|
|
|
|
COMMAND bzr add libs/context/src/asm/make_ppc64_sysv_macho_gas.S
|
|
|
|
|
2013-11-11 00:47:54 +00:00
|
|
|
# [Mis-]use this step to erase all the boost headers and libraries before
|
|
|
|
# replacing them below.
|
|
|
|
UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${BOOST_ROOT}"
|
|
|
|
|
|
|
|
BINARY_DIR "${PREFIX}/src/boost/"
|
|
|
|
CONFIGURE_COMMAND ${bootstrap}
|
|
|
|
|
|
|
|
BUILD_COMMAND ./b2
|
|
|
|
variant=release
|
|
|
|
threading=multi
|
2013-12-29 19:36:30 +00:00
|
|
|
${BOOST_CFLAGS}
|
2013-12-22 19:52:52 +00:00
|
|
|
${BOOST_TOOLSET}
|
2013-12-22 19:02:04 +00:00
|
|
|
${BOOST_CXXFLAGS}
|
|
|
|
${BOOST_LINKFLAGS}
|
2013-12-22 14:55:05 +00:00
|
|
|
${BOOST_ADDRESSMODEL}
|
|
|
|
${BOOST_ARCHITECTURE}
|
2013-11-11 00:47:54 +00:00
|
|
|
${b2_libs}
|
2013-12-30 15:53:09 +00:00
|
|
|
${BOOST_LINKTYPE}
|
2013-11-11 00:47:54 +00:00
|
|
|
--prefix=<INSTALL_DIR>
|
|
|
|
install
|
|
|
|
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
2013-10-13 21:33:58 +00:00
|
|
|
|
2013-11-11 00:47:54 +00:00
|
|
|
if( MINGW )
|
|
|
|
execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
|
|
|
OUTPUT_VARIABLE GCC_VERSION
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE )
|
2013-08-20 18:03:21 +00:00
|
|
|
|
2013-11-11 00:47:54 +00:00
|
|
|
string( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.[0-9]+.*" "\\1\\2" BOOST_GCC_VERSION ${GCC_VERSION} )
|
|
|
|
#message( STATUS "BOOST_GCC_VERSION: ${BOOST_GCC_VERSION}" )
|
2013-08-20 18:03:21 +00:00
|
|
|
|
2013-11-11 00:47:54 +00:00
|
|
|
string( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9])" "\\1_\\2" BOOST_LIB_VERSION ${BOOST_RELEASE} )
|
|
|
|
#message( STATUS "BOOST_LIB_VERSION: ${BOOST_LIB_VERSION}" )
|
2013-08-20 18:03:21 +00:00
|
|
|
|
2013-11-11 00:47:54 +00:00
|
|
|
# adjust the names of the libraries to suit the build. There's no
|
|
|
|
# symbolic links provided on the MinGW build to allow us to use
|
|
|
|
# generic names for the libs
|
|
|
|
foreach( lib ${BOOST_LIBS_BUILT} )
|
|
|
|
set( mingw_boost_libs ${mingw_boost_libs} ${lib}-mgw${BOOST_GCC_VERSION}-mt-${BOOST_LIB_VERSION} )
|
|
|
|
endforeach()
|
2013-08-20 18:03:21 +00:00
|
|
|
|
2013-11-11 00:47:54 +00:00
|
|
|
set( BOOST_LIBS_BUILT ${mingw_boost_libs} )
|
|
|
|
set( BOOST_INCLUDE "${BOOST_ROOT}/include/boost-${BOOST_LIB_VERSION}" )
|
|
|
|
unset( mingw_boost_libs )
|
|
|
|
endif()
|
2013-08-20 18:03:21 +00:00
|
|
|
|
2013-11-11 00:47:54 +00:00
|
|
|
set( boost_libs "" )
|
|
|
|
set_boost_lib_names( "${BOOST_LIBS_BUILT}" boost_libs )
|
2013-08-20 18:03:21 +00:00
|
|
|
|
2013-12-30 17:53:12 +00:00
|
|
|
set( Boost_LIBRARIES ${boost_libs} )
|
|
|
|
set( Boost_INCLUDE_DIR "${BOOST_INCLUDE}" )
|
2013-08-20 18:03:21 +00:00
|
|
|
|
2013-11-11 00:47:54 +00:00
|
|
|
mark_as_advanced( Boost_LIBRARIES Boost_INCLUDE_DIR )
|
2013-08-20 18:03:21 +00:00
|
|
|
|
2013-11-11 00:47:54 +00:00
|
|
|
#message( STATUS "BOOST_ROOT:${BOOST_ROOT} BOOST_LIBRARIES:${BOOST_LIBRARIES}" )
|
|
|
|
#message( STATUS "Boost_INCLUDE_DIR: ${Boost_INCLUDE_DIR}" )
|
2013-08-20 18:03:21 +00:00
|
|
|
|
2013-05-31 04:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
ExternalProject_Add_Step( boost bzr_commit_boost
|
|
|
|
COMMAND bzr ci -q -m pristine <SOURCE_DIR>
|
2013-05-31 21:22:34 +00:00
|
|
|
COMMENT "committing pristine boost files to 'boost scratch repo'"
|
2013-05-31 04:46:02 +00:00
|
|
|
DEPENDERS patch
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
ExternalProject_Add_Step( boost bzr_add_boost
|
2013-08-20 18:03:21 +00:00
|
|
|
# add only the headers to the scratch repo, repo = "../.bzr" from ${headers_src}
|
2013-12-29 19:36:30 +00:00
|
|
|
COMMAND bzr add -q ${PREFIX}/src/boost
|
2013-05-31 21:22:34 +00:00
|
|
|
COMMENT "adding pristine boost files to 'boost scratch repo'"
|
2013-05-31 04:46:02 +00:00
|
|
|
DEPENDERS bzr_commit_boost
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
ExternalProject_Add_Step( boost bzr_init_boost
|
|
|
|
COMMAND bzr init -q <SOURCE_DIR>
|
|
|
|
COMMENT "creating 'boost scratch repo' specifically for boost to track boost patches"
|
2013-05-31 21:22:34 +00:00
|
|
|
DEPENDERS bzr_add_boost
|
2013-05-31 04:46:02 +00:00
|
|
|
DEPENDEES download
|
|
|
|
)
|
2013-08-20 18:03:21 +00:00
|
|
|
|