From 4fd2a4da94b2dd56c49e4f529c85be0990d810bf Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 31 Oct 2014 15:45:46 +0100 Subject: [PATCH 1/6] Pcbnew, python console: refinements. --- pcbnew/pcbframe.cpp | 27 +++---- pcbnew/scripting/python_console_frame.h | 98 +++++++++++++++++++++++++ pcbnew/tool_pcb.cpp | 2 +- 3 files changed, 108 insertions(+), 19 deletions(-) create mode 100644 pcbnew/scripting/python_console_frame.h diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 03605e3fb1..19ca312d7b 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -79,6 +79,7 @@ #include #include +#include #if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON) #include @@ -211,11 +212,12 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME ) EVT_TOOL( ID_TOOLBARH_PCB_MODE_MODULE, PCB_EDIT_FRAME::OnSelectAutoPlaceMode ) EVT_TOOL( ID_TOOLBARH_PCB_MODE_TRACKS, PCB_EDIT_FRAME::OnSelectAutoPlaceMode ) EVT_TOOL( ID_TOOLBARH_PCB_FREEROUTE_ACCESS, PCB_EDIT_FRAME::Access_to_External_Tool ) -#ifdef KICAD_SCRIPTING_WXPYTHON + + // has meaning only with KICAD_SCRIPTING_WXPYTHON enabled EVT_TOOL( ID_TOOLBARH_PCB_SCRIPTING_CONSOLE, PCB_EDIT_FRAME::ScriptingConsoleEnableDisable ) EVT_UPDATE_UI( ID_TOOLBARH_PCB_SCRIPTING_CONSOLE, PCB_EDIT_FRAME::OnUpdateScriptingConsoleState ) -#endif + // Option toolbar EVT_TOOL( ID_TB_OPTIONS_DRC_OFF, PCB_EDIT_FRAME::OnSelectOptionToolbar ) @@ -992,34 +994,23 @@ void PCB_EDIT_FRAME::UpdateTitle() } -#if defined(KICAD_SCRIPTING_WXPYTHON) +wxSize PYTHON_CONSOLE_FRAME::m_frameSize; ///< The size of the PYTHON_CONSOLE_FRAME frame, stored during a session +wxPoint PYTHON_CONSOLE_FRAME::m_framePos; ///< The position ofPYTHON_CONSOLE_FRAME the frame, stored during a session + void PCB_EDIT_FRAME::ScriptingConsoleEnableDisable( wxCommandEvent& aEvent ) { - wxMiniFrame * pythonPanelFrame = (wxMiniFrame *) findPythonConsole(); + wxWindow * pythonPanelFrame = findPythonConsole(); bool pythonPanelShown = false; if( pythonPanelFrame == NULL ) - { - long style = wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxRESIZE_BORDER|wxFRAME_FLOAT_ON_PARENT; - pythonPanelFrame = new wxMiniFrame( this, wxID_ANY, wxT("Python console"), wxDefaultPosition, wxDefaultSize, - style, pythonConsoleNameId() ); - wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL ); - - wxWindow * pythonPanel = CreatePythonShellWindow( pythonPanelFrame ); - sizer->Add( pythonPanel, 1, wxEXPAND | wxALL, 5 ); - pythonPanelFrame->SetSizer( sizer ); - pythonPanelFrame->SetSize( wxSize( 600, 300 ) ); - pythonPanelFrame->Layout(); - pythonPanelFrame->Centre(); - } + pythonPanelFrame = new PYTHON_CONSOLE_FRAME( this, pythonConsoleNameId() ); else pythonPanelShown = pythonPanelFrame->IsShown(); pythonPanelShown = ! pythonPanelShown; pythonPanelFrame->Show( pythonPanelShown ); } -#endif void PCB_EDIT_FRAME::OnSelectAutoPlaceMode( wxCommandEvent& aEvent ) diff --git a/pcbnew/scripting/python_console_frame.h b/pcbnew/scripting/python_console_frame.h new file mode 100644 index 0000000000..84a44ccd54 --- /dev/null +++ b/pcbnew/scripting/python_console_frame.h @@ -0,0 +1,98 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr + * Copyright (C) 2004-2014 KiCad Developers, see change_log.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 + */ + +/** + * @file python_console_frame.h + */ + +#ifndef PYTHON_CONSOLE_FRAME_H_ +#define PYTHON_CONSOLE_FRAME_H_ + + + +/** + * Class PYTHON_CONSOLE_FRAME is a simple derived class from wxMiniFrame + * to handle the scripting python console + */ +class PYTHON_CONSOLE_FRAME : public wxMiniFrame +{ +private: + static wxSize m_frameSize; ///< The size of the frame, stored during a session + static wxPoint m_framePos; ///< The position of the frame, stored during a session + +public: + + PYTHON_CONSOLE_FRAME( wxWindow* aParent, const wxString& aFramenameId ) + : wxMiniFrame( aParent, wxID_ANY, wxT("Python console"), wxDefaultPosition, wxDefaultSize, + wxCAPTION|wxCLOSE_BOX|wxRESIZE_BORDER|wxFRAME_FLOAT_ON_PARENT, + aFramenameId ) + { + wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL ); + +#if defined(KICAD_SCRIPTING_WXPYTHON) + wxWindow * pythonPanel = CreatePythonShellWindow( pythonPanelFrame ); + sizer->Add( pythonPanel, 1, wxEXPAND | wxALL, 5 ); +#endif + SetSizer( sizer ); + SetMinSize( wxSize( 400, 200 ) ); + + if( m_frameSize.x <= 0 || m_frameSize.y <= 0 ) + SetSize( wxSize( 600, 300 ) ); + else + SetSize( m_frameSize ); + + if( m_framePos.x == 0 && m_framePos.y == 0 ) + Centre(); + else + SetPosition( m_framePos ); + + Layout(); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( PYTHON_CONSOLE_FRAME::OnClose ) ); + } + + ~PYTHON_CONSOLE_FRAME() + { + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( PYTHON_CONSOLE_FRAME::OnClose ) ); + } + +private: + + void OnClose( wxCloseEvent& event ) + { + if( !IsIconized() ) + { + m_frameSize = GetSize(); + m_framePos = GetPosition(); + } + + event.Skip(); + } + +// DECLARE_EVENT_TABLE() +}; + +#endif // PYTHON_CONSOLE_FRAME_H_ diff --git a/pcbnew/tool_pcb.cpp b/pcbnew/tool_pcb.cpp index ea60a5079b..e1ad70bd66 100644 --- a/pcbnew/tool_pcb.cpp +++ b/pcbnew/tool_pcb.cpp @@ -309,7 +309,7 @@ void PCB_EDIT_FRAME::ReCreateHToolbar() _( "Fast access to the Web Based FreeROUTE advanced router" ) ); // Access to the scripting console -#ifdef KICAD_SCRIPTING_WXPYTHON +#if defined(KICAD_SCRIPTING_WXPYTHON) m_mainToolBar->AddSeparator(); m_mainToolBar->AddTool( ID_TOOLBARH_PCB_SCRIPTING_CONSOLE, wxEmptyString, From db31daffe4f95a2047aec3ce25eea0ca5a2eb86d Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 31 Oct 2014 16:21:57 +0100 Subject: [PATCH 2/6] Fix compil issue I created in rev 5242 when KICAD_SCRIPTING_WXPYTHON is ON --- pcbnew/scripting/python_console_frame.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pcbnew/scripting/python_console_frame.h b/pcbnew/scripting/python_console_frame.h index 84a44ccd54..8cb9a32ddc 100644 --- a/pcbnew/scripting/python_console_frame.h +++ b/pcbnew/scripting/python_console_frame.h @@ -29,6 +29,9 @@ #ifndef PYTHON_CONSOLE_FRAME_H_ #define PYTHON_CONSOLE_FRAME_H_ +#if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON) +#include +#endif /** @@ -51,7 +54,7 @@ public: wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL ); #if defined(KICAD_SCRIPTING_WXPYTHON) - wxWindow * pythonPanel = CreatePythonShellWindow( pythonPanelFrame ); + wxWindow * pythonPanel = CreatePythonShellWindow( this ); sizer->Add( pythonPanel, 1, wxEXPAND | wxALL, 5 ); #endif SetSizer( sizer ); @@ -91,8 +94,6 @@ private: event.Skip(); } - -// DECLARE_EVENT_TABLE() }; #endif // PYTHON_CONSOLE_FRAME_H_ From 7b5318ff641bb984bf3d48710f754c3f79aa9258 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 31 Oct 2014 19:59:37 +0100 Subject: [PATCH 3/6] Fix minor issues about translated strings and coding style. Add comment relative to file function info in X1 gerber file format. --- common/common_plotGERBER_functions.cpp | 3 +-- eeschema/plot_schematic_DXF.cpp | 4 ++-- eeschema/plot_schematic_HPGL.cpp | 4 ++-- eeschema/plot_schematic_PDF.cpp | 4 ++-- eeschema/plot_schematic_PS.cpp | 4 ++-- eeschema/plot_schematic_SVG.cpp | 8 ++++---- pcbnew/pcbplot.cpp | 16 ++++++++++++---- pcbnew/pcbplot.h | 5 ++++- pcbnew/plot_board_layers.cpp | 8 ++++++-- pcbnew/tool_pcb.cpp | 4 ++-- 10 files changed, 37 insertions(+), 23 deletions(-) diff --git a/common/common_plotGERBER_functions.cpp b/common/common_plotGERBER_functions.cpp index 614e78520b..50d1802eb8 100644 --- a/common/common_plotGERBER_functions.cpp +++ b/common/common_plotGERBER_functions.cpp @@ -119,8 +119,7 @@ bool GERBER_PLOTTER::StartPlot() if( ! m_attribFunction.IsEmpty() ) { - fprintf( outputFile, "%%TF.FileFunction,%s*%%\n", - TO_UTF8( m_attribFunction ) ); + fprintf( outputFile, "%s\n", TO_UTF8( m_attribFunction ) ); } // Set coordinate format to 3.6 or 4.5 absolute, leading zero omitted diff --git a/eeschema/plot_schematic_DXF.cpp b/eeschema/plot_schematic_DXF.cpp index 17c25a309f..3786ee82de 100644 --- a/eeschema/plot_schematic_DXF.cpp +++ b/eeschema/plot_schematic_DXF.cpp @@ -98,9 +98,9 @@ void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef ) m_MessagesBox->AppendText( msg ); } - catch (IO_ERROR& e) + catch( IO_ERROR& e ) { - msg.Printf( _( "DXF Plotter Exception : '%s'"), wxString(e.errorText ) ); + msg.Printf( wxT( "DXF Plotter Exception : '%s'"), GetChars( e.errorText ) ); m_MessagesBox->AppendText( msg ); schframe->SetCurrentSheet( oldsheetpath ); schframe->GetCurrentSheet().UpdateAllScreenReferences(); diff --git a/eeschema/plot_schematic_HPGL.cpp b/eeschema/plot_schematic_HPGL.cpp index 89c6bea205..979e24f40f 100644 --- a/eeschema/plot_schematic_HPGL.cpp +++ b/eeschema/plot_schematic_HPGL.cpp @@ -195,9 +195,9 @@ void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef ) if( !aPlotAll ) break; } - catch (IO_ERROR& e) + catch( IO_ERROR& e ) { - msg.Printf( _( "HPGL Plotter Exception : '%s'"), wxString(e.errorText ) ); + msg.Printf( wxT( "HPGL Plotter Exception : '%s'"), GetChars( e.errorText ) ); m_MessagesBox->AppendText( msg ); } diff --git a/eeschema/plot_schematic_PDF.cpp b/eeschema/plot_schematic_PDF.cpp index f8fa9cc4c8..0d59493fc4 100644 --- a/eeschema/plot_schematic_PDF.cpp +++ b/eeschema/plot_schematic_PDF.cpp @@ -110,10 +110,10 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef ) first_page = false; } - catch (const IO_ERROR& e) + catch( const IO_ERROR& e ) { // Cannot plot PDF file - msg.Printf( _( "PDF Plotter Exception : <%s>"), wxString(e.errorText ) ); + msg.Printf( wxT( "PDF Plotter Exception : <%s>"), GetChars( e.errorText ) ); restoreEnvironment(plotter, oldsheetpath, msg); return; } diff --git a/eeschema/plot_schematic_PS.cpp b/eeschema/plot_schematic_PS.cpp index 6e97f31f08..ce221d6795 100644 --- a/eeschema/plot_schematic_PS.cpp +++ b/eeschema/plot_schematic_PS.cpp @@ -129,9 +129,9 @@ void DIALOG_PLOT_SCHEMATIC::createPSFile( bool aPlotAll, bool aPlotFrameRef ) m_MessagesBox->AppendText( msg ); } - catch (IO_ERROR& e) + catch( IO_ERROR& e ) { - msg.Printf( _( "PS Plotter Exception : '%s'"), wxString(e.errorText ) ); + msg.Printf( wxT( "PS Plotter Exception : '%s'"), GetChars( e.errorText ) ); m_MessagesBox->AppendText( msg ); } diff --git a/eeschema/plot_schematic_SVG.cpp b/eeschema/plot_schematic_SVG.cpp index a929b0271b..2f8a869678 100644 --- a/eeschema/plot_schematic_SVG.cpp +++ b/eeschema/plot_schematic_SVG.cpp @@ -101,10 +101,10 @@ void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef ) m_MessagesBox->AppendText( msg ); } - catch (const IO_ERROR& e) + catch( const IO_ERROR& e ) { // Cannot plot SVG file - msg.Printf( _( "SVG Plotter Exception : '%s'" ), wxString( e.errorText ) ); + msg.Printf( wxT( "SVG Plotter Exception : '%s'" ), GetChars( e.errorText ) ); m_MessagesBox->AppendText( msg ); m_parent->SetCurrentSheet( oldsheetpath ); @@ -143,10 +143,10 @@ void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef ) } m_MessagesBox->AppendText( msg ); } - catch (const IO_ERROR& e) + catch( const IO_ERROR& e ) { // Cannot plot SVG file - msg.Printf( _( "SVG Plotter Exception : <%s>"), wxString(e.errorText ) ); + msg.Printf( wxT( "SVG Plotter Exception : <%s>"), GetChars( e.errorText ) ); m_MessagesBox->AppendText( msg ); return; } diff --git a/pcbnew/pcbplot.cpp b/pcbnew/pcbplot.cpp index b252c882db..76028d145e 100644 --- a/pcbnew/pcbplot.cpp +++ b/pcbnew/pcbplot.cpp @@ -84,9 +84,10 @@ const wxString GetGerberExtension( LAYER_NUM aLayer ) } -wxString GetGerberFileFunction( const BOARD *aBoard, LAYER_NUM aLayer ) +wxString GetGerberFileFunction( const BOARD *aBoard, LAYER_NUM aLayer, + bool aUseX1CompatibilityMode ) { - wxString attrib = wxEmptyString; + wxString attrib; switch( aLayer ) { @@ -178,11 +179,18 @@ wxString GetGerberFileFunction( const BOARD *aBoard, LAYER_NUM aLayer ) attrib += wxString( wxT( ",Mixed" ) ); break; default: - ; // do nothing (but avoid a warning for unhandled LAYER_T values from GCC) + break; // do nothing (but avoid a warning for unhandled LAYER_T values from GCC) } } - return attrib; + wxString fileFct; + + if( aUseX1CompatibilityMode ) + fileFct.Printf( "G04 #@! TF.FileFunction,%s*", GetChars( attrib ) ); + else + fileFct.Printf( "%%TF.FileFunction,%s*%%", GetChars( attrib ) ); + + return fileFct; } diff --git a/pcbnew/pcbplot.h b/pcbnew/pcbplot.h index 3ac861bbfa..3efcef7116 100644 --- a/pcbnew/pcbplot.h +++ b/pcbnew/pcbplot.h @@ -258,9 +258,12 @@ const wxString GetGerberExtension( LAYER_NUM aLayer ); * the "%TF.FileFunction" attribute prefix and the "*%" suffix. * @param aBoard = the board, needed to get the total count of copper layers * @param aLayer = the layer number to create the attribute for + * @param aUseX1CompatibilityMode = true to use a file function attribute like G04 comment + * , compatible with X1 (rx274) notation (G04#@!TF.FileFunction) * @return The attribute, as a text string */ -extern wxString GetGerberFileFunction( const BOARD *aBoard, LAYER_NUM aLayer ); +extern wxString GetGerberFileFunction( const BOARD *aBoard, LAYER_NUM aLayer, + bool aUseX1CompatibilityMode ); // PLOTGERB.CPP void SelectD_CODE_For_LineDraw( PLOTTER* plotter, int aSize ); diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index e320209ece..865418f556 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -1005,8 +1005,12 @@ PLOTTER* StartPlotBoard( BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts, if( plotter->OpenFile( aFullFileName ) ) { // For the Gerber "file function" attribute, set the layer number - if( plotter->GetPlotterType() == PLOT_FORMAT_GERBER && plotOpts.GetUseGerberAttributes() ) - plotter->SetLayerAttribFunction( GetGerberFileFunction( aBoard, aLayer ) ); + if( plotter->GetPlotterType() == PLOT_FORMAT_GERBER ) + { + bool useX2mode = plotOpts.GetUseGerberAttributes(); + plotter->SetLayerAttribFunction( GetGerberFileFunction( aBoard, aLayer, + useX2mode ? false : true ) ); + } plotter->StartPlot(); diff --git a/pcbnew/tool_pcb.cpp b/pcbnew/tool_pcb.cpp index e1ad70bd66..4ec9569bef 100644 --- a/pcbnew/tool_pcb.cpp +++ b/pcbnew/tool_pcb.cpp @@ -631,7 +631,7 @@ void PCB_EDIT_FRAME::updateTraceWidthSelectBox() msg = _( "Track " ) + CoordinateToString( GetDesignSettings().m_TrackWidthList[ii], true ); if( ii == 0 ) - msg << _( " *" ); + msg << wxT( " *" ); m_SelTrackWidthBox->Append( msg ); } @@ -662,7 +662,7 @@ void PCB_EDIT_FRAME::updateViaSizeSelectBox() << CoordinateToString( GetDesignSettings().m_ViasDimensionsList[ii].m_Drill, true ); if( ii == 0 ) - msg << _( " *" ); + msg << wxT( " *" ); m_SelViaSizeBox->Append( msg ); } From 03d50b22133145e77441f4fc9147e400dfd7e07d Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Fri, 31 Oct 2014 16:44:09 -0400 Subject: [PATCH 4/6] Change Windows install tree to match Linux install tree. * Move all Windows install subfolders from ${CMAKE_INSTALL_PREFIX}/share/ to ${CMAKE_INSTALL_PREFIX}/share/kicad/. * Remove unused define DEFAULT_FP_LIB_PATH from build configuration. * Remove Boost target when skipping internal Boost build. * Update INSTALL.txt to reflect install tree changes. --- CMakeLists.txt | 42 +++---------- CMakeModules/config.h.cmake | 3 - INSTALL.txt | 122 +++++++++++------------------------- 3 files changed, 44 insertions(+), 123 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3dda778525..b64052b98d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -303,40 +303,22 @@ set( KIFACE_PREFIX "_" ) #================================================ # Locations for install targets. -set( KICAD_BIN bin - CACHE PATH "Location of KiCad binaries." ) - -set( KICAD_FP_LIB_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}" - CACHE PATH "Default path where footprint libraries are installed." ) - -if( UNIX AND NOT APPLE ) +#================================================ +if( NOT APPLE ) # Everything without leading / is relative to CMAKE_INSTALL_PREFIX. + set( KICAD_BIN bin + CACHE PATH "Location of KiCad binaries." ) set( KICAD_PLUGINS lib/kicad/plugins CACHE PATH "Location of KiCad plugins." ) set( KICAD_DATA share/kicad CACHE PATH "Location of KiCad data files." ) set( KICAD_DOCS share/doc/kicad CACHE PATH "Location of KiCad documentation files." ) - set( KICAD_FP_LIB_INSTALL_PATH "${KICAD_FP_LIB_INSTALL_PATH}/share/kicad/modules" ) -endif() - -if( MINGW ) - # Everything without leading / is relative to CMAKE_INSTALL_PREFIX. - set( KICAD_PLUGINS ${KICAD_BIN}/plugins - CACHE PATH "Location of KiCad plugins." ) - set( KICAD_DATA share - CACHE PATH "Location of KiCad data files." ) - set( KICAD_DOCS doc - CACHE PATH "Location of KiCad documentation files." ) - set( KICAD_FP_LIB_INSTALL_PATH "${KICAD_FP_LIB_INSTALL_PATH}/modules" ) -endif() - -set( KICAD_DEMOS ${KICAD_DATA}/demos - CACHE PATH "Location of KiCad demo files." ) -set( KICAD_TEMPLATE ${KICAD_DATA}/template - CACHE PATH "Location of KiCad template files." ) - -if( APPLE ) + set( KICAD_DEMOS ${KICAD_DATA}/demos + CACHE PATH "Location of KiCad demo files." ) + set( KICAD_TEMPLATE ${KICAD_DATA}/template + CACHE PATH "Location of KiCad template files." ) +else() # everything without leading / is relative to CMAKE_INSTALL_PREFIX. # CMAKE_INSTALL_PREFIX is root of .dmg image set( KICAD_BIN ${CMAKE_INSTALL_PREFIX} @@ -372,10 +354,6 @@ if( APPLE ) set( KICAD_DEMOS demos CACHE PATH "Location of KiCad demo files." FORCE ) - # used to set DEFAULT_FP_LIB_PATH in config.h.cmake, but then never used - # set it to correct value just in case (see common.cpp) - set( KICAD_FP_LIB_INSTALL_PATH "~/Library/Preferences/kicad" ) - # Override default paths for fixup_bundle set( OSX_BUNDLE_OVERRIDE_PATHS " function( gp_item_default_embedded_path_override item default_embedded_path_var ) @@ -553,8 +531,6 @@ if( KICAD_SKIP_BOOST ) message( FATAL_ERROR "Boost 1.54+ libraries are required." ) endif() - add_custom_target( boost ) # it is required to meet some further dependencies - message( WARNING " WARNING: You decided to skip building boost library. KiCad developers strongly advise you to build the bundled boost library, as it is known to work with KiCad. diff --git a/CMakeModules/config.h.cmake b/CMakeModules/config.h.cmake index ca228b70ea..d5aaf1843e 100644 --- a/CMakeModules/config.h.cmake +++ b/CMakeModules/config.h.cmake @@ -61,9 +61,6 @@ /// The install prefix defined in CMAKE_INSTALL_PREFIX. #define DEFAULT_INSTALL_PATH "@CMAKE_INSTALL_PREFIX@" -/// Default footprint library install path when installed with `make install`. -#define DEFAULT_FP_LIB_PATH "@KICAD_FP_LIB_INSTALL_PATH@" - /// When defined, build the GITHUB_PLUGIN for pcbnew. #cmakedefine BUILD_GITHUB_PLUGIN diff --git a/INSTALL.txt b/INSTALL.txt index 0a21ae500b..208c508f73 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -24,87 +24,43 @@ Installation from binary packages Installation from binary packages for Windows --------------------------------------------- - KiCad can be installed in 'C:\kicad', 'D:\kicad', 'C:\Program files\kicad', -'D:\Program files\kicad'. +The KiCad binary archive can be installed anywhere on the system that as long as the user +has write privileges. - For example, for an installation in the folder 'C:\kicad', unzip KiCad -packages: - - kicad-{version}.zip - kicad-doc-{version}.zip - kicad-library-{version}.zip - -to the folder 'C:\kicad'. - - The main program is the project manager (kicad.exe) and from it you can run -the other programs (schematic editor - eeschema, pcb editor - pcbnew, -utilities: cvpcb and gerbview). - - You can create a shortcut to 'C:\kicad\bin\kicad.exe'. +You can create a shortcut to '${prefix}\bin\kicad.exe' where ${prefix} is the install path. Installation from binary packages for Linux ------------------------------------------- - KiCad can be installed in '/usr' or '/usr/local'. +KiCad can be installed in '/usr' or '/usr/local'. You must have "root" access for installation. - You must have "root" access for installation. +cd / +tar -xjf kicad-{version}.tbz2 +tar -xjf kicad-doc-{version}.tbz2 +tar -xjf kicad-library-{version}.tbz2 - cd / - tar -xjf kicad-{version}.tbz2 - tar -xjf kicad-doc-{version}.tbz2 - tar -xjf kicad-library-{version}.tbz2 - - The main program is '/usr/bin/kicad'. +The main program is '/usr/bin/kicad'. -Windows KiCad tree ------------------- +Linux and Windows KiCad install tree +------------------------------------- -kicad/bin - Binaries (executable files). -kicad/doc - Various documentation. -kicad/doc/help - Interactive help. -kicad/share/demos - Sample schematics and printed boards. -kicad/share/internat - Interface localization files. -kicad/share/library - Libraries for schematic. -kicad/share/modules - Module libraries for printed boards. -kicad/share/modules/packages3d - 3D component models (.wrl and .wings format). +${prefix}/bin - Binaries (executable files). +${prefix}/share/doc/kicad/ - Various documentation. +${prefix}/share/doc/kicad/help - Interactive help. +${prefix}/share/kicad/demos - Sample schematics and printed boards. +${prefix}/share/kicad/internat - Dictionaries for interface localization. +${prefix}/share/kicad/library - Interface localization files. +${prefix}/share/kicad/modules - Module libraries for printed boards. +${prefix}/share/kicad/modules/packages3d - 3D component models (.wrl and .wings format). - Files '*.mod' are libraries, and files '*.brd' are printed boards you can -view with pcbnew. - Files *.brd show the existing modules (and 3D shapes) in libraries. - - -Linux KiCad tree ----------------- -KiCad can use the Windows tree or the below tree. -When Kicad is coming from Linux distribution, the tree is: - -/usr/bin - Binaries (executable files). -/usr/share/doc/kicad/ - Various documentation. -/usr/share/doc/kicad/help - Interactive help. -/usr/share/kicad/demos - Sample schematics and printed boards. -/usr/share/kicad/internat - Dictionaries for interface localization. -/usr/share/kicad/library - Interface localization files. -/usr/share/kicad/modules - Module libraries for printed boards. -/usr/share/kicad/modules/packages3d - 3D component models (.wrl and .wings format). - -if KiCad does not found its files in usr/share, the search is made in -/usr/local/kicad -and kicad uses the same tree as the Windows KiCad tree above - -*** When KiCad comes from .tgz archive from http://iut-tice.ujf-grenoble.fr/cao/, -it must me installed in /usr/local and uses the Windows tree ***. - - - Files '*.mod' are the libraries, and files '*.brd' are printed boards you can -view with pcbnew. - Files *.brd show the existing modules (and 3D shapes) in libraries. +KiCad searches for the libraries, templates, 3D models, etc. bin/../share. Warning: -Do not change the KiCad tree, or the location of binary files, -else KiCad will not be able to find its required files (configuration, -libraries, etc.). +Do not change the KiCad tree, or the location of binary files. Otherwise +KiCad may not be able to find some or all of its required files. + Mac OS X KiCad tree ------------------- @@ -122,35 +78,35 @@ User files can be the same as the system wide files but only inside the users ho $HOME/Library/Application Support/kicad Warning: -These paths are hardcoded into KiCad, if you put them somewhere else KiCad will not find them when a new -project is created. +These paths are hardcoded into KiCad, if you put them somewhere else KiCad will not find +them when a new project is created. Installation from source code ----------------------------- Some dependencies must be satisfied for the correct installation of KiCad: -under Linux: -wxWidgets >= 2.8.11 http://www.wxwidgets.org/ -(needs to be compiled with unicode support) -under Windows:MacOSX -wxWidgets >= 2.9.4 http://www.wxwidgets.org/ -CMake >= 2.8.1 http://www.cmake.org/ +wxWidgets >= 3.0.0 http://www.wxwidgets.org/ + +CMake >= 2.8.4 http://www.cmake.org/ + Boost C++ Libraries: files used by kicad are autmatically downloaded and patched if needed from boost site ( http://www.boost.org/ ) + OpenGL Linux: Mesa 3D Graphics Library http://www.mesa3d.org/ Windows: built-in + Zlib Compression Library http://www.zlib.net/ - In source-tree-build are mostly unwanted, so make a subdir called "build" and +In source-tree-build are mostly unwanted, so make a subdir called "build" and change to it. - Call cmake with the path to KiCad. E.g., when your build-folder is "build" +Call cmake with the path to KiCad. E.g., when your build-folder is "build" within source-tree, type "cmake ../". - Now your system get checked if it is able compiling KiCad and cmake generates +Now your system get checked if it is able compiling KiCad and cmake generates the Makefiles. After calling cmake just type "make" and build begins. @@ -185,14 +141,6 @@ Required for Windows platform. -DwxWidgets_USE_DEBUG=ON Can be used only with -DCMAKE_BUILD_TYPE=Debug --DwxWidgets_USE_STATIC=ON -For building statically linked executables. Can be used only if wxWidgets -configured and builded with "--enable-monolithic --disable-shared" parameters. - --DwxWidgets_USE_STATIC=OFF -For building dinamically linked executables. Can be used only if wxWidgets -configured and builded with "--disable-monolithic --enable-shared" parameters. - -DKICAD_KEEPCASE=ON Build the KiCad with no component name conversion to uppercase (if you want your ADuC.../Si.../bq... components named as just so). @@ -207,7 +155,7 @@ When more output is wanted use this cmake parameter or call "make VERBOSE=1". Extra CFLAGS and linker flags ----------------------------- - If you require extra flags for compiler and linker you may give them via +If you require extra flags for compiler and linker you may give them via environment variables "CXXFLAGS" (c++ compiler) "LDFLAGS" (for linker) From 835bb37b888464a23e96350142d5dd956c5856dc Mon Sep 17 00:00:00 2001 From: Michal Jahelka Date: Fri, 31 Oct 2014 21:18:25 +0000 Subject: [PATCH 5/6] Remove library nickname from module position file --- pcbnew/exporters/gen_modules_placefile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcbnew/exporters/gen_modules_placefile.cpp b/pcbnew/exporters/gen_modules_placefile.cpp index fe90791e30..edcef62669 100644 --- a/pcbnew/exporters/gen_modules_placefile.cpp +++ b/pcbnew/exporters/gen_modules_placefile.cpp @@ -493,7 +493,7 @@ int PCB_EDIT_FRAME::DoGenFootprintsPositionFile( const wxString& aFullFileName, const wxString& ref = list[ii].m_Reference; const wxString& val = list[ii].m_Value; - const wxString& pkg = list[ii].m_Module->GetFPID().Format(); + const wxString& pkg = list[ii].m_Module->GetFPID().GetFootprintName(); sprintf( line, "%-8.8s %-16.16s %-16.16s", TO_UTF8( ref ), TO_UTF8( val ), TO_UTF8( pkg ) ); From 0561940db00069cdfa3a9e55175f9b83f01e1505 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Fri, 31 Oct 2014 17:22:37 -0400 Subject: [PATCH 6/6] Fix CMake warning caused by removal of boost dependency when not actually building boost from source. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b64052b98d..b0d4e73b0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -531,6 +531,10 @@ if( KICAD_SKIP_BOOST ) message( FATAL_ERROR "Boost 1.54+ libraries are required." ) endif() + # Keeps CMake from complaining about undefined boost dependencies even though Boost was + # found. Sigh!!!!! + add_custom_target( boost ) + message( WARNING " WARNING: You decided to skip building boost library. KiCad developers strongly advise you to build the bundled boost library, as it is known to work with KiCad.