Projects / emss / OS X Scripts

From emss Framework - iRobot Create C++ Framework

Jump to: navigation, search

You are here: Projects / emss / OS X Scripts


[edit] OS X Scripts

These scripts aid the build process for packaging software with the Qt 4.5 frameworks on OS X...

[edit] Build and Patch Script

#!/bin/sh
EMSS=/Users/dankrusi/emssframework/trunk
cd $EMSS
FRAMEWORKS=/Library/Frameworks

# usage: patchlib <component> <lib> <dependecylib>
patchlib() {
	if [ $2 != $3 ]; then
		install_name_tool -change $3.framework/Versions/4/$3 @executable_path/../Frameworks/$3.framework/Versions/4/$3 $EMSS/bin/emss$1.app/Contents/Frameworks/$2.framework/Versions/4/$2
	fi;
}

# usage: copyqtlib <component> <lib>
copyqtlib() {
	mkdir $EMSS/bin/emss$1.app/Contents/Frameworks
	cp -R $FRAMEWORKS/$2.framework $EMSS/bin/emss$1.app/Contents/Frameworks
	install_name_tool -id @executable_path/../Frameworks/$2.framework/Versions/4/$2 $EMSS/bin/emss$1.app/Contents/Frameworks/$2.framework/Versions/4/$2
	install_name_tool -change $FRAMEWORKS/$2.framework/Versions/4/$2 @executable_path/../Frameworks/$2.framework/Versions/4/$2 $EMSS/bin/emss$1.app/Contents/MacOS/emss$1
	install_name_tool -change $2.framework/Versions/4/$2 @executable_path/../Frameworks/$2.framework/Versions/4/$2 $EMSS/bin/emss$1.app/Contents/MacOS/emss$1

	patchlib $1 $2 QtCore
	patchlib $1 $2 QtGui
	patchlib $1 $2 QtXml
	patchlib $1 $2 QtNetwork
	patchlib $1 $2 QtOpenGL

	APPFRM=$EMSS/bin/emss$1.app/Contents/Frameworks/$2.framework
	rm -rf $APPFRM/$2_debug
	rm -rf $APPFRM/$2_debug.dSYM
	rm -rf $APPFRM/$2_debug.prl
	rm -rf $APPFRM/Versions/4/$2_debug
}

# usage: makecomponent <component>
makecomponent() {
	cd $EMSS/$1
	pwd
	
	#qmake CONFIG+=debug_and_release -spec macx-g++
	#make clean
	make release

	copyqtlib $1 QtCore
	copyqtlib $1 QtGui
	copyqtlib $1 QtNetwork
	copyqtlib $1 QtOpenGL
	copyqtlib $1 QtXml
}


makecomponent "Core"
makecomponent "CameraCalibrationTest"
makecomponent "COILTest"
makecomponent "ComplexNumbersTest"
makecomponent "DifferentialSteeringTest"
makecomponent "ExampleApplication"
makecomponent "FingerprintCollector"
makecomponent "Interface"
makecomponent "RemoteInterfaceTest"
makecomponent "SensorTest"
makecomponent "SplineTest"
makecomponent "UnitTests"
makecomponent "VectorTest"

[edit] Verfication Script

#!/bin/sh
EMSS=/Users/dankrusi/emssframework/trunk


# usage: checklib <component>
checklib() {
	otool -L $EMSS/bin/emss$1.app/Contents/MacOS/emss$1 | grep Qt
	cd $EMSS/bin/emss$1.app/Contents/Frameworks
	otool -L QtCore.framework/QtCore | grep Qt
	otool -L QtGui.framework/QtGui | grep Qt
	otool -L QtNetwork.framework/QtNetwork | grep Qt
	otool -L QtXml.framework/QtXml | grep Qt
	otool -L QtOpenGL.framework/QtOpenGL | grep Qt
}


checklib "CameraCalibrationTest"
exit
checklib "COILTest"
checklib "ComplexNumbersTest"
checklib "DifferentialSteeringTest"
checklib "ExampleApplication"
checklib "FingerprintCollector"
checklib "Interface"
checklib "RemoteInterfaceTest"
checklib "SensorTest"
checklib "SplineTest"
checklib "UnitTests"
checklib "VectorTest"