Skip to content
Browse files

Modified prep*.sh scripts for mac and unix to allow arbitrary locatio…

…n for projects and build dirs
  • Loading branch information...
1 parent fda2363 commit 31f1e91cb3fdd4346e467b2a6e57304c515bad3f @taxilian taxilian committed Aug 31, 2010
Showing with 39 additions and 52 deletions.
  1. +1 −5 cmake/common.cmake
  2. +29 −0 common.sh
  3. +1 −13 prepcodeblocks.sh
  4. +1 −13 prepeclipse.sh
  5. +2 −10 prepmac.sh
  6. +5 −11 prepmake.sh
View
6 cmake/common.cmake
@@ -14,11 +14,7 @@
get_filename_component (FB_ROOT_DIR "${CMAKE_DIR}/.." ABSOLUTE)
get_filename_component (SOURCE_DIR "${CMAKE_DIR}/../src" ABSOLUTE)
-if (BUILD_EXAMPLES)
- set(PROJECT_SRC_DIR "examples")
-else()
- set(PROJECT_SRC_DIR "projects")
-endif()
+set(PROJECT_SRC_DIR ${PROJECTS_DIR})
set (PROJECT_ROOT "${CMAKE_BINARY_DIR}/projects")
set (BIN_DIR "${CMAKE_BINARY_DIR}/bin")
View
29 common.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+RUN_FROM=`pwd`
+FB_ROOT_REL=${0%/*}
+FB_ROOT=`cd $FB_ROOT_REL; pwd`
+
+if [ "$1" = "" ]; then
+ BUILDDIR=${RUN_FROM}/build
+ PROJDIR=${RUN_FROM}/projects
+elif [ "$2" = "" ]; then
+ if [ "$1" = "examples" ]; then
+ BUILDDIR=${RUN_FROM}/buildex
+ else
+ BUILDDIR=${RUN_FROM}/build
+ fi
+ PROJDIR=`cd $1; pwd`
+else
+ PROJDIR=`cd $1; pwd`
+ mkdir -p "$2"
+ BUILDDIR=`cd $2; pwd`
+fi
+mkdir -p "$BUILDDIR"
+
+echo Using projects in: $PROJDIR
+echo Generating build files in: $BUILDDIR
+echo NOTE: The build files in $BUILDDIR should *NEVER* be modified directly. Make changes in cmake and re-run this script.
+
+# Remove the first two arguments; the remainder are cmake arguments
+shift 2
View
14 prepcodeblocks.sh
@@ -2,16 +2,4 @@
GEN='CodeBlocks - Unix Makefiles'
-if [ "$1" = "examples" ]; then
- echo Building example projects
- BUILDDIR=buildex
- EXAMPLES='-DBUILD_EXAMPLES:BOOL=YES'
-else
- echo Building projects
- BUILDDIR=build
-fi
-
-mkdir -p "$BUILDDIR"
-pushd "$BUILDDIR"
-cmake -G "$GEN" "$EXAMPLES" ..
-popd
+source ${0%/*}/prepmake.sh "$@"
View
14 prepeclipse.sh
@@ -2,16 +2,4 @@
GEN='Eclipse CDT4 - Unix Makefiles'
-if [ "$1" = "examples" ]; then
- echo Building example projects
- BUILDDIR=buildex
- EXAMPLES='-DBUILD_EXAMPLES:BOOL=YES'
-else
- echo Building projects
- BUILDDIR=build
-fi
-
-mkdir -p "$BUILDDIR"
-pushd "$BUILDDIR"
-cmake -G "$GEN" "$EXAMPLES" ..
-popd
+source ${0%/*}/prepmake.sh "$@"
View
12 prepmac.sh
@@ -2,20 +2,12 @@
GEN='Xcode'
-if [ "$1" = "examples" ]; then
- echo Building example projects
- BUILDDIR=buildex
- EXAMPLES='-DBUILD_EXAMPLES:BOOL=YES'
-else
- echo Building projects
- BUILDDIR=build
-fi
+source ${0%/*}/common.sh "$@"
ARCH=-DCMAKE_OSX_ARCHITECTURES="i386;x86_64"
-mkdir -p "$BUILDDIR"
pushd "$BUILDDIR"
-cmake -G "$GEN" "$EXAMPLES" $ARCH ..
+cmake -G "$GEN" -DPROJECTS_DIR="${PROJDIR}" ${ARCH} "$@" "${FB_ROOT}"
popd
if [ -f "cmake/patch_xcode.py" ]; then
View
16 prepmake.sh
@@ -1,17 +1,11 @@
#!/bin/bash
-GEN='Unix Makefiles'
-
-if [ "$1" = "examples" ]; then
- echo Building example projects
- BUILDDIR=buildex
- EXAMPLES='-DBUILD_EXAMPLES:BOOL=YES'
-else
- echo Building projects
- BUILDDIR=build
+if [ "${GEN}" = "" ]; then
+ GEN='Unix Makefiles'
fi
-mkdir -p "$BUILDDIR"
+source ${0%/*}/common.sh "$@"
+
pushd "$BUILDDIR"
-cmake -G "$GEN" "$EXAMPLES" ..
+cmake -G "$GEN" -DPROJECTS_DIR="${PROJDIR}" "$@" "${FB_ROOT}"
popd

0 comments on commit 31f1e91

Please sign in to comment.
Something went wrong with that request. Please try again.