Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
d053e561
Commit
d053e561
authored
Apr 08, 2014
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More migration towards single process, extend PROJECT::Config*() in proper direction, cleanups.
parent
94bc4355
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
114 additions
and
128 deletions
+114
-128
CMakeLists.txt
CMakeLists.txt
+3
-3
fp_lib_table.cpp
common/fp_lib_table.cpp
+1
-13
project.cpp
common/project.cpp
+4
-1
single_top.cpp
common/single_top.cpp
+12
-4
autosel.cpp
cvpcb/autosel.cpp
+1
-1
cfg.cpp
cvpcb/cfg.cpp
+8
-13
readwrite_dlgs.cpp
cvpcb/readwrite_dlgs.cpp
+17
-8
eelibs_read_libraryfiles.cpp
eeschema/eelibs_read_libraryfiles.cpp
+1
-1
eeschema_config.cpp
eeschema/eeschema_config.cpp
+4
-4
eeschema_config.h
eeschema/eeschema_config.h
+0
-3
schframe.cpp
eeschema/schframe.cpp
+1
-1
config_params.h
include/config_params.h
+11
-0
search_stack.h
include/search_stack.h
+0
-15
CMakeLists.txt
pcbnew/CMakeLists.txt
+44
-46
dialog_netlist.cpp
pcbnew/dialogs/dialog_netlist.cpp
+1
-1
pcbnew.cpp
pcbnew/pcbnew.cpp
+2
-3
pcbnew_config.cpp
pcbnew/pcbnew_config.cpp
+3
-6
pcbnew_config.h
pcbnew/pcbnew_config.h
+1
-5
No files found.
CMakeLists.txt
View file @
d053e561
...
...
@@ -364,13 +364,13 @@ check_find_package_result( OPENGL_FOUND "OpenGL" )
# https://www.mail-archive.com/cmake@cmake.org/msg47501.html
# Handle target used to specify if a target needs wx-widgets or other libraries
# Always defined, empty if no libraries are to be buil
d
# Always defined, empty if no libraries are to be buil
t
add_custom_target
(
lib-dependencies
)
if
(
KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC
)
# This should be buil
d
in all cases, if swig exec is not avaiable
# will be impossible also enable SCRIPTING being for PCBNEW required immediatly
# This should be buil
t
in all cases, if swig exec is not avaiable
# will be impossible also enable SCRIPTING being for PCBNEW required immediat
e
ly
include
(
download_pcre
)
include
(
download_swig
)
...
...
common/fp_lib_table.cpp
View file @
d053e561
...
...
@@ -622,8 +622,6 @@ const FP_LIB_TABLE::ROW* FP_LIB_TABLE::FindRow( const wxString& aNickname )
// wxGetenv( wchar_t* ) is not re-entrant on linux.
// Put a lock on multithreaded use of wxGetenv( wchar_t* ), called from wxEpandEnvVars(),
// needed by bool ReadFootprintFiles( FP_LIB_TABLE* aTable, const wxString* aNickname = NULL );
#if 1
#include <ki_mutex.h>
const
wxString
FP_LIB_TABLE
::
ExpandSubstitutions
(
const
wxString
&
aString
)
...
...
@@ -637,16 +635,6 @@ const wxString FP_LIB_TABLE::ExpandSubstitutions( const wxString& aString )
return
wxExpandEnvVars
(
aString
);
}
#else
const
wxString
FP_LIB_TABLE
::
ExpandSubstitutions
(
const
wxString
&
aString
)
{
// We reserve the right to do this another way, by providing our own member
// function.
return
wxExpandEnvVars
(
aString
);
}
#endif
bool
FP_LIB_TABLE
::
IsEmpty
(
bool
aIncludeFallback
)
{
...
...
@@ -691,7 +679,7 @@ bool FP_LIB_TABLE::ConvertFromLegacy( SEARCH_STACK& aSStack, NETLIST& aNetList,
{
wxFileName
fn
(
wxEmptyString
,
aLibNames
[
ii
],
LegacyFootprintLibPathExtension
);
libPath
=
aSStack
.
FindValidPath
(
fn
);
libPath
=
aSStack
.
FindValidPath
(
fn
.
GetFullPath
()
);
if
(
!
libPath
)
{
...
...
common/project.cpp
View file @
d053e561
...
...
@@ -205,14 +205,17 @@ wxConfigBase* PROJECT::configCreate( const SEARCH_STACK& aSList, const wxString&
// is there an edge transition, a change in m_project_filename?
if
(
m_project_name
!=
fn
)
{
m_pcb_search
.
Clear
();
m_sch_search
.
Clear
();
SetProjectFullName
(
fn
.
GetFullPath
()
);
// to the empty list, add project dir as first
// to the empty lists, add project dir as first
m_pcb_search
.
AddPaths
(
fn
.
GetPath
()
);
m_sch_search
.
AddPaths
(
fn
.
GetPath
()
);
// append all paths from aSList
add_search_paths
(
&
m_pcb_search
,
aSList
,
-
1
);
add_search_paths
(
&
m_sch_search
,
aSList
,
-
1
);
// addLibrarySearchPaths( SEARCH_STACK* aSP, wxConfigBase* aCfg )
...
...
common/single_top.cpp
View file @
d053e561
...
...
@@ -182,10 +182,6 @@ static const wxString dso_full_path( const wxString& aAbsoluteArgv0 )
return
fn
.
GetFullPath
();
}
// Use of this is arbitrary, remember single_top only knows about a single DSO.
// Could have used one from the KIWAY also.
static
wxDynamicLibrary
dso
;
// Only a single KIWAY is supported in this single_top top level component,
// which is dedicated to loading only a single DSO.
...
...
@@ -261,6 +257,15 @@ IMPLEMENT_APP( APP_SINGLE_TOP );
static
KIFACE_GETTER_FUNC
*
get_kiface_getter
(
const
wxString
&
aDSOName
)
{
#if defined(BUILD_KIWAY_DLL)
// Remember single_top only knows about a single DSO. Using an automatic
// with a defeated destructor, see Detach() below, so that the DSO program
// image stays in RAM until process termination, and specifically
// beyond the point in time at which static destructors are run. Otherwise
// a static wxDynamicLibrary's destructor might create an out of sequence
// problem. This was never detected, so it's only a preventative strategy.
wxDynamicLibrary
dso
;
void
*
addr
=
NULL
;
if
(
!
dso
.
Load
(
aDSOName
,
wxDL_VERBATIM
|
wxDL_NOW
)
)
...
...
@@ -275,6 +280,9 @@ static KIFACE_GETTER_FUNC* get_kiface_getter( const wxString& aDSOName )
// No further reporting required here.
}
// Tell dso's wxDynamicLibrary destructor not to Unload() the program image.
(
void
)
dso
.
Detach
();
return
(
KIFACE_GETTER_FUNC
*
)
addr
;
#else
...
...
cvpcb/autosel.cpp
View file @
d053e561
...
...
@@ -107,7 +107,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
{
fn
.
SetExt
(
fn
.
GetExt
()
+
wxT
(
"."
)
+
FootprintAliasFileExtension
);
}
tmp
=
search
.
FindValidPath
(
fn
);
tmp
=
search
.
FindValidPath
(
fn
.
GetFullPath
()
);
if
(
!
tmp
)
{
...
...
cvpcb/cfg.cpp
View file @
d053e561
...
...
@@ -27,7 +27,7 @@
*/
#include <fctsys.h>
#include <
pgm_base
.h>
#include <
kiface_i
.h>
#include <fp_lib_table.h>
#include <id.h>
#include <common.h>
...
...
@@ -42,29 +42,24 @@
#include <class_DisplayFootprintsFrame.h>
#define GROUP wxT("/cvpcb")
#define GROUPLIB wxT("/pcbnew/libraries")
#define GROUPEQU wxT("/cvpcb/libraries")
PARAM_CFG_ARRAY
&
CVPCB_MAINFRAME
::
GetProjectFileParameters
()
{
if
(
!
m_projectFileParams
.
empty
()
)
return
m_projectFileParams
;
m_projectFileParams
.
push_back
(
new
PARAM_CFG_BASE
(
GROUP
LIB
,
PARAM_COMMAND_ERASE
)
);
m_projectFileParams
.
push_back
(
new
PARAM_CFG_BASE
(
GROUP
_PCB_LIBS
,
PARAM_COMMAND_ERASE
)
);
m_projectFileParams
.
push_back
(
new
PARAM_CFG_LIBNAME_LIST
(
wxT
(
"LibName"
),
&
m_ModuleLibNames
,
GROUP
LIB
)
);
wxT
(
"LibName"
),
&
m_ModuleLibNames
,
GROUP
_PCB_LIBS
)
);
m_projectFileParams
.
push_back
(
new
PARAM_CFG_LIBNAME_LIST
(
wxT
(
"EquName"
),
&
m_AliasLibNames
,
GROUPEQU
)
);
wxT
(
"EquName"
),
&
m_AliasLibNames
,
GROUP
_CVP_
EQU
)
);
m_projectFileParams
.
push_back
(
new
PARAM_CFG_WXSTRING
(
wxT
(
"NetIExt"
),
&
m_NetlistFileExtension
)
);
m_projectFileParams
.
push_back
(
new
PARAM_CFG_FILENAME
(
wxT
(
"LibDir"
),
&
m_UserLibraryPath
,
GROUP
LIB
)
);
wxT
(
"LibDir"
),
&
m_UserLibraryPath
,
GROUP
_PCB_LIBS
)
);
return
m_projectFileParams
;
}
...
...
@@ -81,7 +76,7 @@ void CVPCB_MAINFRAME::LoadProjectFile( const wxString& aFileName )
fn
.
SetExt
(
ProjectFileExtension
);
// was: Pgm().ReadProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParameters(), false );
prj
.
ConfigLoad
(
prj
.
PcbSearchS
(),
fn
.
GetFullPath
(),
GROU
P
,
GetProjectFileParameters
(),
false
);
prj
.
ConfigLoad
(
Kiface
().
KifaceSearch
(),
fn
.
GetFullPath
(),
GROUP_CV
P
,
GetProjectFileParameters
(),
false
);
if
(
m_NetlistFileExtension
.
IsEmpty
()
)
m_NetlistFileExtension
=
wxT
(
"net"
);
...
...
@@ -133,7 +128,7 @@ void CVPCB_MAINFRAME::SaveProjectFile( wxCommandEvent& aEvent )
// Pgm().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParameters() );
PROJECT
&
prj
=
Prj
();
SEARCH_STACK
&
search
=
prj
.
SchSearchS
();
prj
.
ConfigSave
(
search
,
fn
.
GetFullPath
(),
GROU
P
,
GetProjectFileParameters
()
);
prj
.
ConfigSave
(
Kiface
().
KifaceSearch
(),
fn
.
GetFullPath
(),
GROUP_CV
P
,
GetProjectFileParameters
()
);
}
cvpcb/readwrite_dlgs.cpp
View file @
d053e561
...
...
@@ -138,27 +138,36 @@ void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName )
static
bool
missingLegacyLibs
(
FP_LIB_TABLE
*
aTbl
,
SEARCH_STACK
&
aSStack
,
const
wxArrayString
&
aLibNames
,
wxString
*
aErrorMsg
)
{
bool
retv
=
false
;
bool
missing
=
false
;
for
(
unsigned
i
=
0
;
i
<
aLibNames
.
GetCount
();
i
++
)
{
wxFileName
fn
(
wxEmptyString
,
aLibNames
[
i
],
LegacyFootprintLibPathExtension
);
wxString
legacyLibPath
=
aSStack
.
FindValidPath
(
fn
);
wxString
legacyLibPath
=
aSStack
.
FindValidPath
(
fn
.
GetFullPath
()
);
/*
if( legacyLibPath.IsEmpty() )
continue;
*/
if
(
aTbl
->
FindRowByURI
(
legacyLibPath
)
==
0
)
if
(
!
aTbl
->
FindRowByURI
(
legacyLibPath
)
)
{
retv
=
true
;
missing
=
true
;
if
(
aErrorMsg
)
*
aErrorMsg
+=
wxT
(
"
\"
"
)
+
legacyLibPath
+
wxT
(
"
\"\n
"
);
{
*
aErrorMsg
+=
wxChar
(
'"'
);
if
(
!
legacyLibPath
)
*
aErrorMsg
+=
!
legacyLibPath
?
aLibNames
[
i
]
:
legacyLibPath
;
*
aErrorMsg
+=
wxT
(
"
\"\n
"
);
}
}
}
return
retv
;
return
missing
;
}
...
...
@@ -210,7 +219,7 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
if
(
missingLegacyLibs
(
FootprintLibs
(),
Prj
().
PcbSearchS
(),
m_ModuleLibNames
,
&
missingLibs
)
)
{
msg
=
wxT
(
"The following legacy libraries are defined in the project file "
"were not found in the footprint library table:
\n\n
"
)
+
missingLibs
;
"
but
were not found in the footprint library table:
\n\n
"
)
+
missingLibs
;
msg
+=
wxT
(
"
\n
Do you want to update the footprint library table before "
"attempting to update the assigned footprints?"
);
...
...
@@ -237,7 +246,7 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
{
HTML_MESSAGE_BOX
dlg
(
this
,
wxEmptyString
);
dlg
.
MessageSet
(
wxT
(
"The following errors occurred attempt to convert the "
dlg
.
MessageSet
(
wxT
(
"The following errors occurred attempt
ing
to convert the "
"footprint assignments:
\n\n
"
)
);
dlg
.
ListSet
(
msg
);
dlg
.
MessageSet
(
wxT
(
"
\n
You will need to reassign them manually if you want them "
...
...
eeschema/eelibs_read_libraryfiles.cpp
View file @
d053e561
...
...
@@ -62,7 +62,7 @@ void SCH_EDIT_FRAME::LoadLibraries()
if
(
!
fn
.
FileExists
()
)
{
tmp
=
lib_search
.
FindValidPath
(
fn
);
tmp
=
lib_search
.
FindValidPath
(
fn
.
GetFullPath
()
);
if
(
!
tmp
)
{
...
...
eeschema/eeschema_config.cpp
View file @
d053e561
...
...
@@ -370,7 +370,7 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParametersList()
&
m_userLibraryPath
)
);
m_projectFileParams
.
push_back
(
new
PARAM_CFG_LIBNAME_LIST
(
wxT
(
"LibName"
),
&
m_componentLibFiles
,
GROUP
LIB
)
);
GROUP
_SCH_LIBS
)
);
m_projectFileParams
.
push_back
(
new
PARAM_CFG_WXSTRING
(
wxT
(
"NetFmtName"
),
&
m_netListFormat
)
);
...
...
@@ -410,7 +410,7 @@ bool SCH_EDIT_FRAME::LoadProjectFile( const wxString& aFileName, bool aForceRere
// extension (.pro).
fn
.
SetExt
(
ProjectFileExtension
);
if
(
!
prj
.
ConfigLoad
(
Kiface
().
KifaceSearch
(),
fn
.
GetFullPath
(),
GROUP
,
if
(
!
prj
.
ConfigLoad
(
Kiface
().
KifaceSearch
(),
fn
.
GetFullPath
(),
GROUP
_SCH
,
GetProjectFileParametersList
(),
!
aForceReread
)
)
{
m_componentLibFiles
=
liblist_tmp
;
...
...
@@ -429,7 +429,7 @@ bool SCH_EDIT_FRAME::LoadProjectFile( const wxString& aFileName, bool aForceRere
pglayout
.
SetPageLayout
(
BASE_SCREEN
::
m_PageLayoutDescrFileName
);
// libraries in the *.pro file take precedence over standard library search paths,
// but not over the director of the project, which is at index 0.
// but not over the director
y
of the project, which is at index 0.
prj
.
SchSearchS
().
AddPaths
(
m_userLibraryPath
,
1
);
// If the list is empty, force loading the standard power symbol library.
...
...
@@ -466,7 +466,7 @@ void SCH_EDIT_FRAME::SaveProjectSettings( bool aAskForSave )
}
prj
.
ConfigSave
(
Kiface
().
KifaceSearch
(),
fn
.
GetFullPath
(),
GROUP
,
GetProjectFileParametersList
()
);
fn
.
GetFullPath
(),
GROUP
_SCH
,
GetProjectFileParametersList
()
);
}
...
...
eeschema/eeschema_config.h
View file @
d053e561
...
...
@@ -4,9 +4,6 @@
#include <config_params.h>
#define GROUP wxT( "/eeschema" )
#define GROUPCOMMON wxT( "/common" )
#define GROUPLIB wxT( "libraries" )
/* saving parameters option : */
#define INSETUP true
/* used when the parameter is saved in general config
...
...
eeschema/schframe.cpp
View file @
d053e561
...
...
@@ -868,7 +868,7 @@ void SCH_EDIT_FRAME::OnPrint( wxCommandEvent& event )
// was: wxGetApp().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParametersList() );
Prj
().
ConfigSave
(
Kiface
().
KifaceSearch
(),
fn
.
GetFullPath
(),
GROUP
,
GetProjectFileParametersList
()
);
fn
.
GetFullPath
(),
GROUP
_SCH
,
GetProjectFileParametersList
()
);
}
}
...
...
include/config_params.h
View file @
d053e561
...
...
@@ -37,6 +37,17 @@
#include <limits>
#define GROUP_PCB wxT( "/pcbnew" )
#define GROUP_SCH wxT( "/eeschema" )
#define GROUP_PCB_LIBS wxT( "/pcbnew/libraries" )
#define GROUP_SCH_LIBS wxT( "/eeschema/libraries" )
#define GROUP_COMMON wxT( "/common" )
#define GROUP_CVP wxT("/cvpcb")
//#define GROUP_CVP_LIBS wxT("/pcbnew/libraries")
#define GROUP_CVP_EQU wxT("/cvpcb/libraries")
#define CONFIG_VERSION 1
#define FORCE_LOCAL_CONFIG true
...
...
include/search_stack.h
View file @
d053e561
...
...
@@ -39,21 +39,6 @@ public:
return
wxPathList
::
FindValidPath
(
aFileName
);
}
/**
* Function FindValidPath
* KiCad saves user defined library files that are not in the standard
* library search path list with the full file path. Calling the library
* search path list with a user library file will fail. This helper method
* solves that problem.
* @param fileName
* @return a wxEmptyString if library file is not found.
*/
wxString
FindValidPath
(
const
wxFileName
&
aFileName
)
const
{
// call wxPathList::FindValidPath( const wxString& );
return
wxPathList
::
FindValidPath
(
aFileName
.
GetFullPath
()
);
}
/**
* Function AddPaths
* insert or append path(s)
...
...
pcbnew/CMakeLists.txt
View file @
d053e561
...
...
@@ -341,13 +341,10 @@ if( KICAD_SCRIPTING )
COMMAND
${
SWIG_EXECUTABLE
}
${
SWIG_OPTS
}
-o
${
CMAKE_CURRENT_BINARY_DIR
}
/pcbnew_wrap.cxx scripting/pcbnew.i
COMMAND
${
PYTHON_EXECUTABLE
}
${
CMAKE_SOURCE_DIR
}
/scripting/build_tools/fix_swig_imports.py
${
CMAKE_CURRENT_BINARY_DIR
}
/pcbnew.py
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
)
endif
()
###
# _pcbnew DLL/DSO file creation
###
if
(
BUILD_GITHUB_PLUGIN
)
set
(
GITHUB_PLUGIN_LIBRARIES github_plugin
)
...
...
@@ -396,7 +393,8 @@ if( KICAD_SCRIPTING_MODULES )
if
(
MAKE_LINK_MAPS
)
set_target_properties
(
_pcbnew PROPERTIES
LINK_FLAGS
"
${
TO_LINKER
}
,-cref
${
TO_LINKER
}
,-Map=pcbnew.so.map"
)
LINK_FLAGS
"
${
TO_LINKER
}
,-cref
${
TO_LINKER
}
,-Map=pcbnew.so.map"
)
endif
()
endif
()
...
...
@@ -417,14 +415,13 @@ if( DOXYGEN_FOUND )
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
DEPENDS Doxyfile_xml
COMMENT
"building doxygen docs into directory doxygen-python/html"
)
)
# create .i files from XML doxygen parsing, docstrings.i will include all of them
add_custom_target
(
xml-to-docstrings
COMMAND
${
CMAKE_COMMAND
}
-E remove_directory docstrings
COMMAND
${
CMAKE_COMMAND
}
-E make_directory docstrings
COMMAND
${
PYTHON_EXECUTABLE
}
${
CMAKE_SOURCE_DIR
}
/scripting/build_tools/extract_docstrings.py pcbnew.py doxygen-xml/xml docstrings
COMMAND
${
CMAKE_COMMAND
}
-E remove pcbnew.py
# force removal so it will be recreated later with the new docstrings
COMMENT
"building docstring files"
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
...
...
@@ -440,16 +437,14 @@ if( DOXYGEN_FOUND )
DEPENDS Doxyfile_python
DEPENDS xml-to-docstrings
DEPENDS pcbnew.py
COMMENT
"building doxygen docs into directory doxygen-python/html"
)
)
endif
()
else
()
message
(
STATUS
"WARNING: Doxygen not found - doxygen-docs (Source Docs) target not created"
)
endif
()
if
(
MINGW
)
# PCBNEW_RESOURCES variable is set by the macro.
mingw_resource_compiler
(
pcbnew
)
...
...
@@ -480,9 +475,8 @@ add_custom_command(
from
${
CMAKE_CURRENT_SOURCE_DIR
}
/dialogs/dialog_freeroute_exchange_help.html"
)
set_source_files_properties
(
dialogs/dialog_freeroute_exchange.cpp
PROPERTIES
OBJECT_DEPENDS
${
CMAKE_CURRENT_SOURCE_DIR
}
/dialogs/dialog_freeroute_exchange_help_html.h
set_source_files_properties
(
dialogs/dialog_freeroute_exchange.cpp PROPERTIES
OBJECT_DEPENDS
${
CMAKE_CURRENT_SOURCE_DIR
}
/dialogs/dialog_freeroute_exchange_help_html.h
)
...
...
@@ -506,14 +500,14 @@ endif()
if
(
USE_KIWAY_DLLS
)
#if( false )
# a very small program launcher for pcbnew_kiface
add_executable
(
pcbnew WIN32 MACOSX_BUNDLE
../common/single_top.cpp
../common/pgm_base.cpp
${
PCBNEW_RESOURCES
}
)
set_source_files_properties
(
../common/single_top.cpp PROPERTIES
set_source_files_properties
(
../common/single_top.cpp
pcbnew.cpp
PROPERTIES
COMPILE_DEFINITIONS
"TOP_FRAME=PCB_FRAME_TYPE;PGM_DATA_FILE_EXT=
\"
kicad_pcb
\"
;BUILD_KIWAY_DLL"
)
target_link_libraries
(
pcbnew
...
...
@@ -534,9 +528,7 @@ if( USE_KIWAY_DLLS )
${
PCBNEW_SRCS
}
${
PCBNEW_COMMON_SRCS
}
${
PCBNEW_SCRIPTING_SRCS
}
# ${PCBNEW_RESOURCES}
)
set_target_properties
(
pcbnew_kiface PROPERTIES
# Decorate OUTPUT_NAME with PREFIX and SUFFIX, creating something like
# _pcbnew.so, _pcbnew.dll, or _pcbnew.kiface
...
...
@@ -547,7 +539,7 @@ if( USE_KIWAY_DLLS )
if
(
${
OPENMP_FOUND
}
)
set_target_properties
(
pcbnew_kiface PROPERTIES
COMPILE_FLAGS
${
OpenMP_CXX_FLAGS
}
)
)
endif
()
target_link_libraries
(
pcbnew_kiface
...
...
@@ -578,7 +570,11 @@ if( USE_KIWAY_DLLS )
)
if
(
MAKE_LINK_MAPS
)
set_target_properties
(
pcbnew_kiface PROPERTIES
LINK_FLAGS
"
${
TO_LINKER
}
,-cref
${
TO_LINKER
}
,-Map=_pcbnew.kiface.map"
)
LINK_FLAGS
"
${
TO_LINKER
}
,-cref
${
TO_LINKER
}
,-Map=_pcbnew.kiface.map"
)
set_target_properties
(
pcbnew PROPERTIES
LINK_FLAGS
"
${
TO_LINKER
}
,-cref
${
TO_LINKER
}
,-Map=pcbnew.map"
)
endif
()
# if building pcbnew, then also build pcbnew_kiface if out of date.
...
...
@@ -600,18 +596,22 @@ if( USE_KIWAY_DLLS )
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
CMAKE_BINARY_DIR
}
/pcbnew/_pcbnew.kiface
"
${
CMAKE_BINARY_DIR
}
/pcbnew/pcbnew.app/Contents/MacOS/"
DEPENDS pcbnew_kiface
COMMENT
"Copying kiface into pcbnew"
)
)
endif
()
else
()
# milestone A) kills this off:
add_executable
(
pcbnew WIN32 MACOSX_BUNDLE
../common/single_top.cpp
pcbnew.cpp
${
PCBNEW_SRCS
}
${
PCBNEW_COMMON_SRCS
}
${
PCBNEW_SCRIPTING_SRCS
}
${
PCBNEW_RESOURCES
}
)
set_source_files_properties
(
../common/single_top.cpp PROPERTIES
COMPILE_DEFINITIONS
"TOP_FRAME=PCB_FRAME_TYPE;PGM_DATA_FILE_EXT=
\"
kicad_pcb
\"
"
)
target_link_libraries
(
pcbnew
3d-viewer
pcbcommon
...
...
@@ -646,28 +646,25 @@ else() # milestone A) kills this off:
)
endif
()
if
(
MAKE_LINK_MAPS
)
# generate a link map with cross reference
set_target_properties
(
pcbnew PROPERTIES
LINK_FLAGS
"
${
TO_LINKER
}
,-cref
${
TO_LINKER
}
,-Map=pcbnew.map"
)
endif
()
install
(
TARGETS pcbnew
DESTINATION
${
KICAD_BIN
}
COMPONENT binary
)
endif
()
add_dependencies
(
pcbnew lib-dependencies
)
###
# Set properties for APPLE on pcbnew target
###
if
(
APPLE
)
set_target_properties
(
pcbnew PROPERTIES
MACOSX_BUNDLE_INFO_PLIST
${
CMAKE_CURRENT_SOURCE_DIR
}
/Info.plist
)
endif
()
if
(
MAKE_LINK_MAPS
)
# generate a link map with cross reference
set_target_properties
(
pcbnew PROPERTIES
LINK_FLAGS
"
${
TO_LINKER
}
,-cref
${
TO_LINKER
}
,-Map=pcbnew.map"
)
MACOSX_BUNDLE_INFO_PLIST
${
CMAKE_CURRENT_SOURCE_DIR
}
/Info.plist
)
endif
()
...
...
@@ -686,19 +683,19 @@ if( KICAD_SCRIPTING )
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
CMAKE_BINARY_DIR
}
/pcbnew/pcbnew.py
"
${
PYTHON_DEST
}
/wx-3.0-osx_cocoa/"
DEPENDS FixSwigImportsScripting
COMMENT
"Copying pcbnew.py into PYTHON_DEST/wx-3.0-osx_cocoa/"
)
)
add_custom_target
(
pcbnew_copy_wxpython_scripting ALL
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
LIBWXPYTHON_ROOT
}
/wxPython/
${
CMAKE_SOURCE_DIR
}
/pcbnew/pcbnew.app/Contents/Frameworks/wxPython/
DEPENDS FixSwigImportsScripting _pcbnew_py_copy
COMMENT
"Copying wxPython into pcbnew.app Framework"
)
)
add_custom_target
(
pcbnew_copy_plugins ALL
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
PROJECT_SOURCE_DIR
}
/pcbnew/scripting/plugins
${
PROJECT_SOURCE_DIR
}
/pcbnew/pcbnew.app/Contents/PlugIns/scripting/plugins
DEPENDS pcbnew_copy_wxpython_scripting
COMMENT
"Copying plugins into bundle"
)
)
# fix bundle after copying wxpython, fixing and copying
add_dependencies
(
osx_fix_bundles pcbnew_copy_wxpython_scripting
)
...
...
@@ -733,13 +730,13 @@ if( KICAD_SCRIPTING_MODULES )
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
CMAKE_BINARY_DIR
}
/pcbnew/_pcbnew.so
"
${
PYTHON_DEST
}
"
DEPENDS _pcbnew FixSwigImportsModuleScripting
COMMENT
"Copying _pcbnew.so into PYTHON_DEST"
)
)
add_custom_target
(
pcbnew_copy_wxpython_module ALL
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
LIBWXPYTHON_ROOT
}
/wxPython/
${
PROJECT_SOURCE_DIR
}
/pcbnew/pcbnew.app/Contents/Frameworks/wxPython/
DEPENDS FixSwigImportsModuleScripting _pcbnew_so_copy
COMMENT
"Copying wxPython into pcbnew.app Frameworks"
)
)
if
(
KICAD_BUILD_DYNAMIC
)
# Tell that we have to run osx_fix_bundles fix after building _pcbnew and migrating wxPython
...
...
@@ -750,14 +747,15 @@ if( KICAD_SCRIPTING_MODULES )
endif
()
# This one gets made only when testing
.
add_executable
(
specctra_test EXCLUDE_FROM_ALL specctra_test.cpp specctra.cpp
)
target_link_libraries
(
specctra_test common
${
wxWidgets_LIBRARIES
}
)
if
(
false
)
# haven't been used in years
.
# This one gets made only when testing.
add_executable
(
specctra_test EXCLUDE_FROM_ALL specctra_test.cpp specctra.cpp
)
target_link_libraries
(
specctra_test common
${
wxWidgets_LIBRARIES
}
)
# This one gets made only when testing.
add_executable
(
layer_widget_test WIN32 EXCLUDE_FROM_ALL
layer_widget.cpp
)
target_link_libraries
(
layer_widget_test common
${
wxWidgets_LIBRARIES
}
)
# This one gets made only when testing.
add_executable
(
layer_widget_test WIN32 EXCLUDE_FROM_ALL
layer_widget.cpp
)
target_link_libraries
(
layer_widget_test common
${
wxWidgets_LIBRARIES
}
)
endif
()
pcbnew/dialogs/dialog_netlist.cpp
View file @
d053e561
...
...
@@ -91,7 +91,7 @@ void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC )
// was: wxGetApp().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParameters() );
Prj
().
ConfigSave
(
Kiface
().
KifaceSearch
(),
fn
.
GetFullPath
(),
GROUP
,
GetProjectFileParameters
()
);
GROUP
_PCB
,
GetProjectFileParameters
()
);
}
}
...
...
pcbnew/pcbnew.cpp
View file @
d053e561
...
...
@@ -208,13 +208,13 @@ MY_API( KIFACE* ) KIFACE_GETTER( int* aKIFACEversion, int aKiwayVersion, PGM_BA
return
&
kiface
;
}
#if defined(BUILD_KIWAY_DLL)
PGM_BASE
&
Pgm
()
{
wxASSERT
(
process
);
// KIFACE_GETTER has already been called.
return
*
process
;
}
#endif
/**
* Function set3DShapesPath
...
...
@@ -484,6 +484,5 @@ void IFACE::OnKifaceEnd()
// This should only be called if python was setup correctly.
pcbnewFinishPythonScripting
();
#endif
}
pcbnew/pcbnew_config.cpp
View file @
d053e561
...
...
@@ -29,7 +29,6 @@
*/
#include <fctsys.h>
//#include <pgm_base.h>
#include <kiface_i.h>
#include <project.h>
#include <class_drawpanel.h>
...
...
@@ -239,7 +238,7 @@ bool PCB_EDIT_FRAME::LoadProjectSettings( const wxString& aProjectFileName )
fn
.
SetExt
(
ProjectFileExtension
);
// was: wxGetApp().ReadProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParameters(), false );
Prj
().
ConfigLoad
(
Kiface
().
KifaceSearch
(),
fn
.
GetFullPath
(),
GROUP
,
GetProjectFileParameters
(),
false
);
Prj
().
ConfigLoad
(
Kiface
().
KifaceSearch
(),
fn
.
GetFullPath
(),
GROUP
_PCB
,
GetProjectFileParameters
(),
false
);
// Dick 5-Feb-2012: I don't agree with this, the BOARD contents should dictate
// what is visible or not, even initially. And since PCB_EDIT_FRAME projects settings
...
...
@@ -302,9 +301,7 @@ void PCB_EDIT_FRAME::SaveProjectSettings( bool aAskForSave )
fn
=
dlg
.
GetPath
();
}
SEARCH_STACK
&
search
=
Kiface
().
KifaceSearch
();
Prj
().
ConfigSave
(
search
,
fn
.
GetFullPath
(),
GROUP
,
GetProjectFileParameters
()
);
Prj
().
ConfigSave
(
Kiface
().
KifaceSearch
(),
fn
.
GetFullPath
(),
GROUP_PCB
,
GetProjectFileParameters
()
);
}
...
...
@@ -315,7 +312,7 @@ PARAM_CFG_ARRAY PCB_EDIT_FRAME::GetProjectFileParameters()
pca
.
push_back
(
new
PARAM_CFG_FILENAME
(
wxT
(
"PageLayoutDescrFile"
),
&
BASE_SCREEN
::
m_PageLayoutDescrFileName
)
);
pca
.
push_back
(
new
PARAM_CFG_FILENAME
(
wxT
(
"LibDir"
),
&
g_UserLibDirBuffer
,
GROUP
LIB
)
);
pca
.
push_back
(
new
PARAM_CFG_FILENAME
(
wxT
(
"LibDir"
),
&
g_UserLibDirBuffer
,
GROUP
_PCB_LIBS
)
);
pca
.
push_back
(
new
PARAM_CFG_FILENAME
(
wxT
(
"LastNetListRead"
),
&
m_lastNetListRead
)
);
...
...
pcbnew/pcbnew_config.h
View file @
d053e561
/**
* @file pcbnew_config.h
* @brief C
c
onfiguration parameters for Pcbnew.
* @brief Configuration parameters for Pcbnew.
*/
#ifndef _PCBNEW_CONFIG_H_
...
...
@@ -9,10 +9,6 @@
#include <config_params.h>
#include <colors_selection.h>
#define GROUP wxT( "/pcbnew" )
#define GROUPLIB wxT( "/pcbnew/libraries" )
#define GROUPCOMMON wxT( "/common" )
/* Useful macro : */
#define LOC_COLOR(layer) &g_ColorsSettings.m_LayersColors[layer]
#define ITEM_COLOR(item_visible) &g_ColorsSettings.m_ItemsColors[item_visible]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment