mirror of
https://github.com/smealum/SPACECRAFT.git
synced 2025-06-19 09:15:46 -04:00
CMake fix (quite weird)
OS X script to fix some new bug about libs... fixed test for trees
This commit is contained in:
parent
dd1b381029
commit
eb858551ae
@ -127,7 +127,7 @@ file(GLOB_RECURSE all_obj ${OBJ_FILES}/*.o)
|
|||||||
list(REMOVE_ITEM all_obj ${OBJ_FILES}/main.cpp.o)
|
list(REMOVE_ITEM all_obj ${OBJ_FILES}/main.cpp.o)
|
||||||
#STRING(REPLACE ; " " all_obj "${all_obj}")
|
#STRING(REPLACE ; " " all_obj "${all_obj}")
|
||||||
file(GLOB_RECURSE all_tests ${PROJECT_SOURCE_DIR}/tests/*.cpp)
|
file(GLOB_RECURSE all_tests ${PROJECT_SOURCE_DIR}/tests/*.cpp)
|
||||||
#message("tests: ${all_tests}")
|
#message("tests: ${all_obj}")
|
||||||
|
|
||||||
foreach(t ${all_tests})
|
foreach(t ${all_tests})
|
||||||
GET_FILENAME_COMPONENT(f_base ${t} NAME_WE)
|
GET_FILENAME_COMPONENT(f_base ${t} NAME_WE)
|
||||||
|
23
osx-fix.sh
Executable file
23
osx-fix.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# fix quand il ne trouve pas certaines dylib. Cela peut arriver...
|
||||||
|
# $1 = executable
|
||||||
|
|
||||||
|
while [[ ! "$1" = "" ]]; do
|
||||||
|
EXE="$1"
|
||||||
|
|
||||||
|
echo "Checking for $EXE..."
|
||||||
|
BAD_LIBS=$(otool -L "$EXE" | cut -d " " -f 1 | grep "@executable")
|
||||||
|
|
||||||
|
for i in $BAD_LIBS; do
|
||||||
|
echo "Fixing $i for $EXE..."
|
||||||
|
NEW_LIB=`locate $(basename $i) | tail -n1`
|
||||||
|
echo "Found $NEW_LIB for $EXE, patching..."
|
||||||
|
if [[ "$?" = 0 ]]; then
|
||||||
|
install_name_tool -change "$i" "$NEW_LIB" "$EXE" || echo "ERROR: cannot change $EXE"
|
||||||
|
else
|
||||||
|
echo "ERROR: couldn't locate '$i' for $EXE"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
shift;
|
||||||
|
done
|
@ -5,7 +5,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
Tree tree;
|
Tree tree;
|
||||||
|
|
||||||
tree.generate();
|
tree.generate(1);
|
||||||
|
|
||||||
debug("size: %d, height: %d", tree.getSize(), tree.getHeight());
|
debug("size: %d, height: %d", tree.getSize(), tree.getHeight());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user