Commit 0be39929 authored by Dick Hollenbeck's avatar Dick Hollenbeck

Lay basis for a more full featured usage of boost, including compiled...

Lay basis for a more full featured usage of boost, including compiled libraries such as unit_test_framework, system, etc.  Move headers now into boost_root/include/boost/.
parent e04860d6
include/boost boost_root
.downloads-by-cmake .downloads-by-cmake
common/netlist_keywords.* common/netlist_keywords.*
common/netlist_lexer.h common/netlist_lexer.h
......
...@@ -2,7 +2,6 @@ add_definitions(-DPCBNEW) ...@@ -2,7 +2,6 @@ add_definitions(-DPCBNEW)
include_directories(BEFORE ${INC_BEFORE}) include_directories(BEFORE ${INC_BEFORE})
include_directories( include_directories(
${Boost_INCLUDE_DIR}
../pcbnew ../pcbnew
../polygon ../polygon
${INC_AFTER} ${INC_AFTER}
......
This diff is collapsed.
...@@ -81,4 +81,8 @@ ...@@ -81,4 +81,8 @@
/// Definition to compile with Pcbnew footprint library table implementation. /// Definition to compile with Pcbnew footprint library table implementation.
#cmakedefine USE_FP_LIB_TABLE #cmakedefine USE_FP_LIB_TABLE
/// When defined, build the GITHUB_PLUGIN for pcbnew.
#cmakedefine BUILD_GITHUB_PLUGIN
#endif // CONFIG_H_ #endif // CONFIG_H_
...@@ -22,12 +22,39 @@ ...@@ -22,12 +22,39 @@
# Download and patch boost headers to a particular version. # 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. # Assumes include( ExternalProject ) was done inline previous to this file
# and that set( DOWNLOAD_DIR ... ) was set in a higher context.
#-----<configure>----------------------------------------------------------------
set( BOOST_RELEASE 1.53.0 ) set( BOOST_RELEASE 1.53.0 )
set( BOOST_MD5 a00d22605d5dbcfb4c9936a9b35bc4c2 ) # re-calc this on every RELEASE change set( BOOST_MD5 a00d22605d5dbcfb4c9936a9b35bc4c2 ) # re-calc this on every RELEASE change
# 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" )
if( BUILD_GITHUB_PLUGIN )
# Space separated list which indicates the subset of boost libraries to compile.
set( BOOST_LIBS_BUILT
filesystem
system
regex
program_options
date_time
thread
exception
unit_test_framework
)
endif()
#-----</configure>---------------------------------------------------------------
string( REGEX REPLACE "\\." "_" BOOST_VERS "${BOOST_RELEASE}" ) string( REGEX REPLACE "\\." "_" BOOST_VERS "${BOOST_RELEASE}" )
set( PREFIX ${DOWNLOAD_DIR}/boost_${BOOST_VERS} ) set( PREFIX ${DOWNLOAD_DIR}/boost_${BOOST_VERS} )
...@@ -36,27 +63,102 @@ set( PREFIX ${DOWNLOAD_DIR}/boost_${BOOST_VERS} ) ...@@ -36,27 +63,102 @@ set( PREFIX ${DOWNLOAD_DIR}/boost_${BOOST_VERS} )
# download, the patch is applied. This lets you regenerate a new patch at any time # 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. # easily, simply by editing the working tree in <SOURCE_DIR> and doing "bzr diff" in there.
# include only the headers in the repo. # path to the boost headers in the repo.
# repo = "${headers}/../.bzr" = "<SOURCE_DIR>/.bzr" # repo = "${headers_src}/../.bzr" = "<SOURCE_DIR>/.bzr"
set( headers ${PREFIX}/src/boost/boost ) set( headers_src "${PREFIX}/src/boost/boost" )
# don't look at this:
function( set_boost_lib_names libs )
foreach( lib IN LISTS ${libs} )
string( TOUPPER ${lib} LIB )
message( STATUS "LIB:${LIB} lib:${lib}" )
set( Boost_${LIB}_LIBRARY, "${BOOST_ROOT}/lib/libboost_${lib}.a" PARENT_SCOPE )
set( Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${LIB}_LIBRARY} PARENT_SCOPE )
endforeach()
endfunction()
ExternalProject_Add( boost if( BUILD_GITHUB_PLUGIN )
PREFIX ${PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_DIR} message( FATAL_ERROR
"BUILD_GITHUB_PLUGIN not functional. With this commit we get merely a greenfield for better boost usage and building."
)
# (BTW "test" yields "unit_test_framework" when passed to bootstrap.{sh,bat} ).
message( STATUS "BOOST_LIBS_BUILT:${BOOST_LIBS_BUILT}" )
string( REPLACE "unit_test_framework" "test" libs_csv "${BOOST_LIBS_BUILT}" )
message( STATUS "REPLACE libs_csv:${libs_csv}" )
string( REGEX REPLACE "\\;" "," libs_csv "${libs_csv}" )
message( STATUS "libs_csv:${libs_csv}" )
if( MINGW )
set( bootstrap "bootstart.bat mingw" )
else()
set( bootstrap bootstrap.sh )
endif()
ExternalProject_Add( boost
PREFIX "${PREFIX}"
DOWNLOAD_DIR "${DOWNLOAD_DIR}"
URL http://downloads.sourceforge.net/project/boost/boost/${BOOST_RELEASE}/boost_${BOOST_VERS}.tar.bz2 URL http://downloads.sourceforge.net/project/boost/boost/${BOOST_RELEASE}/boost_${BOOST_VERS}.tar.bz2
URL_MD5 ${BOOST_MD5} URL_MD5 ${BOOST_MD5}
# The patch command executes with the working directory set to <SOURCE_DIR> # The patch command executes with the working directory set to <SOURCE_DIR>
PATCH_COMMAND bzr patch -p0 ${PROJECT_SOURCE_DIR}/patches/boost.patch PATCH_COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/boost.patch"
# [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}
--with-libraries=${libs_csv}
BUILD_COMMAND b2
variant=release
threading=multi
toolset=gcc
link=static
--prefix=${BOOST_ROOT}
install
INSTALL_COMMAND ""
)
else( BUILD_GITHUB_PLUGIN )
ExternalProject_Add( boost
PREFIX "${PREFIX}"
DOWNLOAD_DIR "${DOWNLOAD_DIR}"
URL http://downloads.sourceforge.net/project/boost/boost/${BOOST_RELEASE}/boost_${BOOST_VERS}.tar.bz2
URL_MD5 ${BOOST_MD5}
# The patch command executes with the working directory set to <SOURCE_DIR>
PATCH_COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/boost.patch"
# Dick 18-Aug-2013:
# [mis-]use this UPDATE_COMMAND opportunity to remove the old place of boost headers.
# Can eventually remove this step after headers are moved from <kicad_src>/include/boost
# to <kicad_src>/boost_root/include/boost over the next several months.
UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${PROJECT_SOURCE_DIR}/include/boost"
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
# remove then re-copy into the include/boost directory during next two steps: # remove then re-copy into the include/boost directory during next two steps:
BUILD_COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJECT_SOURCE_DIR}/include/boost BUILD_COMMAND ${CMAKE_COMMAND} -E remove_directory ${BOOST_ROOT}
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${headers} ${PROJECT_SOURCE_DIR}/include/boost INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory "${headers_src}" "${BOOST_ROOT}/include/boost"
) )
# Until my find_package() support is done for my boost.
set( Boost_INCLUDE_DIR "${BOOST_ROOT}/include" CACHE FILEPATH "Boost library directory" )
endif( BUILD_GITHUB_PLUGIN )
ExternalProject_Add_Step( boost bzr_commit_boost ExternalProject_Add_Step( boost bzr_commit_boost
COMMAND bzr ci -q -m pristine <SOURCE_DIR> COMMAND bzr ci -q -m pristine <SOURCE_DIR>
...@@ -66,8 +168,8 @@ ExternalProject_Add_Step( boost bzr_commit_boost ...@@ -66,8 +168,8 @@ ExternalProject_Add_Step( boost bzr_commit_boost
ExternalProject_Add_Step( boost bzr_add_boost ExternalProject_Add_Step( boost bzr_add_boost
# add only the headers to the scratch repo, repo = "../.bzr" from ${headers} # add only the headers to the scratch repo, repo = "../.bzr" from ${headers_src}
COMMAND bzr add -q ${headers} COMMAND bzr add -q ${headers_src}
COMMENT "adding pristine boost files to 'boost scratch repo'" COMMENT "adding pristine boost files to 'boost scratch repo'"
DEPENDERS bzr_commit_boost DEPENDERS bzr_commit_boost
) )
...@@ -79,3 +181,4 @@ ExternalProject_Add_Step( boost bzr_init_boost ...@@ -79,3 +181,4 @@ ExternalProject_Add_Step( boost bzr_init_boost
DEPENDERS bzr_add_boost DEPENDERS bzr_add_boost
DEPENDEES download DEPENDEES download
) )
...@@ -3,7 +3,6 @@ include_directories(BEFORE ${INC_BEFORE}) ...@@ -3,7 +3,6 @@ include_directories(BEFORE ${INC_BEFORE})
include_directories( include_directories(
./dialogs ./dialogs
./dialog_about ./dialog_about
${Boost_INCLUDE_DIR}
../3d-viewer ../3d-viewer
../pcbnew ../pcbnew
../polygon ../polygon
......
add_definitions(-DCVPCB) add_definitions( -DCVPCB )
### ###
# Includes # Includes
### ###
include_directories(BEFORE ${INC_BEFORE}) include_directories( BEFORE ${INC_BEFORE} )
include_directories( include_directories(
./dialogs ./dialogs
${Boost_INCLUDE_DIR}
../3d-viewer ../3d-viewer
../pcbnew ../pcbnew
../polygon ../polygon
...@@ -18,14 +17,14 @@ include_directories( ...@@ -18,14 +17,14 @@ include_directories(
### ###
# Sources # Sources
### ###
set(CVPCB_DIALOGS set( CVPCB_DIALOGS
dialogs/dialog_cvpcb_config.cpp dialogs/dialog_cvpcb_config.cpp
dialogs/dialog_cvpcb_config_fbp.cpp dialogs/dialog_cvpcb_config_fbp.cpp
dialogs/dialog_display_options.cpp dialogs/dialog_display_options.cpp
dialogs/dialog_display_options_base.cpp dialogs/dialog_display_options_base.cpp
) )
set(CVPCB_SRCS set( CVPCB_SRCS
../common/base_units.cpp ../common/base_units.cpp
../pcbnew/board_items_to_polygon_shape_transform.cpp ../pcbnew/board_items_to_polygon_shape_transform.cpp
../pcbnew/class_drc_item.cpp ../pcbnew/class_drc_item.cpp
...@@ -46,32 +45,35 @@ set(CVPCB_SRCS ...@@ -46,32 +45,35 @@ set(CVPCB_SRCS
### ###
# Windows resource file # Windows resource file
### ###
if(WIN32) if( WIN32 )
if(MINGW) if( MINGW )
# CVPCB_RESOURCES variable is set by the macro. # CVPCB_RESOURCES variable is set by the macro.
mingw_resource_compiler(cvpcb) mingw_resource_compiler( cvpcb )
else(MINGW) else()
set(CVPCB_RESOURCES cvpcb.rc) set( CVPCB_RESOURCES cvpcb.rc )
endif(MINGW) endif()
endif(WIN32) endif()
### ###
# Apple resource files # Apple resource files
### ###
if(APPLE) if( APPLE )
set(CVPCB_RESOURCES cvpcb.icns cvpcb_doc.icns) set( CVPCB_RESOURCES cvpcb.icns cvpcb_doc.icns )
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/cvpcb.icns"
PROPERTIES MACOSX_PACKAGE_LOCATION Resources) set_source_files_properties( "${CMAKE_CURRENT_SOURCE_DIR}/cvpcb.icns"
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/cvpcb_doc.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources )
PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set(MACOSX_BUNDLE_ICON_FILE cvpcb.icns) set_source_files_properties( "${CMAKE_CURRENT_SOURCE_DIR}/cvpcb_doc.icns"
set(MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-eda.cvpcb) PROPERTIES MACOSX_PACKAGE_LOCATION Resources )
endif(APPLE)
set( MACOSX_BUNDLE_ICON_FILE cvpcb.icns )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-eda.cvpcb )
endif()
### ###
# Create the cvpcb executable # Create the cvpcb executable
### ###
add_executable(cvpcb WIN32 MACOSX_BUNDLE add_executable( cvpcb WIN32 MACOSX_BUNDLE
${CVPCB_SRCS} ${CVPCB_SRCS}
${CVPCB_DIALOGS} ${CVPCB_DIALOGS}
${CVPCB_RESOURCES} ${CVPCB_RESOURCES}
...@@ -80,14 +82,14 @@ add_executable(cvpcb WIN32 MACOSX_BUNDLE ...@@ -80,14 +82,14 @@ add_executable(cvpcb WIN32 MACOSX_BUNDLE
### ###
# Set properties for APPLE on cvpcb target # Set properties for APPLE on cvpcb target
### ###
if(APPLE) if( APPLE )
set_target_properties(cvpcb PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) set_target_properties( cvpcb PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist )
endif(APPLE) endif()
### ###
# Link executable target cvpcb with correct libraries # Link executable target cvpcb with correct libraries
### ###
target_link_libraries(cvpcb target_link_libraries( cvpcb
3d-viewer 3d-viewer
pcbcommon pcbcommon
pcad2kicadpcb pcad2kicadpcb
...@@ -102,6 +104,7 @@ target_link_libraries(cvpcb ...@@ -102,6 +104,7 @@ target_link_libraries(cvpcb
### ###
# Add cvpcb as install target # Add cvpcb as install target
### ###
install(TARGETS cvpcb install( TARGETS cvpcb
DESTINATION ${KICAD_BIN} DESTINATION ${KICAD_BIN}
COMPONENT binary) COMPONENT binary
)
...@@ -6,7 +6,6 @@ include_directories( ...@@ -6,7 +6,6 @@ include_directories(
./dialogs ./dialogs
../common ../common
../common/dialogs ../common/dialogs
${Boost_INCLUDE_DIR}
${INC_AFTER} ${INC_AFTER}
) )
......
...@@ -18,7 +18,7 @@ class BOARD_DESIGN_SETTINGS ...@@ -18,7 +18,7 @@ class BOARD_DESIGN_SETTINGS
{ {
public: public:
bool m_MicroViasAllowed; ///< true to allow micro vias bool m_MicroViasAllowed; ///< true to allow micro vias
int m_CurrentViaType; ///< via type (VIA_BLIND_BURIED, VIA_TROUGHT VIA_MICROVIA) int m_CurrentViaType; ///< via type (VIA_BLIND_BURIED, VIA_THROUGH VIA_MICROVIA)
/// if true, when creating a new track starting on an existing track, use this track width /// if true, when creating a new track starting on an existing track, use this track width
bool m_UseConnectedTrackWidth; bool m_UseConnectedTrackWidth;
......
...@@ -2,7 +2,6 @@ add_definitions(-DKICAD) ...@@ -2,7 +2,6 @@ add_definitions(-DKICAD)
include_directories(BEFORE ${INC_BEFORE}) include_directories(BEFORE ${INC_BEFORE})
include_directories( include_directories(
${Boost_INCLUDE_DIR}
${INC_AFTER} ${INC_AFTER}
) )
......
This diff is collapsed.
# 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
include_directories( . )
set( GITHUB_PLUGIN_SRCS
github_plugin.cpp
PARENT_SCOPE # tell links based in 'directory pcbnew' about it, i.e. "../"
)
add_definitions(-DPCBNEW)
include_directories(BEFORE ${INC_BEFORE}) # Sources for the pcbnew PLUGIN called PCAD_PLUGIN
include_directories(
../../include # This CMakeLists.txt is included from pcbnew, so we are inheriting its include_directories(),
../../pcbnew # simply add the current source dir to inherited include_directories() for sources in here only.
../../polygon include_directories( . )
${INC_AFTER}
)
set(PCAD2PCBNEW_SRCS set( PCAD2PCBNEW_SRCS
pcad2kicad_common.cpp pcad2kicad_common.cpp
pcad_plugin.cpp pcad_plugin.cpp
pcb.cpp pcb.cpp
...@@ -30,4 +28,4 @@ set(PCAD2PCBNEW_SRCS ...@@ -30,4 +28,4 @@ set(PCAD2PCBNEW_SRCS
s_expr_loader.cpp s_expr_loader.cpp
) )
add_library(pcad2kicadpcb STATIC ${PCAD2PCBNEW_SRCS}) add_library( pcad2kicadpcb STATIC ${PCAD2PCBNEW_SRCS} )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment