Skip to content

Commit d821936

Browse files
David WimseyDavid Wimsey
David Wimsey
authored and
David Wimsey
committed
Initial changes to make building dependancies much easier and require less knowledge of how the sub projects work
1 parent 8fbfb01 commit d821936

File tree

2 files changed

+125
-2
lines changed

2 files changed

+125
-2
lines changed

Build/CMakeLists.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,11 @@ if(NOT DEFINED ENV{FREETYPE_DIR})
8686
set(ENV{FREETYPE_DIR} "${PROJECT_SOURCE_DIR}/../Dependencies")
8787
endif()
8888

89-
if(NOT DEFINED ENV{Boost_DIR})
90-
set(ENV{Boost_DIR} "${PROJECT_SOURCE_DIR}/../Dependencies")
89+
#if(NOT DEFINED ENV{Boost_DIR})
90+
# set(ENV{Boost_DIR} "${PROJECT_SOURCE_DIR}/../Dependencies")
91+
#endif()
92+
if(NOT DEFINED ENV{BOOST_ROOT})
93+
set(ENV{BOOST_ROOT} "${PROJECT_SOURCE_DIR}/../Dependencies/boost")
9194
endif()
9295

9396
if(NOT DEFINED ENV{LUA_DIR})

Dependencies/osx-depends.sh

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
#!/usr/bin/env sh
2+
3+
BUILD_FREETYPE2=YES
4+
BUILD_BOOST_PYTHON=YES
5+
BUILD_LUA=YES
6+
BUILD_PLATFORM=osx
7+
8+
9+
#Get depends root directory
10+
11+
pushd `dirname $0` > /dev/null
12+
SCRIPT_PATH=`pwd`
13+
popd > /dev/null
14+
15+
DEPS_DIR=${SCRIPT_PATH}
16+
17+
BUILD_OUTPUTDIR=${DEPS_DIR}/${BUILD_PLATFORM}
18+
19+
if [ ! -d "${BUILD_OUTPUTDIR}" ]; then
20+
mkdir "${BUILD_OUTPUTDIR}"
21+
fi
22+
if [ ! -d "${BUILD_OUTPUTDIR}/lib" ]; then
23+
mkdir "${BUILD_OUTPUTDIR}/lib"
24+
fi
25+
if [ ! -d "${BUILD_OUTPUTDIR}/include" ]; then
26+
mkdir "${BUILD_OUTPUTDIR}/include"
27+
fi
28+
29+
create_ios_outdir_lipo()
30+
{
31+
for lib_i386 in `find $LOCAL_OUTDIR/i386 -name "lib*.a"`; do
32+
lib_arm7=`echo $lib_i386 | sed "s/i386/arm7/g"`
33+
lib_arm7s=`echo $lib_i386 | sed "s/i386/arm7s/g"`
34+
lib=`echo $lib_i386 | sed "s/i386//g"`
35+
xcrun -sdk iphoneos lipo -arch armv7s $lib_arm7s -arch armv7 $lib_arm7 -create -output $lib
36+
done
37+
}
38+
39+
build_freetype()
40+
{
41+
42+
cd "${DEPS_DIR}"
43+
if [ ! -d "freetype2" ]; then
44+
git clone --recursive git://git.sv.nongnu.org/freetype/freetype2.git freetype2
45+
fi
46+
47+
cd freetype2
48+
49+
cmake CMakeLists.txt -DBUILD_SHARED_LIBS:BOOL=false
50+
make
51+
52+
cmake CMakeLists.txt -DBUILD_SHARED_LIBS:BOOL=true
53+
make
54+
55+
if [ ! -d "${BUILD_OUTPUTDIR}/include/freetype2" ]; then
56+
mkdir "${BUILD_OUTPUTDIR}/include/freetype2"
57+
fi
58+
cp -Rp include/* "${BUILD_OUTPUTDIR}/include/freetype2/"
59+
cp libfreetype.a "${BUILD_OUTPUTDIR}/lib/"
60+
cp libfreetype.dylib "${BUILD_OUTPUTDIR}/lib/"
61+
62+
cd "${DEPS_DIR}"
63+
}
64+
65+
build_boostpython()
66+
{
67+
cd "${DEPS_DIR}"
68+
if [ ! -d "boost" ]; then
69+
git clone --recursive https://github.com/boostorg/boost.git boost
70+
fi
71+
72+
cd boost
73+
74+
git submodule foreach 'git clean -fdx; git reset --hard'
75+
git clean -fdx
76+
77+
./bootstrap.sh
78+
./b2 architecture=x86 address-model=32_64 --with-python
79+
##./b2 architecture=x86 address-model=32_64 link=shared --with-python
80+
##./b2 architecture=x86 address-model=32_64 link=static --with-python
81+
82+
83+
cp libs/python/include/boost/python.hpp boost/
84+
cp libs/utility/include/boost/utility/value_init.hpp boost/utility/
85+
cp libs/lexical_cast/include/boost/lexical_cast.hpp boost/
86+
cp -R libs/lexical_cast/include/boost/lexical_cast boost/
87+
cp libs/lexical_cast/include/boost/detail/lcast_precision.hpp boost/detail/
88+
# mkdir -p boost/math
89+
# cp libs/math/include/boost/math/special_functions/sign.hpp boost/math/special_functions/
90+
# cp libs/math/include/boost/math/special_functions/math_fwd.hpp boost/math/special_functions/
91+
# cp libs/math/include/boost/math/special_functions/detail/round_fwd.hpp boost/math/special_functions/detail/
92+
# cp libs/math/include/boost/math/special_functions/detail/fp_traits.hpp boost/math/special_functions/detail/
93+
cp -R libs/math/include/boost/math boost/math
94+
95+
# mkdir -p boost/math/tools
96+
# cp libs/math/include/boost/math/tools/config.hpp boost/math/tools/
97+
# cp libs/math/include/boost/math/tools/user.hpp boost/math/tools/
98+
# cp libs/math/include/boost/math/tools/promotion.hpp boost/math/tools/
99+
mkdir -p boost/math/policies
100+
cp libs/math/include/boost/math/policies/policy.hpp boost/math/policies/
101+
102+
cp libs/predef/include/boost/detail/endian.hpp boost/detail/
103+
104+
cp libs/math/include/boost/math/special_functions/fpclassify.hpp boost/math/special_functions/
105+
106+
cp libs/math/include/boost/math/tools/real_cast.hpp boost/math/tools/
107+
108+
cp libs/lexical_cast/include/boost/detail/basic_pointerbuf.hpp boost/detail/
109+
110+
cp libs/foreach/include/boost/foreach.hpp boost/
111+
112+
cp -R boost "${BUILD_OUTPUTDIR}/include/"
113+
cp -R stage/lib/* "${BUILD_OUTPUTDIR}/lib/"
114+
cd "${DEPS_DIR}"
115+
}
116+
117+
118+
119+
build_freetype
120+
build_boostpython

0 commit comments

Comments
 (0)