diff --git a/CMakeLists.txt b/CMakeLists.txt index e719d5c601..5c061111f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 build +# Always defined, empty if no libraries are to be built add_custom_target( lib-dependencies ) if( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC ) - # This should be build in all cases, if swig exec is not avaiable - # will be impossible also enable SCRIPTING being for PCBNEW required immediatly + # This should be built in all cases, if swig exec is not avaiable + # will be impossible also enable SCRIPTING being for PCBNEW required immediately include( download_pcre ) include( download_swig ) diff --git a/common/fp_lib_table.cpp b/common/fp_lib_table.cpp index 8c0d6f5a29..2605aa7125 100644 --- a/common/fp_lib_table.cpp +++ b/common/fp_lib_table.cpp @@ -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 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 ) { diff --git a/common/project.cpp b/common/project.cpp index b69926e574..3e3c9cdf84 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -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 ) diff --git a/common/single_top.cpp b/common/single_top.cpp index efb530e261..9aeb9c178f 100644 --- a/common/single_top.cpp +++ b/common/single_top.cpp @@ -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 diff --git a/cvpcb/autosel.cpp b/cvpcb/autosel.cpp index 2b40fa4e40..9a96a02457 100644 --- a/cvpcb/autosel.cpp +++ b/cvpcb/autosel.cpp @@ -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 ) { diff --git a/cvpcb/cfg.cpp b/cvpcb/cfg.cpp index c7b5986362..55d2091048 100644 --- a/cvpcb/cfg.cpp +++ b/cvpcb/cfg.cpp @@ -27,7 +27,7 @@ */ #include -#include +#include #include #include #include @@ -42,29 +42,24 @@ #include -#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( GROUPLIB, 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, GROUPLIB ) ); + 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, GROUPLIB ) ); + 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(), GROUP, GetProjectFileParameters(), false ); + prj.ConfigLoad( Kiface().KifaceSearch(), fn.GetFullPath(), GROUP_CVP, 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(), GROUP, GetProjectFileParameters() ); + prj.ConfigSave( Kiface().KifaceSearch(), fn.GetFullPath(), GROUP_CVP, GetProjectFileParameters() ); } + diff --git a/cvpcb/readwrite_dlgs.cpp b/cvpcb/readwrite_dlgs.cpp index 6c07864ae0..70ae6ece2f 100644 --- a/cvpcb/readwrite_dlgs.cpp +++ b/cvpcb/readwrite_dlgs.cpp @@ -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( "\nDo 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 attempting to convert the " "footprint assignments:\n\n" ) ); dlg.ListSet( msg ); dlg.MessageSet( wxT( "\nYou will need to reassign them manually if you want them " diff --git a/eeschema/eelibs_read_libraryfiles.cpp b/eeschema/eelibs_read_libraryfiles.cpp index 8eaaafd8de..56b4e733eb 100644 --- a/eeschema/eelibs_read_libraryfiles.cpp +++ b/eeschema/eelibs_read_libraryfiles.cpp @@ -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 ) { diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index e335d9d4b6..5623b3cadb 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -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, - GROUPLIB ) ); + 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 directory 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() ); } diff --git a/eeschema/eeschema_config.h b/eeschema/eeschema_config.h index 8bdfa54ec6..e771964aaa 100644 --- a/eeschema/eeschema_config.h +++ b/eeschema/eeschema_config.h @@ -4,9 +4,6 @@ #include -#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 diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index fa7cb5c5df..a2fba0988d 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -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() ); } } diff --git a/include/config_params.h b/include/config_params.h index a8002e0a9e..e83899af85 100644 --- a/include/config_params.h +++ b/include/config_params.h @@ -37,6 +37,17 @@ #include +#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 diff --git a/include/search_stack.h b/include/search_stack.h index 29cf8af7b5..c3dd9a1b9a 100644 --- a/include/search_stack.h +++ b/include/search_stack.h @@ -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) diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index d16eb9f04f..90365cfb33 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -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() diff --git a/pcbnew/dialogs/dialog_netlist.cpp b/pcbnew/dialogs/dialog_netlist.cpp index e7cb66c29e..2d4f572f12 100644 --- a/pcbnew/dialogs/dialog_netlist.cpp +++ b/pcbnew/dialogs/dialog_netlist.cpp @@ -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() ); } } diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index a8eac6b21a..c9a4129e1b 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -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 } diff --git a/pcbnew/pcbnew_config.cpp b/pcbnew/pcbnew_config.cpp index 0a8934f528..a9870c279d 100644 --- a/pcbnew/pcbnew_config.cpp +++ b/pcbnew/pcbnew_config.cpp @@ -29,7 +29,6 @@ */ #include -//#include #include #include #include @@ -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, GROUPLIB ) ); + 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 ) ); diff --git a/pcbnew/pcbnew_config.h b/pcbnew/pcbnew_config.h index a0b0006bbd..f4c153e6cd 100644 --- a/pcbnew/pcbnew_config.h +++ b/pcbnew/pcbnew_config.h @@ -1,6 +1,6 @@ /** * @file pcbnew_config.h - * @brief Cconfiguration parameters for Pcbnew. + * @brief Configuration parameters for Pcbnew. */ #ifndef _PCBNEW_CONFIG_H_ @@ -9,10 +9,6 @@ #include #include -#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]