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
73898d59
Commit
73898d59
authored
Feb 11, 2014
by
Marco Serantoni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MacOSX] Refines in building system, now bundles lib migration supports symbolic links
parent
3132c70e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
15 deletions
+54
-15
CMakeLists.txt
CMakeLists.txt
+17
-9
osx_fixbundle.sh
scripts/osx_fixbundle.sh
+37
-6
No files found.
CMakeLists.txt
View file @
73898d59
...
...
@@ -190,9 +190,11 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
set
(
TO_LINKER -Wl
)
endif
()
# Thou shalt not link vaporware and tell us it's a valid DSO:
set
(
CMAKE_SHARED_LINKER_FLAGS
"
${
TO_LINKER
}
,--no-undefined"
)
set
(
CMAKE_MODULE_LINKER_FLAGS
"
${
TO_LINKER
}
,--no-undefined"
)
# Thou shalt not link vaporware and tell us it's a valid DSO (apple ld doesn't support it)
if
(
NOT APPLE
)
set
(
CMAKE_SHARED_LINKER_FLAGS
"
${
TO_LINKER
}
,--no-undefined"
)
set
(
CMAKE_MODULE_LINKER_FLAGS
"
${
TO_LINKER
}
,--no-undefined"
)
endif
()
set
(
CMAKE_EXE_LINKER_FLAGS_RELEASE
"-s"
)
endif
()
...
...
@@ -345,12 +347,6 @@ check_find_package_result( OPENGL_FOUND "OpenGL" )
if
(
KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC
)
add_custom_target
(
lib-wxpython
)
include
(
download_pcre
)
include
(
download_swig
)
include
(
download_wxpython
)
add_dependencies
(
lib-wxpython pcre
)
add_dependencies
(
lib-wxpython swig
)
add_dependencies
(
lib-wxpython libwxpython
)
#set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so;.dylib;.dll")
...
...
@@ -361,6 +357,9 @@ add_custom_target( lib-wxpython )
if
(
KICAD_BUILD_STATIC
)
message
(
STATUS
"KICAD_BUILD_STATIC set"
)
if
(
KICAD_SCRIPTING OR KICAD_SCRIPTING_WXPYTHON OR KICAD_SCRIPTING_MODULES
)
message
(
FATAL_ERROR
"KICAD_SCRIPTING* is not supported with KICAD_BUILD_STATIC, please select KICAD_BUILD_DYNAMIC"
)
endif
()
endif
()
if
(
KICAD_BUILD_DYNAMIC
)
...
...
@@ -374,6 +373,9 @@ add_custom_target( lib-wxpython )
include
(
download_libpng
)
if
(
KICAD_SCRIPTING OR KICAD_SCRIPTING_WXPYTHON OR KICAD_SCRIPTING_MODULES
)
message
(
STATUS
"Scripting ENABLED"
)
set
(
SWIG_EXECUTABLE
${
SWIG_ROOT
}
/bin/swig
)
set
(
SWIG_INCLUDE
${
SWIG_ROOT
}
/include
)
set
(
PYTHON_DEST
${
LIBWXPYTHON_ROOT
}
/wxPython/lib/python2.6/site-packages
)
...
...
@@ -392,6 +394,12 @@ add_custom_target( lib-wxpython )
set
(
wxWidgets_INCLUDE_DIRS
${
LIBWXPYTHON_ROOT
}
/include/wx-3.0
)
set
(
wxWidgets_LIBRARY_DIRS
${
LIBWXPYTHON_ROOT
}
/lib
)
include
(
download_pcre
)
include
(
download_swig
)
include
(
download_wxpython
)
add_dependencies
(
lib-wxpython pcre
)
add_dependencies
(
lib-wxpython swig
)
add_dependencies
(
lib-wxpython libwxpython
)
add_dependencies
(
lib-dependencies libwxpython
)
else
()
include
(
download_wxwidgets
)
...
...
scripts/osx_fixbundle.sh
View file @
73898d59
#!/bin/bash
#!/bin/bash
# v 1.1 Supports migration of links (limited to the same directory) - I should add checks..
# usage osx_fixbundle.sh <bundle-name> <bzr_root>
if
[[
!
-f
version.h
]]
;
then
...
...
@@ -11,7 +12,6 @@ fi
EXECUTABLES
=
"
`
find
.
-name
'*.app'
`
"
#
# Copies libraries under <bzr_root> in the bundle and relocates them in the binary
#
...
...
@@ -29,7 +29,11 @@ function fixbundle() {
if
[[
"
$library
"
=
~
"
$bzroot
"
]]
;
then
echo
"
${
exec
}
: Migrating
`
basename
$library
`
in the bundle"
if
[
!
-f
${
exec
}
.app/Contents/Frameworks/
`
basename
$library
`
]
;
then
cp
-f
$library
${
execpath
}${
exec
}
.app/Contents/Frameworks
if
[
!
-L
$library
]
;
then
cp
-f
$library
${
execpath
}${
exec
}
.app/Contents/Frameworks
else
resolvelink
"
$library
"
"
`
dirname
$library
`
"
"
${
execpath
}
/
${
exec
}
.app/Contents/Frameworks"
fi
fi
install_name_tool
-change
$library
@executable_path/../Frameworks/
`
basename
$library
`
${
execpath
}${
exec
}
.app/Contents/MacOS/
${
exec
}
fi
...
...
@@ -46,7 +50,11 @@ function fixbundle() {
for
library
in
$LIBRARIES
;
do
if
[[
"
$library
"
=
~
"
$bzroot
"
]]
;
then
if
[
!
-f
${
exec
}
.app/Contents/Frameworks/
`
basename
$library
`
]
;
then
cp
-f
$library
${
exec
}
.app/Contents/Frameworks
if
[
!
-L
$library
]
;
then
cp
-f
$library
${
exec
}
.app/Contents/Frameworks
else
resolvelink
"
$library
"
"
`
dirname
$library
`
"
"
${
execpath
}
/
${
exec
}
.app/Contents/Frameworks"
fi
fi
install_name_tool
-change
$library
@executable_path/../Frameworks/
`
basename
$library
`
$module
fi
...
...
@@ -70,7 +78,11 @@ function fixbundle() {
for
library
in
$LIBRARIES
;
do
if
[[
"
$library
"
=
~
"
$bzroot
"
]]
;
then
if
[
!
-f
${
exec
}
.app/Contents/Frameworks/
`
basename
$library
`
]
;
then
cp
-f
$library
${
exec
}
.app/Contents/Frameworks
if
[
!
-L
$library
]
;
then
cp
-f
$library
${
exec
}
.app/Contents/Frameworks
else
resolvelink
"
$library
"
"
`
dirname
$library
`
"
"
${
execpath
}
/
${
exec
}
.app/Contents/Frameworks"
fi
echo
"copied
`
basename
$library
`
into bundle"
((
dynlib_migrate +
=
1
))
fi
...
...
@@ -84,8 +96,27 @@ function fixbundle() {
cd
-
>
/dev/null
}
#
# This supports only links on the same dir (TODO ?)
#
function
resolvelink
()
{
local
srclib
=
"
`
basename
$1
`
"
local
srcpath
=
"
$2
"
local
destpath
=
"
$3
"
#fixbundle $1 $2 $3
#if is a file i expect a pointed ""
local
pointed
=
"
`
readlink
${
srcpath
}
/
${
srclib
}
`
"
if
[
!
-f
${
pointed
}
]
;
then
resolvelink
"
${
pointed
}
"
"
${
srcpath
}
"
"
${
destpath
}
"
echo
"Link
${
srclib
}
->
${
pointed
}
"
(
cd
"
${
destpath
}
"
;
ln
-s
"
${
pointed
}
"
"
${
srclib
}
"
)
else
echo
"Copy
${
srcpath
}
/
${
srclib
}
->
${
destpath
}
"
cp
"
${
srcpath
}
/
${
srclib
}
"
${
destpath
}
fi
}
for
executable
in
$EXECUTABLES
;
do
...
...
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