From 8a5285db41bf9ff62516ac95d886473310e87dcf Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Wed, 5 Jun 2013 09:24:03 -0500 Subject: [PATCH] downloads-by-cmake now configurable, fix wx2.8 compiler errors --- CMakeLists.txt | 16 ++++++++++++---- common/page_layout_default_description.cpp | 9 ++++++--- common/page_layout_reader.cpp | 6 +----- include/worksheet.h | 5 +++++ pcbnew/CMakeLists.txt | 2 +- .../dialog_set_grid.cpp} | 18 ++++++++---------- pcbnew/dialogs/dialog_set_grid_base.cpp | 3 ++- ...g_set_grid.fbp => dialog_set_grid_base.fbp} | 2 +- pcbnew/dialogs/dialog_set_grid_base.h | 2 +- 9 files changed, 37 insertions(+), 26 deletions(-) rename pcbnew/{set_grid.cpp => dialogs/dialog_set_grid.cpp} (92%) rename pcbnew/dialogs/{dialog_set_grid.fbp => dialog_set_grid_base.fbp} (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 06c4de74c6..e3eebbbc7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,6 +74,13 @@ else() message("Build testing (unstable) version of KiCad") endif() +# All CMake downloads go here. Suggested is up in the source tree, not in the build dir where they +# would have to be downloaded over and over again. The default is to choose a directory that is +# hidden on linux (starts with a '.') because there is a way to exclude this directory when grepping +# the source tree. +set( DOWNLOAD_DIR ${PROJECT_SOURCE_DIR}/.downloads-by-cmake + CACHE PATH "Location of KiCad downloads, suggested is a dir common to all builds, i.e. global." ) + #================================================ # Set flags for GCC. @@ -149,6 +156,11 @@ if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS_DEBUG "${KICAD_GCC_DEBUG_BUILD_FLAGS} -Wall -g3 -ggdb3 -DDEBUG") endif() + # quiet GCC 4.8.1 while in boost + if( GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8 ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs" ) + endif() + endif(CMAKE_COMPILER_IS_GNUCXX) if(wxUSE_UNICODE) @@ -239,10 +251,6 @@ include(Functions) include( ExternalProject ) -# All CMake downloads go here, up in the source tree, not in the build dir where they -# would have to be downloaded over and over again. -set( DOWNLOAD_DIR ${PROJECT_SOURCE_DIR}/downloads-by-cmake ) - #================================================ # Find libraries that are needed to build KiCad. #================================================ diff --git a/common/page_layout_default_description.cpp b/common/page_layout_default_description.cpp index 5d3b7f7ca0..a0c8dac8d5 100644 --- a/common/page_layout_default_description.cpp +++ b/common/page_layout_default_description.cpp @@ -106,16 +106,18 @@ * */ +#include // defaultPageLayout + + // height of the band reference grid 2.0 mm // worksheet frame reference text size 1.3 mm // default text size 1.5 mm // default line width 0.15 mm // frame ref pitch 50 mm -extern const wxString defaultPageLayout; // Default page layout (sizes are in mm) -const wxString defaultPageLayout( wxT( "( page_layout\n" +const char defaultPageLayout[] = "( page_layout\n" "(setup (textsize 1.5 1.5) (linewidth 0.15) (textlinewidth 0.15) )" "(rect (comment rect around the title block) (linewidth 0.15) (start 110 34) (end 2 2) )\n" "(rect (start 0 0 ltcorner) (end 0 0 rbcorner) (repeat 2) (incrx 2) (incry 2) )\n" @@ -146,4 +148,5 @@ const wxString defaultPageLayout( wxT( "( page_layout\n" "(tbtext \"%C3\" (comment Comment 0) (pos 108 32) )\n" "(line (start 90 8.5) end 90 5.5) )\n" "(line (start 26 8.5) end 26 2) )\n" -")\n" ) ); +")\n" +; diff --git a/common/page_layout_reader.cpp b/common/page_layout_reader.cpp index 140d9e8df1..19f56dcdb4 100644 --- a/common/page_layout_reader.cpp +++ b/common/page_layout_reader.cpp @@ -36,10 +36,6 @@ #include #include -// defaultPageLayout is the default page layout description -// using the S expr. -// see page_layout_default_shape.cpp -extern const wxString defaultPageLayout; using namespace TB_READER_T; @@ -448,7 +444,7 @@ double PAGE_LAYOUT_READER_PARSER::parseDouble() void WORKSHEET_LAYOUT::SetDefaultLayout() { - PAGE_LAYOUT_READER_PARSER lp_parser( defaultPageLayout, "default page" ); + PAGE_LAYOUT_READER_PARSER lp_parser( defaultPageLayout, wxT( "default page" ) ); try { diff --git a/include/worksheet.h b/include/worksheet.h index 0928963554..d58203d77b 100644 --- a/include/worksheet.h +++ b/include/worksheet.h @@ -47,4 +47,9 @@ void DrawPageLayout( wxDC* aDC, EDA_DRAW_PANEL * aCanvas, int aPenWidth, double aScalar, EDA_COLOR_T aLineColor, EDA_COLOR_T aTextColor ); +// defaultPageLayout is the default page layout description +// using the S expr. +// see page_layout_default_shape.cpp +extern const char defaultPageLayout[]; + #endif // WORKSHEET_H_ diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 273c87db21..06f0aa71fd 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -97,6 +97,7 @@ set(PCBNEW_DIALOGS dialogs/dialog_mask_clearance_base.cpp dialogs/dialog_SVG_print.cpp dialogs/dialog_SVG_print_base.cpp + dialogs/dialog_set_grid.cpp dialogs/dialog_set_grid_base.cpp footprint_wizard.cpp footprint_wizard_frame.cpp @@ -192,7 +193,6 @@ set(PCBNEW_CLASS_SRCS print_board_functions.cpp printout_controler.cpp ratsnest.cpp - set_grid.cpp specctra.cpp specctra_export.cpp specctra_import.cpp diff --git a/pcbnew/set_grid.cpp b/pcbnew/dialogs/dialog_set_grid.cpp similarity index 92% rename from pcbnew/set_grid.cpp rename to pcbnew/dialogs/dialog_set_grid.cpp index 0f42682c73..5b2e288dbc 100644 --- a/pcbnew/set_grid.cpp +++ b/pcbnew/dialogs/dialog_set_grid.cpp @@ -1,5 +1,5 @@ /** - * @file set_grid.cpp + * @file dialog_set_grid.cpp * @brief Manage user grid. */ /* @@ -40,7 +40,7 @@ class DIALOG_SET_GRID : public DIALOG_SET_GRID_BASE { public: DIALOG_SET_GRID( wxWindow* parent, const wxPoint& pos ); - ~DIALOG_SET_GRID() { } + void SetGridSize( const wxRealPoint& grid ); wxRealPoint GetGridSize(); void SetGridUnits( int units ); @@ -56,6 +56,7 @@ private: void OnOkClick( wxCommandEvent& event ); }; + void PCB_BASE_FRAME::InstallGridFrame( const wxPoint& pos ) { DIALOG_SET_GRID dlg( this, pos ); @@ -90,8 +91,6 @@ void PCB_BASE_FRAME::InstallGridFrame( const wxPoint& pos ) DIALOG_SET_GRID::DIALOG_SET_GRID( wxWindow* parent, const wxPoint& pos ) : DIALOG_SET_GRID_BASE( parent ) { - SetFocus(); - m_TextPosXUnits->SetLabel( GetUnitsLabel( g_UserUnit ) ); m_TextPosYUnits->SetLabel( GetUnitsLabel( g_UserUnit ) ); @@ -105,9 +104,10 @@ void DIALOG_SET_GRID::SetGridSize( const wxRealPoint& grid ) { wxString msg; - msg.Printf( wxT( "%.6f" ), grid.x ); + msg.Printf( wxT( "%.10g" ), grid.x ); m_OptGridSizeX->SetValue( msg ); - msg.Printf( wxT( "%.6f" ), grid.y ); + + msg.Printf( wxT( "%.10g" ), grid.y ); m_OptGridSizeY->SetValue( msg ); } @@ -158,6 +158,7 @@ void DIALOG_SET_GRID::SetGridOrigin( const wxPoint& grid ) PutValueInLocalUnits( *m_GridOriginYCtrl, grid.y ); } + void DIALOG_SET_GRID::SetGridForFastSwitching( wxArrayString aGrids, int aGrid1, int aGrid2 ) { m_comboBoxGrid1->Append( aGrids ); @@ -167,6 +168,7 @@ void DIALOG_SET_GRID::SetGridForFastSwitching( wxArrayString aGrids, int aGrid1, m_comboBoxGrid2->SetSelection( aGrid2 ); } + void DIALOG_SET_GRID::GetGridForFastSwitching( int& aGrid1, int& aGrid2 ) { aGrid1 = m_comboBoxGrid1->GetSelection(); @@ -180,17 +182,13 @@ void DIALOG_SET_GRID::OnResetGridOrgClick( wxCommandEvent& event ) } -/*****************************************************************/ void DIALOG_SET_GRID::OnCancelClick( wxCommandEvent& event ) -/*****************************************************************/ { EndModal( wxID_CANCEL ); } -/*************************************************************************/ void DIALOG_SET_GRID::OnOkClick( wxCommandEvent& event ) -/*************************************************************************/ { EndModal( wxID_OK ); } diff --git a/pcbnew/dialogs/dialog_set_grid_base.cpp b/pcbnew/dialogs/dialog_set_grid_base.cpp index 2c46afe7db..306566344d 100644 --- a/pcbnew/dialogs/dialog_set_grid_base.cpp +++ b/pcbnew/dialogs/dialog_set_grid_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 8 2012) +// C++ code generated with wxFormBuilder (version Apr 30 2013) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -30,6 +30,7 @@ DIALOG_SET_GRID_BASE::DIALOG_SET_GRID_BASE( wxWindow* parent, wxWindowID id, con wxFlexGridSizer* fgSizer31; fgSizer31 = new wxFlexGridSizer( 2, 2, 0, 0 ); + fgSizer31->AddGrowableCol( 1 ); fgSizer31->SetFlexibleDirection( wxBOTH ); fgSizer31->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); diff --git a/pcbnew/dialogs/dialog_set_grid.fbp b/pcbnew/dialogs/dialog_set_grid_base.fbp similarity index 99% rename from pcbnew/dialogs/dialog_set_grid.fbp rename to pcbnew/dialogs/dialog_set_grid_base.fbp index b386c40703..f409d50996 100644 --- a/pcbnew/dialogs/dialog_set_grid.fbp +++ b/pcbnew/dialogs/dialog_set_grid_base.fbp @@ -209,7 +209,7 @@ 2 wxBOTH - + 1 0 diff --git a/pcbnew/dialogs/dialog_set_grid_base.h b/pcbnew/dialogs/dialog_set_grid_base.h index 9bb3e86b55..3f8fbd7aaa 100644 --- a/pcbnew/dialogs/dialog_set_grid_base.h +++ b/pcbnew/dialogs/dialog_set_grid_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 8 2012) +// C++ code generated with wxFormBuilder (version Apr 30 2013) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE!