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
f06bfe6d
Commit
f06bfe6d
authored
Oct 17, 2014
by
Bernhard Stegmaier
Committed by
Wayne Stambaugh
Oct 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit the rest of the OSX build fixes missed in the previous commit.
parent
816974b8
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
371 additions
and
167 deletions
+371
-167
CMakeLists.txt
CMakeLists.txt
+40
-2
mac-osx.txt
Documentation/compiling/mac-osx.txt
+2
-0
gestfich.cpp
common/gestfich.cpp
+35
-20
kiway.cpp
common/kiway.cpp
+6
-4
pgm_base.cpp
common/pgm_base.cpp
+22
-29
project.cpp
common/project.cpp
+5
-0
CMakeLists.txt
cvpcb/CMakeLists.txt
+42
-15
CMakeLists.txt
eeschema/CMakeLists.txt
+41
-15
Info.plist
eeschema/Info.plist
+1
-3
dialog_bom.cpp
eeschema/dialogs/dialog_bom.cpp
+4
-0
dialog_netlist.cpp
eeschema/dialogs/dialog_netlist.cpp
+4
-0
CMakeLists.txt
gerbview/CMakeLists.txt
+41
-15
CMakeLists.txt
kicad/CMakeLists.txt
+30
-14
prjconfig.cpp
kicad/prjconfig.cpp
+6
-0
CMakeLists.txt
pagelayout_editor/CMakeLists.txt
+43
-15
Info.plist
pagelayout_editor/Info.plist
+1
-3
CMakeLists.txt
pcb_calculator/CMakeLists.txt
+38
-15
pcbnew.cpp
pcbnew/pcbnew.cpp
+10
-17
No files found.
CMakeLists.txt
View file @
f06bfe6d
...
...
@@ -349,8 +349,9 @@ if( APPLE )
set
(
OSX_BUNDLE_MAIN
"kicad.app"
)
set
(
OSX_BUNDLE_BIN_DIR
"Contents/MacOS"
)
set
(
OSX_BUNDLE_LIB_DIR
"Contents/Frameworks"
)
set
(
OSX_BUNDLE_KIFACE_DIR
"Contents/Plug
i
ns"
)
set
(
OSX_BUNDLE_KIFACE_DIR
"Contents/Plug
I
ns"
)
set
(
OSX_BUNDLE_SUP_DIR
"Contents/SharedSupport"
)
set
(
OSX_BUNDLE_APP_DIR
"Contents/Applications"
)
set
(
OSX_BUNDLE_BUILD_DIR
"
${
CMAKE_BINARY_DIR
}
/kicad/
${
OSX_BUNDLE_MAIN
}
"
)
set
(
OSX_BUNDLE_BUILD_BIN_DIR
"
${
OSX_BUNDLE_BUILD_DIR
}
/
${
OSX_BUNDLE_BIN_DIR
}
"
)
set
(
OSX_BUNDLE_BUILD_LIB_DIR
"
${
OSX_BUNDLE_BUILD_DIR
}
/
${
OSX_BUNDLE_LIB_DIR
}
"
)
...
...
@@ -377,6 +378,24 @@ if( APPLE )
# 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 )
# by default, embed things right next to the main bundle executable:
set( path
\"
@executable_path/../../Contents/MacOS
\"
)
set( overridden 0 )
# embed .dylibs right next to the main bundle executable:
if( item MATCHES
\"\\\\
.dylib$
\"
)
set( path
\"
@executable_path/../Frameworks
\"
)
set( overridden 1 )
endif()
set(
\$
{default_embedded_path_var}
\"\$
{path}
\"
PARENT_SCOPE )
endfunction(gp_item_default_embedded_path_override)
"
)
endif
()
mark_as_advanced
(
KICAD_BIN
...
...
@@ -614,7 +633,7 @@ if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
)
else
()
# relative path for python in bundle
set
(
PYTHON_LIB_DIR
"python"
)
set
(
PYTHON_LIB_DIR
"python
/site-packages
"
)
# install into bundle Frameworks folder
set
(
PYTHON_DEST
"
${
OSX_BUNDLE_BUILD_LIB_DIR
}
/
${
PYTHON_LIB_DIR
}
"
CACHE PATH
"Python module install path."
...
...
@@ -655,6 +674,25 @@ endif()
# 'CMakeLists.txt' files to process
#================================================
if
(
APPLE
)
# Remove app bundles in ${KICAD_BIN} before installing anything new.
# Must be defined before all includes so that it is executed first.
install
(
CODE
"
message( STATUS
\"
Removing existing application bundles...
\"
)
# Remove links to standalone apps
file( REMOVE
${
KICAD_BIN
}
/bitmap2component.app )
file( REMOVE
${
KICAD_BIN
}
/eeschema.app )
file( REMOVE
${
KICAD_BIN
}
/cvpcb.app )
file( REMOVE
${
KICAD_BIN
}
/gerbview.app )
file( REMOVE
${
KICAD_BIN
}
/pcb_calculator.app )
file( REMOVE
${
KICAD_BIN
}
/pcbnew.app )
file( REMOVE
${
KICAD_BIN
}
/pl_editor.app )
# Remove main bundle
file( REMOVE_RECURSE
${
KICAD_BIN
}
/
${
OSX_BUNDLE_MAIN
}
)
"
COMPONENT Runtime
)
endif
()
############################
# Binaries ( CMake targets ) #
############################
...
...
Documentation/compiling/mac-osx.txt
View file @
f06bfe6d
...
...
@@ -100,6 +100,8 @@ target folder for compiled binaries, third parameter is the kicad folder, and
the last optional parameter are make options used during the build (in this
case for building with 4 jobs in parallel).
The script will automatically detect if you are compiling wxWidgets or wxPython.
NOTE: All paths are assumed to be relative to the current directory, i.e., the
working root you are in.
CAUTION: The script will erase existing wx-build and target folders (wx-bin)
without any confirmation!
...
...
common/gestfich.cpp
View file @
f06bfe6d
...
...
@@ -142,8 +142,11 @@ wxString FindKicadFile( const wxString& shortname )
{
// Test the presence of the file in the directory shortname of
// the KiCad binary path.
#ifndef __WXMAC__
wxString
fullFileName
=
Pgm
().
GetExecutablePath
()
+
shortname
;
#else
wxString
fullFileName
=
Pgm
().
GetExecutablePath
()
+
wxT
(
"Contents/MacOS/"
)
+
shortname
;
#endif
if
(
wxFileExists
(
fullFileName
)
)
return
fullFileName
;
...
...
@@ -157,16 +160,22 @@ wxString FindKicadFile( const wxString& shortname )
return
fullFileName
;
}
// find binary file from possibilities list:
// /usr/local/kicad/linux or c:/kicad/winexe
// Path list for KiCad binary files
const
static
wxChar
*
possibilities
[]
=
{
#if
def __WINDOWS__
#if
defined( __WINDOWS__ )
wxT
(
"c:/kicad/bin/"
),
wxT
(
"d:/kicad/bin/"
),
wxT
(
"c:/Program Files/kicad/bin/"
),
wxT
(
"d:/Program Files/kicad/bin/"
),
#elif defined( __WXMAC__ )
// all internal paths are relative to main bundle kicad.app
wxT
(
"Contents/Applications/cvpcb.app/Contents/MacOS/"
),
wxT
(
"Contents/Applications/pcbnew.app/Contents/MacOS/"
),
wxT
(
"Contents/Applications/eeschema.app/Contents/MacOS/"
),
wxT
(
"Contents/Applications/gerbview.app/Contents/MacOS/"
),
wxT
(
"Contents/Applications/bitmap2component.app/Contents/MacOS/"
),
wxT
(
"Contents/Applications/pcb_calculator.app/Contents/MacOS/"
),
wxT
(
"Contents/Applications/pl_editor.app/Contents/MacOS/"
),
#else
wxT
(
"/usr/bin/"
),
wxT
(
"/usr/local/bin/"
),
...
...
@@ -174,9 +183,15 @@ wxString FindKicadFile( const wxString& shortname )
#endif
};
// find binary file from possibilities list:
for
(
unsigned
i
=
0
;
i
<
DIM
(
possibilities
);
++
i
)
{
#ifndef __WXMAC__
fullFileName
=
possibilities
[
i
]
+
shortname
;
#else
// make relative paths absolute
fullFileName
=
Pgm
().
GetExecutablePath
()
+
possibilities
[
i
]
+
shortname
;
#endif
if
(
wxFileExists
(
fullFileName
)
)
return
fullFileName
;
...
...
@@ -189,31 +204,25 @@ wxString FindKicadFile( const wxString& shortname )
int
ExecuteFile
(
wxWindow
*
frame
,
const
wxString
&
ExecFile
,
const
wxString
&
param
,
wxProcess
*
callback
)
{
wxString
fullFileName
;
fullFileName
=
FindKicadFile
(
ExecFile
);
wxString
fullFileName
=
FindKicadFile
(
ExecFile
);
#ifdef __WXMAC__
if
(
wxFileExists
(
fullFileName
)
||
wxDir
::
Exists
(
fullFileName
)
)
if
(
wxFileExists
(
fullFileName
)
)
{
return
ProcessExecute
(
Pgm
().
GetExecutablePath
()
+
wxT
(
"/"
)
+
ExecFile
+
wxT
(
" "
)
+
param
,
wxEXEC_ASYNC
,
callback
);
if
(
!
param
.
IsEmpty
()
)
fullFileName
+=
wxT
(
" "
)
+
param
;
return
ProcessExecute
(
fullFileName
,
wxEXEC_ASYNC
,
callback
);
}
#ifdef __WXMAC__
else
{
return
ProcessExecute
(
wxT
(
"/usr/bin/open "
)
+
param
,
wxEXEC_ASYNC
,
callback
);
}
#else
if
(
wxFileExists
(
fullFileName
)
)
{
if
(
!
param
.
IsEmpty
()
)
fullFileName
+=
wxT
(
" "
)
+
param
;
return
ProcessExecute
(
fullFileName
,
wxEXEC_ASYNC
,
callback
);
return
ProcessExecute
(
wxT
(
"/usr/bin/open -a "
)
+
fullFileName
,
wxEXEC_ASYNC
,
callback
);
}
#endif
wxString
msg
;
msg
.
Printf
(
_
(
"Command <%s> could not found"
),
GetChars
(
fullFileName
)
);
DisplayError
(
frame
,
msg
,
20
);
...
...
@@ -233,6 +242,7 @@ wxString KicadDatasPath()
}
else
// Path of executables.
{
#ifndef __WXMAC__
wxString
tmp
=
Pgm
().
GetExecutablePath
();
#ifdef __WINDOWS__
tmp
.
MakeLower
();
...
...
@@ -303,6 +313,11 @@ wxString KicadDatasPath()
break
;
}
}
#else
// On OSX point to Contents/SharedSupport folder of main bundle
data_path
=
GetOSXKicadDataDir
();
found
=
true
;
#endif
}
if
(
found
)
...
...
common/kiway.cpp
View file @
f06bfe6d
...
...
@@ -113,11 +113,13 @@ const wxString KIWAY::dso_full_path( FACE_T aFaceId )
return
wxEmptyString
;
}
#ifndef __WXMAC__
wxFileName
fn
=
wxStandardPaths
::
Get
().
GetExecutablePath
();
#ifdef __WXMAC__
// we have the dso's in @executable_path/../Plugins in OSX bundle
fn
.
RemoveLastDir
();
fn
.
AppendDir
(
wxT
(
"Plugins"
)
);
#else
// we have the dso's in main OSX bundle kicad.app/Contents/PlugIns
wxFileName
fn
=
Pgm
().
GetExecutablePath
();
fn
.
AppendDir
(
wxT
(
"Contents"
)
);
fn
.
AppendDir
(
wxT
(
"PlugIns"
)
);
#endif
fn
.
SetName
(
name
);
...
...
common/pgm_base.cpp
View file @
f06bfe6d
...
...
@@ -412,38 +412,30 @@ bool PGM_BASE::initPgm()
bool
PGM_BASE
::
setExecutablePath
()
{
#ifdef __APPLE__ // Apple MacOSx
// Derive path from location of the app bundle
CFBundleRef
mainBundle
=
CFBundleGetMainBundle
();
if
(
mainBundle
==
NULL
)
return
false
;
CFURLRef
urlref
=
CFBundleCopyBundleURL
(
mainBundle
);
if
(
urlref
==
NULL
)
return
false
;
CFStringRef
str
=
CFURLCopyFileSystemPath
(
urlref
,
kCFURLPOSIXPathStyle
);
if
(
str
==
NULL
)
return
false
;
char
*
native_str
=
NULL
;
int
len
=
CFStringGetMaximumSizeForEncoding
(
CFStringGetLength
(
str
),
kCFStringEncodingUTF8
)
+
1
;
native_str
=
new
char
[
len
];
CFStringGetCString
(
str
,
native_str
,
len
,
kCFStringEncodingUTF8
);
m_bin_dir
=
FROM_UTF8
(
native_str
);
delete
[]
native_str
;
#else
m_bin_dir
=
wxStandardPaths
::
Get
().
GetExecutablePath
();
#endif
#ifdef __WXMAC__
// On OSX Pgm().GetExecutablePath() will always point to main
// bundle directory, e.g., /Applications/kicad.app/
wxFileName
fn
(
m_bin_dir
);
if
(
fn
.
GetName
()
==
wxT
(
"kicad"
)
)
{
// kicad launcher, so just remove the Contents/MacOS part
fn
.
RemoveLastDir
();
fn
.
RemoveLastDir
();
}
else
{
// standalone binaries live in Contents/Applications/<standalone>.app/Contents/MacOS
fn
.
RemoveLastDir
();
fn
.
RemoveLastDir
();
fn
.
RemoveLastDir
();
fn
.
RemoveLastDir
();
fn
.
RemoveLastDir
();
}
m_bin_dir
=
fn
.
GetPath
()
+
wxT
(
"/"
);
#else
// Use unix notation for paths. I am not sure this is a good idea,
// but it simplifies compatibility between Windows and Unices.
// However it is a potential problem in path handling under Windows.
...
...
@@ -452,6 +444,7 @@ bool PGM_BASE::setExecutablePath()
// Remove file name form command line:
while
(
m_bin_dir
.
Last
()
!=
'/'
&&
!
m_bin_dir
.
IsEmpty
()
)
m_bin_dir
.
RemoveLast
();
#endif
return
true
;
}
...
...
common/project.cpp
View file @
f06bfe6d
...
...
@@ -111,7 +111,12 @@ const wxString PROJECT::FootprintLibTblName() const
// application title which is no longer constant or known. This next line needs
// to be re-thought out.
#ifndef __WXMAC__
fn
.
AssignDir
(
wxStandardPaths
::
Get
().
GetUserConfigDir
()
);
#else
// don't pollute home folder, temp folder seems to be more appropriate
fn
.
AssignDir
(
wxStandardPaths
::
Get
().
GetTempDir
()
);
#endif
#if defined( __WINDOWS__ )
fn
.
AppendDir
(
wxT
(
"kicad"
)
);
...
...
cvpcb/CMakeLists.txt
View file @
f06bfe6d
...
...
@@ -53,8 +53,23 @@ if( MINGW )
endif
()
if
(
APPLE
)
# setup bundle
set
(
CVPCB_RESOURCES cvpcb.icns cvpcb_doc.icns
)
set_source_files_properties
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cvpcb.icns"
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources
)
set_source_files_properties
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cvpcb_doc.icns"
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources
)
set
(
MACOSX_BUNDLE_ICON_FILE cvpcb.icns
)
set
(
MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-eda.kicad
)
set
(
MACOSX_BUNDLE_NAME cvpcb
)
endif
()
if
(
USE_KIWAY_DLLS
)
add_executable
(
cvpcb WIN32
add_executable
(
cvpcb WIN32
MACOSX_BUNDLE
../common/single_top.cpp
../common/pgm_base.cpp
${
CVPCB_RESOURCES
}
...
...
@@ -141,13 +156,32 @@ if( USE_KIWAY_DLLS )
# these 2 binaries are a matched set, keep them together:
if
(
APPLE
)
# puts binaries into the *.app bundle while linking
set_target_properties
(
cvpcb PROPERTIES
RUNTIME_OUTPUT_DIRECTORY
${
OSX_BUNDLE_BUILD_BIN_DIR
}
MACOSX_BUNDLE_INFO_PLIST
${
CMAKE_CURRENT_SOURCE_DIR
}
/Info.plist
)
# puts binaries into the *.app bundle while linking
set_target_properties
(
cvpcb_kiface PROPERTIES
LIBRARY_OUTPUT_DIRECTORY
${
OSX_BUNDLE_BUILD_KIFACE_DIR
}
)
# put individual bundle outside of main bundle as a first step
# will be pulled into the main bundle when creating main bundle
install
(
TARGETS cvpcb
DESTINATION
${
KICAD_BIN
}
COMPONENT binary
)
install
(
CODE
"
# override default embedded path settings
${
OSX_BUNDLE_OVERRIDE_PATHS
}
# do all the work
include( BundleUtilities )
fixup_bundle(
${
KICAD_BIN
}
/cvpcb.app/Contents/MacOS/cvpcb
\"\"
\"\"
)
"
COMPONENT Runtime
)
else
()
install
(
TARGETS cvpcb
DESTINATION
${
KICAD_BIN
}
...
...
@@ -161,7 +195,7 @@ if( USE_KIWAY_DLLS )
else
()
add_executable
(
cvpcb WIN32
add_executable
(
cvpcb WIN32
MACOSX_BUNDLE
${
CVPCB_SRCS
}
${
CVPCB_DIALOGS
}
${
CVPCB_RESOURCES
}
...
...
@@ -201,15 +235,8 @@ else()
# Must follow github_plugin
target_link_libraries
(
cvpcb
${
Boost_LIBRARIES
}
)
if
(
APPLE
)
# puts binaries into the *.app bundle while linking
set_target_properties
(
cvpcb PROPERTIES
RUNTIME_OUTPUT_DIRECTORY
${
OSX_BUNDLE_BUILD_BIN_DIR
}
)
else
()
install
(
TARGETS cvpcb
DESTINATION
${
KICAD_BIN
}
COMPONENT binary
)
endif
()
install
(
TARGETS cvpcb
DESTINATION
${
KICAD_BIN
}
COMPONENT binary
)
endif
()
eeschema/CMakeLists.txt
View file @
f06bfe6d
...
...
@@ -233,9 +233,23 @@ set_source_files_properties( dialogs/dialog_bom.cpp
OBJECT_DEPENDS
${
CMAKE_CURRENT_SOURCE_DIR
}
/dialogs/dialog_bom_help_html.h
)
if
(
APPLE
)
# setup bundle
set
(
EESCHEMA_RESOURCES eeschema.icns eeschema_doc.icns
)
set_source_files_properties
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/eeschema.icns"
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources
)
set_source_files_properties
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/eeschema_doc.icns"
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources
)
set
(
MACOSX_BUNDLE_ICON_FILE eeschema.icns
)
set
(
MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-eda.kicad
)
set
(
MACOSX_BUNDLE_NAME eeschema
)
endif
()
if
(
USE_KIWAY_DLLS
)
add_executable
(
eeschema WIN32
add_executable
(
eeschema WIN32
MACOSX_BUNDLE
../common/single_top.cpp
../common/pgm_base.cpp
${
EESCHEMA_RESOURCES
}
...
...
@@ -292,13 +306,32 @@ if( USE_KIWAY_DLLS )
# these 2 binaries are a matched set, keep them together:
if
(
APPLE
)
# puts binaries into the *.app bundle while linking
set_target_properties
(
eeschema PROPERTIES
RUNTIME_OUTPUT_DIRECTORY
${
OSX_BUNDLE_BUILD_BIN_DIR
}
MACOSX_BUNDLE_INFO_PLIST
${
CMAKE_CURRENT_SOURCE_DIR
}
/Info.plist
)
# puts binaries into the *.app bundle while linking
set_target_properties
(
eeschema_kiface PROPERTIES
LIBRARY_OUTPUT_DIRECTORY
${
OSX_BUNDLE_BUILD_KIFACE_DIR
}
)
# put individual bundle outside of main bundle as a first step
# will be pulled into the main bundle when creating main bundle
install
(
TARGETS eeschema
DESTINATION
${
KICAD_BIN
}
COMPONENT binary
)
install
(
CODE
"
# override default embedded path settings
${
OSX_BUNDLE_OVERRIDE_PATHS
}
# do all the work
include( BundleUtilities )
fixup_bundle(
${
KICAD_BIN
}
/eeschema.app/Contents/MacOS/eeschema
\"\"
\"\"
)
"
COMPONENT Runtime
)
else
()
install
(
TARGETS eeschema
DESTINATION
${
KICAD_BIN
}
...
...
@@ -313,7 +346,7 @@ if( USE_KIWAY_DLLS )
endif
()
else
()
add_executable
(
eeschema WIN32
add_executable
(
eeschema WIN32
MACOSX_BUNDLE
../common/single_top.cpp
${
EESCHEMA_SRCS
}
${
EESCHEMA_COMMON_SRCS
}
...
...
@@ -333,17 +366,10 @@ else()
COMPILE_DEFINITIONS
"TOP_FRAME=FRAME_SCH;PGM_DATA_FILE_EXT=
\"
sch
\"
;BUILD_KIWAY_DLL"
)
if
(
APPLE
)
# puts binaries into the *.app bundle while linking
set_target_properties
(
eeschema PROPERTIES
RUNTIME_OUTPUT_DIRECTORY
${
OSX_BUNDLE_BUILD_BIN_DIR
}
)
else
()
install
(
TARGETS eeschema
DESTINATION
${
KICAD_BIN
}
COMPONENT binary
)
endif
()
install
(
TARGETS eeschema
DESTINATION
${
KICAD_BIN
}
COMPONENT binary
)
endif
()
...
...
eeschema/Info.plist
View file @
f06bfe6d
...
...
@@ -10,13 +10,11 @@
<
a
rr
a
y
>
<
string
>
sch
<
/string
>
<
/
a
rr
a
y
>
<
k
e
y
>
CFBundleTypeIconFile
<
/k
e
y
>
<
string
>
eeschema.icns
<
/string
>
<
k
e
y
>
CFBundleTypeIconFile
<
/k
e
y
>
<
string
>
eeschema_doc.icns
<
/string
>
<
k
e
y
>
CFBundleTypeName
<
/k
e
y
>
<
string
>
eeschema
document
<
/string
>
<
k
e
y
>
LSHandlerRank
<
/k
e
y
>
<
string
>
Owner
<
/string
>
<
/
d
i
c
t
>
<
/
a
rr
a
y
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
English
<
/string
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
string
>
eeschema
<
/string
>
<
k
e
y
>
CFBundleGetInfoString
<
/k
e
y
>
<
string
><
/string
>
...
...
eeschema/dialogs/dialog_bom.cpp
View file @
f06bfe6d
...
...
@@ -379,7 +379,11 @@ void DIALOG_BOM::OnAddPlugin( wxCommandEvent& event )
void
DIALOG_BOM
::
OnChoosePlugin
(
wxCommandEvent
&
event
)
{
wxString
mask
=
wxT
(
"*"
);
#ifndef __WXMAC__
wxString
path
=
Pgm
().
GetExecutablePath
();
#else
wxString
path
=
GetOSXKicadDataDir
()
+
wxT
(
"/plugins"
);
#endif
wxString
fullFileName
=
EDA_FileSelector
(
_
(
"Plugin files:"
),
path
,
...
...
eeschema/dialogs/dialog_netlist.cpp
View file @
f06bfe6d
...
...
@@ -871,7 +871,11 @@ void NETLIST_DIALOG_ADD_PLUGIN::OnBrowsePlugins( wxCommandEvent& event )
wxString
FullFileName
,
Mask
,
Path
;
Mask
=
wxT
(
"*"
);
#ifndef __WXMAC__
Path
=
Pgm
().
GetExecutablePath
();
#else
Path
=
GetOSXKicadDataDir
()
+
wxT
(
"/plugins"
);
#endif
FullFileName
=
EDA_FileSelector
(
_
(
"Plugin files:"
),
Path
,
FullFileName
,
...
...
gerbview/CMakeLists.txt
View file @
f06bfe6d
...
...
@@ -79,9 +79,23 @@ if( MINGW )
mingw_resource_compiler
(
gerbview
)
endif
()
if
(
APPLE
)
# setup bundle
set
(
GERBVIEW_RESOURCES gerbview.icns gerbview_doc.icns
)
set_source_files_properties
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/gerbview.icns"
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources
)
set_source_files_properties
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/gerbview_doc.icns"
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources
)
set
(
MACOSX_BUNDLE_ICON_FILE gerbview.icns
)
set
(
MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-eda.kicad
)
set
(
MACOSX_BUNDLE_NAME gerbview
)
endif
()
if
(
USE_KIWAY_DLLS
)
add_executable
(
gerbview WIN32
add_executable
(
gerbview WIN32
MACOSX_BUNDLE
../common/single_top.cpp
../common/pgm_base.cpp
${
GERBVIEW_RESOURCES
}
...
...
@@ -135,13 +149,32 @@ if( USE_KIWAY_DLLS )
# these 2 binaries are a matched set, keep them together
if
(
APPLE
)
# puts binaries into the *.app bundle while linking
set_target_properties
(
gerbview PROPERTIES
RUNTIME_OUTPUT_DIRECTORY
${
OSX_BUNDLE_BUILD_BIN_DIR
}
MACOSX_BUNDLE_INFO_PLIST
${
CMAKE_CURRENT_SOURCE_DIR
}
/Info.plist
)
# puts binaries into the *.app bundle while linking
set_target_properties
(
gerbview_kiface PROPERTIES
LIBRARY_OUTPUT_DIRECTORY
${
OSX_BUNDLE_BUILD_KIFACE_DIR
}
)
# put individual bundle outside of main bundle as a first step
# will be pulled into the main bundle when creating main bundle
install
(
TARGETS gerbview
DESTINATION
${
KICAD_BIN
}
COMPONENT binary
)
install
(
CODE
"
# override default embedded path settings
${
OSX_BUNDLE_OVERRIDE_PATHS
}
# do all the work
include( BundleUtilities )
fixup_bundle(
${
KICAD_BIN
}
/gerbview.app/Contents/MacOS/gerbview
\"\"
\"\"
)
"
COMPONENT Runtime
)
else
()
install
(
TARGETS gerbview
DESTINATION
${
KICAD_BIN
}
...
...
@@ -155,7 +188,7 @@ if( USE_KIWAY_DLLS )
else
()
add_executable
(
gerbview WIN32
add_executable
(
gerbview WIN32
MACOSX_BUNDLE
gerbview.cpp
${
GERBVIEW_SRCS
}
${
DIALOGS_SRCS
}
...
...
@@ -170,16 +203,9 @@ else()
${
wxWidgets_LIBRARIES
}
${
GDI_PLUS_LIBRARIES
}
)
if
(
APPLE
)
# puts binaries into the *.app bundle while linking
set_target_properties
(
gerbview PROPERTIES
RUNTIME_OUTPUT_DIRECTORY
${
OSX_BUNDLE_BUILD_BIN_DIR
}
)
else
()
install
(
TARGETS gerbview
DESTINATION
${
KICAD_BIN
}
COMPONENT binary
)
endif
()
install
(
TARGETS gerbview
DESTINATION
${
KICAD_BIN
}
COMPONENT binary
)
endif
()
kicad/CMakeLists.txt
View file @
f06bfe6d
...
...
@@ -89,7 +89,7 @@ if( APPLE )
set
(
SCRIPTING_HELPER
"0"
)
endif
()
# make bundle relocatable
# make
main
bundle relocatable
install
(
CODE
"
# find all libs and modules
file( GLOB BUNDLE_FIX_LIBS
${
OSX_BUNDLE_INSTALL_KIFACE_DIR
}
/*.kiface )
...
...
@@ -101,19 +101,7 @@ if( APPLE )
endif()
# override default embedded path settings
function( gp_item_default_embedded_path_override item default_embedded_path_var )
# by default, embed things right next to the main bundle executable:
set( path
\"
@executable_path/../../Contents/MacOS
\"
)
set( overridden 0 )
# embed .dylibs right next to the main bundle executable:
if( item MATCHES
\"\\\\
.dylib$
\"
)
set( path
\"
@executable_path/../Frameworks
\"
)
set( overridden 1 )
endif()
set(
\$
{default_embedded_path_var}
\"\$
{path}
\"
PARENT_SCOPE )
endfunction(gp_item_default_embedded_path_override)
${
OSX_BUNDLE_OVERRIDE_PATHS
}
# do all the work
include( BundleUtilities )
...
...
@@ -123,4 +111,32 @@ if( APPLE )
)
"
COMPONENT Runtime
)
# move all individual app bundles into main bundle
install
(
CODE
"
# helper function to move a bundle into main bundle
function( move_to_main_bundle bundle_name )
message( STATUS
\"
Moving
\$
{bundle_name} into main bundle...
\"
)
file( MAKE_DIRECTORY
${
OSX_BUNDLE_INSTALL_DIR
}
/
${
OSX_BUNDLE_APP_DIR
}
)
file( REMOVE_RECURSE
${
KICAD_BIN
}
/
\$
{bundle_name}/
${
OSX_BUNDLE_LIB_DIR
}
)
file( RENAME
${
KICAD_BIN
}
/
\$
{bundle_name}
${
OSX_BUNDLE_INSTALL_DIR
}
/
${
OSX_BUNDLE_APP_DIR
}
/
\$
{bundle_name} )
execute_process( COMMAND
${
CMAKE_COMMAND
}
-E create_symlink
\"
../../../Frameworks
\"
\"
Frameworks
\"
WORKING_DIRECTORY
${
OSX_BUNDLE_INSTALL_DIR
}
/
${
OSX_BUNDLE_APP_DIR
}
/
\$
{bundle_name}/Contents
)
# create a top-level link pointing inside main bundle
execute_process( COMMAND
${
CMAKE_COMMAND
}
-E create_symlink
\"
${
OSX_BUNDLE_MAIN
}
/
${
OSX_BUNDLE_APP_DIR
}
/
\$
{bundle_name}
\"
\"\$
{bundle_name}
\"
WORKING_DIRECTORY
${
KICAD_BIN
}
)
endfunction( move_to_main_bundle )
# move all app bundles
move_to_main_bundle( bitmap2component.app )
move_to_main_bundle( eeschema.app )
move_to_main_bundle( cvpcb.app )
move_to_main_bundle( gerbview.app )
move_to_main_bundle( pcb_calculator.app )
move_to_main_bundle( pcbnew.app )
move_to_main_bundle( pl_editor.app )
"
COMPONENT Runtime
)
endif
()
kicad/prjconfig.cpp
View file @
f06bfe6d
...
...
@@ -41,6 +41,7 @@
#include <vector>
#include <build_version.h>
#include <macros.h>
#include <common.h>
#include <wx/dir.h>
#include <wx/filename.h>
...
...
@@ -74,6 +75,7 @@ void KICAD_MANAGER_FRAME::CreateNewProject( const wxString& aPrjFullFileName,
wxFileName
templatePath
;
wxString
envStr
;
#ifndef __WXMAC__
wxGetEnv
(
wxT
(
"KICAD"
),
&
envStr
);
// Add a new tab for system templates
...
...
@@ -101,6 +103,10 @@ void KICAD_MANAGER_FRAME::CreateNewProject( const wxString& aPrjFullFileName,
sep
+
wxT
(
".."
)
+
sep
+
wxT
(
"share"
)
+
sep
+
wxT
(
"template"
)
+
sep
;
}
}
#else
// Use what is provided in the bundle data dir
templatePath
=
GetOSXKicadDataDir
()
+
sep
+
wxT
(
"template"
);
#endif
ps
->
AddPage
(
_
(
"System Templates"
),
templatePath
);
...
...
pagelayout_editor/CMakeLists.txt
View file @
f06bfe6d
...
...
@@ -53,10 +53,25 @@ if( MINGW )
endif
()
if
(
APPLE
)
# setup bundle
set
(
PL_EDITOR_RESOURCES pl_editor.icns pl_editor_doc.icns
)
set_source_files_properties
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/pl_editor.icns"
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources
)
set_source_files_properties
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/pl_editor_doc.icns"
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources
)
set
(
MACOSX_BUNDLE_ICON_FILE pl_editor.icns
)
set
(
MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-eda.kicad
)
set
(
MACOSX_BUNDLE_NAME pl_editor
)
endif
()
if
(
USE_KIWAY_DLLS
)
# a very small program launcher for pl_editor_kiface
add_executable
(
pl_editor WIN32
add_executable
(
pl_editor WIN32
MACOSX_BUNDLE
../common/single_top.cpp
../common/pgm_base.cpp
${
PL_EDITOR_RESOURCES
}
...
...
@@ -110,13 +125,32 @@ if( USE_KIWAY_DLLS )
# these 2 binaries are a matched set, keep them together:
if
(
APPLE
)
# puts binaries into the *.app bundle while linking
set_target_properties
(
pl_editor PROPERTIES
RUNTIME_OUTPUT_DIRECTORY
${
OSX_BUNDLE_BUILD_BIN_DIR
}
MACOSX_BUNDLE_INFO_PLIST
${
CMAKE_CURRENT_SOURCE_DIR
}
/Info.plist
)
# puts binaries into the *.app bundle while linking
set_target_properties
(
pl_editor_kiface PROPERTIES
LIBRARY_OUTPUT_DIRECTORY
${
OSX_BUNDLE_BUILD_KIFACE_DIR
}
)
# put individual bundle outside of main bundle as a first step
# will be pulled into the main bundle when creating main bundle
install
(
TARGETS pl_editor
DESTINATION
${
KICAD_BIN
}
COMPONENT binary
)
install
(
CODE
"
# override default embedded path settings
${
OSX_BUNDLE_OVERRIDE_PATHS
}
# do all the work
include( BundleUtilities )
fixup_bundle(
${
KICAD_BIN
}
/pl_editor.app/Contents/MacOS/pl_editor
\"\"
\"\"
)
"
COMPONENT Runtime
)
else
()
install
(
TARGETS pl_editor
DESTINATION
${
KICAD_BIN
}
...
...
@@ -130,7 +164,7 @@ if( USE_KIWAY_DLLS )
else
()
add_executable
(
pl_editor WIN32
add_executable
(
pl_editor WIN32
MACOSX_BUNDLE
pl_editor.cpp
${
PL_EDITOR_SRCS
}
${
DIALOGS_SRCS
}
...
...
@@ -145,15 +179,9 @@ else()
${
wxWidgets_LIBRARIES
}
${
GDI_PLUS_LIBRARIES
}
)
if
(
APPLE
)
# puts binaries into the *.app bundle while linking
set_target_properties
(
pl_editor PROPERTIES
RUNTIME_OUTPUT_DIRECTORY
${
OSX_BUNDLE_BUILD_BIN_DIR
}
)
else
()
install
(
TARGETS pl_editor
DESTINATION
${
KICAD_BIN
}
COMPONENT binary
)
endif
()
install
(
TARGETS pl_editor
DESTINATION
${
KICAD_BIN
}
COMPONENT binary
)
endif
()
pagelayout_editor/Info.plist
View file @
f06bfe6d
...
...
@@ -10,13 +10,11 @@
<
a
rr
a
y
>
<
string
>
kicad_wks
<
/string
>
<
/
a
rr
a
y
>
<
k
e
y
>
CFBundleTypeIconFile
<
/k
e
y
>
<
string
>
pl_editor.icns
<
/string
>
<
k
e
y
>
CFBundleTypeIconFile
<
/k
e
y
>
<
string
>
pl_editor_doc.icns
<
/string
>
<
k
e
y
>
CFBundleTypeName
<
/k
e
y
>
<
string
>
pl_editor
document
<
/string
>
<
k
e
y
>
LSHandlerRank
<
/k
e
y
>
<
string
>
Owner
<
/string
>
<
/
d
i
c
t
>
<
/
a
rr
a
y
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
English
<
/string
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
string
>
pl_editor
<
/string
>
<
k
e
y
>
CFBundleGetInfoString
<
/k
e
y
>
<
string
><
/string
>
...
...
pcb_calculator/CMakeLists.txt
View file @
f06bfe6d
...
...
@@ -54,11 +54,22 @@ make_lexer(
datafile_read_write.h
)
if
(
APPLE
)
# setup bundle
set
(
PCB_CALCULATOR_RESOURCES pcb_calculator.icns
)
set_source_files_properties
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/pcb_calculator.icns"
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources
)
set
(
MACOSX_BUNDLE_ICON_FILE pcb_calculator.icns
)
set
(
MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-eda.kicad
)
set
(
MACOSX_BUNDLE_NAME pcb_calculator
)
endif
()
if
(
USE_KIWAY_DLLS
)
#if( false )
add_executable
(
pcb_calculator WIN32
add_executable
(
pcb_calculator WIN32
MACOSX_BUNDLE
../common/single_top.cpp
../common/pgm_base.cpp
${
PCB_CALCULATOR_RESOURCES
}
...
...
@@ -108,13 +119,32 @@ if( USE_KIWAY_DLLS )
# these 2 binaries are a matched set, keep them together
if
(
APPLE
)
# puts binaries into the *.app bundle while linking
set_target_properties
(
pcb_calculator PROPERTIES
RUNTIME_OUTPUT_DIRECTORY
${
OSX_BUNDLE_BUILD_BIN_DIR
}
MACOSX_BUNDLE_INFO_PLIST
${
CMAKE_CURRENT_SOURCE_DIR
}
/Info.plist
)
# puts binaries into the *.app bundle while linking
set_target_properties
(
pcb_calculator_kiface PROPERTIES
LIBRARY_OUTPUT_DIRECTORY
${
OSX_BUNDLE_BUILD_KIFACE_DIR
}
)
# put individual bundle outside of main bundle as a first step
# will be pulled into the main bundle when creating main bundle
install
(
TARGETS pcb_calculator
DESTINATION
${
KICAD_BIN
}
COMPONENT binary
)
install
(
CODE
"
# override default embedded path settings
${
OSX_BUNDLE_OVERRIDE_PATHS
}
# do all the work
include( BundleUtilities )
fixup_bundle(
${
KICAD_BIN
}
/pcb_calculator.app/Contents/MacOS/pcb_calculator
\"\"
\"\"
)
"
COMPONENT Runtime
)
else
()
install
(
TARGETS pcb_calculator
DESTINATION
${
KICAD_BIN
}
...
...
@@ -128,7 +158,7 @@ if( USE_KIWAY_DLLS )
else
()
add_executable
(
pcb_calculator WIN32
add_executable
(
pcb_calculator WIN32
MACOSX_BUNDLE
../common/single_top.cpp
pcb_calculator.cpp
${
PCB_CALCULATOR_SRCS
}
...
...
@@ -146,16 +176,9 @@ else()
polygon
${
wxWidgets_LIBRARIES
}
)
if
(
APPLE
)
# puts binaries into the *.app bundle while linking
set_target_properties
(
pcb_calculator PROPERTIES
RUNTIME_OUTPUT_DIRECTORY
${
OSX_BUNDLE_BUILD_BIN_DIR
}
)
else
()
install
(
TARGETS pcb_calculator
DESTINATION
${
KICAD_BIN
}
COMPONENT binary
)
endif
()
install
(
TARGETS pcb_calculator
DESTINATION
${
KICAD_BIN
}
COMPONENT binary
)
endif
()
pcbnew/pcbnew.cpp
View file @
f06bfe6d
...
...
@@ -217,7 +217,7 @@ static bool scriptingSetup()
{
wxString
path_frag
;
#if
def __MINGW32__
#if
defined( __MINGW32__ )
// force python environment under Windows:
const
wxString
python_us
(
"python27_us"
);
...
...
@@ -261,28 +261,24 @@ static bool scriptingSetup()
// [KICAD_PATH]/scripting/plugins
// Add this default search path:
path_frag
=
Pgm
().
GetExecutablePath
()
+
wxT
(
"scripting/plugins"
);
#elif defined
__WXMAC__
#elif defined
( __WXMAC__ )
// User plugin folder is ~/Library/Application Support/kicad/scripting/plugins
path_frag
=
wxStandardPaths
::
Get
().
Get
UserDataDir
()
+
wxT
(
"/scripting/plugins"
);
path_frag
=
GetOSXKicad
UserDataDir
()
+
wxT
(
"/scripting/plugins"
);
// Add default paths to PYTHONPATH
wxString
pypath
;
// User scripting folder (~/Library/Application Support/kicad/scripting/plugins)
pypath
=
wxStandardPaths
::
Get
().
Get
UserDataDir
()
+
wxT
(
"/scripting/plugins"
);
pypath
=
GetOSXKicad
UserDataDir
()
+
wxT
(
"/scripting/plugins"
);
// Machine scripting folder (/Library/Application Support/kicad/scripting/plugins)
pypath
+=
wxT
(
":
/Library/Application Support/kicad
/scripting/plugins"
);
pypath
+=
wxT
(
":
"
)
+
GetOSXKicadMachineDataDir
()
+
wxT
(
"
/scripting/plugins"
);
// Bundle scripting folder (<kicad.app>/Contents/SharedSupport/scripting/plugins)
pypath
+=
wxT
(
":"
)
+
wxStandardPaths
::
Get
().
GetDataDir
()
+
wxT
(
"/scripting/plugins"
);
// Bundle wxPython folder (<kicad.app>/Contents/Frameworks/python)
wxFileName
fn
=
wxFileName
(
wxStandardPaths
::
Get
().
GetExecutablePath
()
);
fn
.
RemoveLastDir
();
fn
.
AppendDir
(
wxT
(
"Frameworks"
)
);
fn
.
AppendDir
(
wxT
(
"python"
)
);
pypath
+=
wxT
(
":"
)
+
fn
.
GetPath
();
// Original content of PYTHONPATH
pypath
+=
wxT
(
":"
)
+
GetOSXKicadDataDir
()
+
wxT
(
"/scripting/plugins"
);
// Bundle wxPython folder (<kicad.app>/Contents/Frameworks/python/site-packages)
pypath
+=
wxT
(
":"
)
+
Pgm
().
GetExecutablePath
()
+
wxT
(
"Contents/Frameworks/python/site-packages"
);
// Original content of $PYTHONPATH
if
(
wxGetenv
(
"PYTHONPATH"
)
!=
NULL
)
{
pypath
+=
wxT
(
":"
)
+
wxString
(
wxGetenv
(
"PYTHONPATH"
)
)
;
pypath
=
wxString
(
wxGetenv
(
"PYTHONPATH"
)
)
+
wxT
(
":"
)
+
pypath
;
}
// set $PYTHONPATH
...
...
@@ -292,9 +288,6 @@ static bool scriptingSetup()
path_frag
=
wxT
(
"/usr/local/kicad/bin/scripting/plugins"
);
#endif
// On linux and osx, 2 others paths are
// [HOME]/.kicad_plugins/
// [HOME]/.kicad/scripting/plugins/
if
(
!
pcbnewInitPythonScripting
(
TO_UTF8
(
path_frag
)
)
)
{
wxLogSysError
(
wxT
(
"pcbnewInitPythonScripting() failed."
)
);
...
...
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