[MacOSX] Refines in building system, now bundles lib migration supports symbolic links
This commit is contained in:
parent
3132c70e54
commit
73898d5954
|
@ -190,9 +190,11 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
||||||
set( TO_LINKER -Wl )
|
set( TO_LINKER -Wl )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Thou shalt not link vaporware and tell us it's a valid DSO:
|
# Thou shalt not link vaporware and tell us it's a valid DSO (apple ld doesn't support it)
|
||||||
set( CMAKE_SHARED_LINKER_FLAGS "${TO_LINKER},--no-undefined" )
|
if( NOT APPLE )
|
||||||
set( CMAKE_MODULE_LINKER_FLAGS "${TO_LINKER},--no-undefined" )
|
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" )
|
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" )
|
||||||
endif()
|
endif()
|
||||||
|
@ -345,12 +347,6 @@ check_find_package_result( OPENGL_FOUND "OpenGL" )
|
||||||
if( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
|
if( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
|
||||||
|
|
||||||
add_custom_target( lib-wxpython )
|
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")
|
#set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so;.dylib;.dll")
|
||||||
|
@ -361,6 +357,9 @@ add_custom_target( lib-wxpython )
|
||||||
|
|
||||||
if( KICAD_BUILD_STATIC )
|
if( KICAD_BUILD_STATIC )
|
||||||
message(STATUS "KICAD_BUILD_STATIC set")
|
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()
|
endif()
|
||||||
|
|
||||||
if( KICAD_BUILD_DYNAMIC )
|
if( KICAD_BUILD_DYNAMIC )
|
||||||
|
@ -374,6 +373,9 @@ add_custom_target( lib-wxpython )
|
||||||
include( download_libpng )
|
include( download_libpng )
|
||||||
|
|
||||||
if( KICAD_SCRIPTING OR KICAD_SCRIPTING_WXPYTHON OR KICAD_SCRIPTING_MODULES )
|
if( KICAD_SCRIPTING OR KICAD_SCRIPTING_WXPYTHON OR KICAD_SCRIPTING_MODULES )
|
||||||
|
|
||||||
|
message(STATUS "Scripting ENABLED")
|
||||||
|
|
||||||
set( SWIG_EXECUTABLE ${SWIG_ROOT}/bin/swig )
|
set( SWIG_EXECUTABLE ${SWIG_ROOT}/bin/swig )
|
||||||
set( SWIG_INCLUDE ${SWIG_ROOT}/include )
|
set( SWIG_INCLUDE ${SWIG_ROOT}/include )
|
||||||
set( PYTHON_DEST ${LIBWXPYTHON_ROOT}/wxPython/lib/python2.6/site-packages )
|
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_INCLUDE_DIRS ${LIBWXPYTHON_ROOT}/include/wx-3.0 )
|
||||||
set(wxWidgets_LIBRARY_DIRS ${LIBWXPYTHON_ROOT}/lib )
|
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 )
|
add_dependencies( lib-dependencies libwxpython )
|
||||||
else()
|
else()
|
||||||
include( download_wxwidgets )
|
include( download_wxwidgets )
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/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>
|
# usage osx_fixbundle.sh <bundle-name> <bzr_root>
|
||||||
|
|
||||||
if [[ ! -f version.h ]]; then
|
if [[ ! -f version.h ]]; then
|
||||||
|
@ -11,7 +12,6 @@ fi
|
||||||
|
|
||||||
EXECUTABLES="`find . -name '*.app'`"
|
EXECUTABLES="`find . -name '*.app'`"
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copies libraries under <bzr_root> in the bundle and relocates them in the binary
|
# Copies libraries under <bzr_root> in the bundle and relocates them in the binary
|
||||||
#
|
#
|
||||||
|
@ -29,7 +29,11 @@ function fixbundle() {
|
||||||
if [[ "$library" =~ "$bzroot" ]]; then
|
if [[ "$library" =~ "$bzroot" ]]; then
|
||||||
echo "${exec}: Migrating `basename $library` in the bundle"
|
echo "${exec}: Migrating `basename $library` in the bundle"
|
||||||
if [ ! -f ${exec}.app/Contents/Frameworks/`basename $library` ]; then
|
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
|
fi
|
||||||
install_name_tool -change $library @executable_path/../Frameworks/`basename $library` ${execpath}${exec}.app/Contents/MacOS/${exec}
|
install_name_tool -change $library @executable_path/../Frameworks/`basename $library` ${execpath}${exec}.app/Contents/MacOS/${exec}
|
||||||
fi
|
fi
|
||||||
|
@ -46,7 +50,11 @@ function fixbundle() {
|
||||||
for library in $LIBRARIES; do
|
for library in $LIBRARIES; do
|
||||||
if [[ "$library" =~ "$bzroot" ]]; then
|
if [[ "$library" =~ "$bzroot" ]]; then
|
||||||
if [ ! -f ${exec}.app/Contents/Frameworks/`basename $library` ]; 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
|
fi
|
||||||
install_name_tool -change $library @executable_path/../Frameworks/`basename $library` $module
|
install_name_tool -change $library @executable_path/../Frameworks/`basename $library` $module
|
||||||
fi
|
fi
|
||||||
|
@ -70,7 +78,11 @@ function fixbundle() {
|
||||||
for library in $LIBRARIES; do
|
for library in $LIBRARIES; do
|
||||||
if [[ "$library" =~ "$bzroot" ]]; then
|
if [[ "$library" =~ "$bzroot" ]]; then
|
||||||
if [ ! -f ${exec}.app/Contents/Frameworks/`basename $library` ]; 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"
|
echo "copied `basename $library` into bundle"
|
||||||
(( dynlib_migrate += 1))
|
(( dynlib_migrate += 1))
|
||||||
fi
|
fi
|
||||||
|
@ -84,8 +96,27 @@ function fixbundle() {
|
||||||
cd - >/dev/null
|
cd - >/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# This supports only links on the same dir (TODO ?)
|
||||||
|
#
|
||||||
|
|
||||||
#fixbundle $1 $2 $3
|
function resolvelink() {
|
||||||
|
local srclib="`basename $1`"
|
||||||
|
local srcpath="$2"
|
||||||
|
local destpath="$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;
|
for executable in $EXECUTABLES;
|
||||||
do
|
do
|
||||||
|
|
Loading…
Reference in New Issue