Commit ac26035f authored by Garth Corral's avatar Garth Corral
Browse files

Merged trunk @ 5348

parents bb2bc9d1 846b2ae2
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -116,7 +116,7 @@ LINK_DIRECTORIES( ${LINK_DIRECTORIES_PATH} )
if( UNIX )
if( UNIX )
    set( KICAD_USER_CONFIG_DIR $ENV{HOME} CACHE PATH "Location of user specific KiCad config files" )
    set( KICAD_USER_CONFIG_DIR $ENV{HOME} CACHE PATH "Location of user specific KiCad config files" )
elseif( MINGW )
elseif( MINGW )
    set( KICAD_USER_CONFIG_DIR $ENV{%APPDATA%} CACHE PATH "Location of user specific KiCad config files" )
    set( KICAD_USER_CONFIG_DIR $ENV{APPDATA} CACHE PATH "Location of user specific KiCad config files" )
endif()
endif()
mark_as_advanced( KICAD_USER_CONFIG_DIR )
mark_as_advanced( KICAD_USER_CONFIG_DIR )


+2 −2
Original line number Original line Diff line number Diff line
@@ -165,7 +165,7 @@ if(WIN32 AND NOT CYGWIN)
    find_library(LIB_EAY
    find_library(LIB_EAY
      NAMES
      NAMES
        ${LIB_EAY_NAMES}
        ${LIB_EAY_NAMES}
      ${_OPENSLL_ROOT_HINTS_AND_PATHS}
      ${_OPENSSL_ROOT_HINTS_AND_PATHS}
      PATH_SUFFIXES
      PATH_SUFFIXES
        "lib"
        "lib"
        "lib/MinGW"
        "lib/MinGW"
@@ -177,7 +177,7 @@ if(WIN32 AND NOT CYGWIN)
    find_library(SSL_EAY
    find_library(SSL_EAY
      NAMES
      NAMES
        ${SSL_EAY_NAMES}
        ${SSL_EAY_NAMES}
      ${_OPENSLL_ROOT_HINTS_AND_PATHS}
      ${_OPENSSL_ROOT_HINTS_AND_PATHS}
      PATH_SUFFIXES
      PATH_SUFFIXES
        "lib"
        "lib"
        "lib/MinGW"
        "lib/MinGW"
+11 −4
Original line number Original line Diff line number Diff line
Compiling KiCad from Source
Compiling KiCad from Source
===========================
===========================
KiCad Documentation Team
KiCad Documentation Team
Last revised on 12-mars-2012 by jp Charras
Last revised on 2014-december-24 by JP Charras


Introduction
Introduction
------------
------------
@@ -32,7 +32,7 @@ KiCad from source.
* CMake   - Cross-platform make
* CMake   - Cross-platform make
* GLUT    - The OpenGL Utility Library
* GLUT    - The OpenGL Utility Library
* GLEW
* GLEW
* wxGTK or wxWidgets  - The wxWidgets GUI toolkit with GTK+ bindings
* wxWidgets  - The wxWidgets GUI toolkit with GTK+ bindings version 3.0 or more
* libbz2    (dev)
* libbz2    (dev)
* libcairo  (dev)
* libcairo  (dev)


@@ -57,7 +57,7 @@ Compiler and basic development tools
Make sure g++, make and other tools are in your path.
Make sure g++, make and other tools are in your path.
If windows, then try running g++ and make from within your msys bash shell.
If windows, then try running g++ and make from within your msys bash shell.


PLEASE NOTE: g++ 4.7.1 at least (possibly the 4.7.x series) is known to
PLEASE NOTE: g++ 4.7.1 and 4.7.2 are known to
miscompile pcbnew (it get zones wrong) with -O2; using -O1 is a suitable
miscompile pcbnew (it get zones wrong) with -O2; using -O1 is a suitable
workaround until they fix the compiler.
workaround until they fix the compiler.


@@ -68,7 +68,7 @@ WARNING:
 see wxWidgets_patch_notes.txt for patches and issues in wxWidgets.
 see wxWidgets_patch_notes.txt for patches and issues in wxWidgets.


On Windows, download
On Windows, download
http://sourceforge.net/projects/wxwindows/files/3.0.0/wxWidgets-3.0.0.zip/download
http://sourceforge.net/projects/wxwindows/files/3.0.2/wxWidgets-3.0.2.zip/download
or a newer version.
or a newer version.
Do NOT use previous versions which all have annoying issues for KiCad.
Do NOT use previous versions which all have annoying issues for KiCad.
Start msys so you have a bash shell.
Start msys so you have a bash shell.
@@ -95,6 +95,10 @@ or more recent (Older versions have a print function which does not work).
Verify that wx-config is in your path by running it from a command prompt.
Verify that wx-config is in your path by running it from a command prompt.
Linux users then go to next step.
Linux users then go to next step.


Note also wxWidgets must be compiled with the wxWebView support.
This is the default when building wxWidgets, but only if the libwebkitgtk-dev is installed
before building wxWidgets (sudo apt-get install libwebkitgtk-dev)

Install CMake
Install CMake
-------------
-------------
On windows, download the installation binary for windows from cmake.org.
On windows, download the installation binary for windows from cmake.org.
@@ -167,9 +171,12 @@ Linux and windows users both then make two "out of source" build directories:


On either cmake command line shown below, you can optionally include
On either cmake command line shown below, you can optionally include
    -DCMAKE_INSTALL_PREFIX=<finallInstallDir>
    -DCMAKE_INSTALL_PREFIX=<finallInstallDir>
For instance on Linux: <finallInstallDir>=/usr/local/kicad or ~/kicad


On windows, run the following command:
On windows, run the following command:
    cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DwxWidgets_ROOT_DIR=<wxInstallDir> ../../
    cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DwxWidgets_ROOT_DIR=<wxInstallDir> ../../
Avoid installing Kicad on C: disk, which is protected by Windows.
Use D: or E: ...


On linux, run instead the following command:
On linux, run instead the following command:
    cmake -DCMAKE_BUILD_TYPE=Release ../../
    cmake -DCMAKE_BUILD_TYPE=Release ../../
+19 −2
Original line number Original line Diff line number Diff line
@@ -100,9 +100,12 @@ USE_IMAGES_IN_MENUS (ON/OFF)
----------------------------
----------------------------
Default: OFF for OSX, ON for other platforms.
Default: OFF for OSX, ON for other platforms.


This option is used to enable or disable building KiCad with images in menu
This option is used to enable or disable building KiCad with images (icons) in menu
items.  If this is not defined when CMake is used to create the build files,
items.  If this is not defined when CMake is used to create the build files,
images will be included in menu items on all platforms except OSX.
images will be included in menu items on all platforms except OSX.
Note also, on Linux, some window managers do not show icons in menu, or
show them only if the current option is activated.
Therefore, even if you have icons in menus, they will be not always displayed




DOWNLOAD_DIR (PATH)
DOWNLOAD_DIR (PATH)
@@ -138,6 +141,7 @@ Default: OFF
This option enables or disables building Python scripting support within KiCad.
This option enables or disables building Python scripting support within KiCad.
Currently only Pcbnew is supported.  This option requires SWIG and Python to be
Currently only Pcbnew is supported.  This option requires SWIG and Python to be
installed on the system.
installed on the system.
It allows using footprint wizards in footprint editor to create new footprints




KICAD_SCRIPTING_MODULES (ON/OFF)
KICAD_SCRIPTING_MODULES (ON/OFF)
@@ -147,6 +151,8 @@ Default: OFF
This option enables or disables building KiCad Python modules that can be used
This option enables or disables building KiCad Python modules that can be used
externally by Python.  Currently only Pcbnew is supported.  This option
externally by Python.  Currently only Pcbnew is supported.  This option
requires SWIG and Python to be installed on the system.
requires SWIG and Python to be installed on the system.
This python module is used to edit board files (.kicad_pcb files) from a
python script, outside kicad.




KICAD_SCRIPTING_WXPYTHON (ON/OFF)
KICAD_SCRIPTING_WXPYTHON (ON/OFF)
@@ -156,6 +162,7 @@ Default: OFF
This option enables or disables building wxPython support into the KiCad
This option enables or disables building wxPython support into the KiCad
scripting support.  Currently only Pcbnew has scripting support.  This option requires
scripting support.  Currently only Pcbnew has scripting support.  This option requires
SWIG, Python, and wxPython to be installed on the system.
SWIG, Python, and wxPython to be installed on the system.
It allows execution of python scripts insided Pcbnew, during a session.




PYTHON_SITE_PACKAGE_PATH (PATH)
PYTHON_SITE_PACKAGE_PATH (PATH)
@@ -169,11 +176,21 @@ different path, set this variable to the desired path.


BUILD_GITHUB_PLUGIN (ON/OFF)
BUILD_GITHUB_PLUGIN (ON/OFF)
----------------------------
----------------------------
Default: OFF
Default: ON


This option enables or disables building KiCad with a pcbnew plugin for loading
This option enables or disables building KiCad with a pcbnew plugin for loading
footprints from a GitHub repository.
footprints from a GitHub repository.


KICAD_USE_WEBKIT (ON/OFF)
----------------------------
Default: ON (and OFF when BUILD_GITHUB_PLUGIN is OFF)

This option enables or disables building a web viewer used if the
footprint library table wizard to easily add footprints library entries
to this tables when libraries are on a GitHub repository.
This option need the full support of wxWebview/WebKit in wxWidgets, which is not
always the case on Linux.



KICAD_REPO_NAME (STRING)
KICAD_REPO_NAME (STRING)
------------------------
------------------------
+32 −21
Original line number Original line Diff line number Diff line
@@ -91,10 +91,12 @@ DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* parent ) :
{
{
    m_parent   = parent;
    m_parent   = parent;
    m_screen   = m_parent->GetScreen();
    m_screen   = m_parent->GetScreen();
    m_projectPath = Prj().GetProjectPath();
    m_page_bitmap = NULL;
    m_page_bitmap = NULL;
    m_tb = m_parent->GetTitleBlock();
    m_tb = m_parent->GetTitleBlock();
    m_customFmt = false;
    m_customFmt = false;
    m_localPrjConfigChanged = false;
    m_localPrjConfigChanged = false;
    m_pagelayout = NULL;


    initDialog();
    initDialog();


@@ -105,8 +107,8 @@ DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* parent ) :


DIALOG_PAGES_SETTINGS::~DIALOG_PAGES_SETTINGS()
DIALOG_PAGES_SETTINGS::~DIALOG_PAGES_SETTINGS()
{
{
    if( m_page_bitmap )
    delete m_page_bitmap;
    delete m_page_bitmap;
    delete m_pagelayout;
}
}




@@ -225,7 +227,7 @@ void DIALOG_PAGES_SETTINGS::OnOkClick( wxCommandEvent& event )
        m_screen->SetModify();
        m_screen->SetModify();
        m_parent->GetCanvas()->Refresh();
        m_parent->GetCanvas()->Refresh();


        if( m_localPrjConfigChanged )
        if( LocalPrjConfigChanged() )
            m_parent->SaveProjectSettings( true );
            m_parent->SaveProjectSettings( true );


        EndModal( true );
        EndModal( true );
@@ -409,9 +411,12 @@ bool DIALOG_PAGES_SETTINGS::SavePageSettings()


    if( fileName != BASE_SCREEN::m_PageLayoutDescrFileName )
    if( fileName != BASE_SCREEN::m_PageLayoutDescrFileName )
    {
    {
        if( !fileName.IsEmpty() )
        wxString fullFileName =
                    WORKSHEET_LAYOUT::MakeFullFileName( fileName, m_projectPath );

        if( !fullFileName.IsEmpty() )
        {
        {
            wxString fullFileName = WORKSHEET_LAYOUT::MakeFullFileName( fileName );

            if( !wxFileExists( fullFileName ) )
            if( !wxFileExists( fullFileName ) )
            {
            {
                wxString msg;
                wxString msg;
@@ -424,7 +429,7 @@ bool DIALOG_PAGES_SETTINGS::SavePageSettings()


        BASE_SCREEN::m_PageLayoutDescrFileName = fileName;
        BASE_SCREEN::m_PageLayoutDescrFileName = fileName;
        WORKSHEET_LAYOUT& pglayout = WORKSHEET_LAYOUT::GetTheInstance();
        WORKSHEET_LAYOUT& pglayout = WORKSHEET_LAYOUT::GetTheInstance();
        pglayout.SetPageLayout( fileName );
        pglayout.SetPageLayout( fullFileName );
        m_localPrjConfigChanged = true;
        m_localPrjConfigChanged = true;
    }
    }


@@ -663,6 +668,7 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
        wxString emptyString;
        wxString emptyString;
        GRResetPenAndBrush( &memDC );
        GRResetPenAndBrush( &memDC );


        WORKSHEET_LAYOUT::SetAltInstance( m_pagelayout );
        DrawPageLayout( &memDC, NULL, pageDUMMY,
        DrawPageLayout( &memDC, NULL, pageDUMMY,
                        emptyString, emptyString,
                        emptyString, emptyString,
                        m_tb, m_screen->m_NumberOfScreens,
                        m_tb, m_screen->m_NumberOfScreens,
@@ -670,6 +676,7 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()


        memDC.SelectObject( wxNullBitmap );
        memDC.SelectObject( wxNullBitmap );
        m_PageLayoutExampleBitmap->SetBitmap( *m_page_bitmap );
        m_PageLayoutExampleBitmap->SetBitmap( *m_page_bitmap );
        WORKSHEET_LAYOUT::SetAltInstance( NULL );


        // Refresh the dialog.
        // Refresh the dialog.
        Layout();
        Layout();
@@ -782,11 +789,9 @@ void DIALOG_PAGES_SETTINGS::GetCustomSizeMilsFromDialog()
// Called on .kicad_wks file description selection change
// Called on .kicad_wks file description selection change
void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
{
{
    wxString pro_dir = wxPathOnly( Prj().GetProjectFullName() );

    // Display a file picker dialog
    // Display a file picker dialog
    wxFileDialog fileDialog( this, _( "Select Page Layout Descr File" ),
    wxFileDialog fileDialog( this, _( "Select Page Layout Descr File" ),
                             pro_dir, GetWksFileName(),
                             m_projectPath, GetWksFileName(),
                             PageLayoutDescrFileWildcard,
                             PageLayoutDescrFileWildcard,
                             wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST );
                             wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST );


@@ -796,24 +801,30 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
    wxString fileName = fileDialog.GetPath();
    wxString fileName = fileDialog.GetPath();


    // Try to remove the path, if the path is the current working dir,
    // Try to remove the path, if the path is the current working dir,
    // or the dir of kicad.pro (template)
    // or the dir of kicad.pro (template), and use a relative path
    wxString shortFileName = WORKSHEET_LAYOUT::MakeShortFileName( fileName );
    wxString shortFileName = WORKSHEET_LAYOUT::MakeShortFileName( fileName, m_projectPath );
    wxFileName fn = shortFileName;


    // For Win/Linux/macOS compatibility, a relative path is a good idea
    // For Win/Linux/macOS compatibility, a relative path is a good idea
    if( fn.IsAbsolute() && fileName != GetWksFileName() )
    if( shortFileName != GetWksFileName() && shortFileName != fileName )
    {
    {
        fn.MakeRelativeTo( pro_dir );

        wxString msg = wxString::Format( _(
        wxString msg = wxString::Format( _(
                "The page layout descr filename has changed.\n"
                "The page layout descr filename has changed.\n"
                "Do you want to use the relative path:\n"
                "Do you want to use the relative path:\n"
                "'%s'" ),
                "'%s'\n"
                GetChars( fn.GetFullPath() )
                "instead of\n"
                );
                "'%s'" ), GetChars( shortFileName ), GetChars( fileName ) );
        if( IsOK( this, msg ) )

            shortFileName = fn.GetFullPath();
        if( !IsOK( this, msg ) )
            shortFileName = fileName;
    }
    }


    SetWksFileName( shortFileName );
    SetWksFileName( shortFileName );

    if( m_pagelayout == NULL )
        m_pagelayout = new WORKSHEET_LAYOUT;

    m_pagelayout->SetPageLayout( fileName );

    GetPageLayoutInfoFromDialog();
    UpdatePageLayoutExample();
}
}
Loading