From 540418bc7d1f84f7f1cdabbc9ccb093447f1c320 Mon Sep 17 00:00:00 2001 From: Juergen Kahrs Date: Sun, 19 May 2013 12:36:51 +0200 Subject: configure script stub as suggested by Arnold. --- cmake/configure | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 cmake/configure (limited to 'cmake/configure') diff --git a/cmake/configure b/cmake/configure new file mode 100644 index 00000000..f79d4c45 --- /dev/null +++ b/cmake/configure @@ -0,0 +1,19 @@ +# On 2013-05-14 Arnold wrote in an e-mail: + +# Date: Sun, 19 May 2013 15:55:07 +0200 Subject: First outline of the configure script invokes cmake. --- cmake/configure | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) mode change 100644 => 100755 cmake/configure (limited to 'cmake/configure') diff --git a/cmake/configure b/cmake/configure old mode 100644 new mode 100755 index f79d4c45..922568de --- a/cmake/configure +++ b/cmake/configure @@ -1,3 +1,4 @@ +#!/bin/sh # On 2013-05-14 Arnold wrote in an e-mail: # Toolchain.cmake + +# TODO: Allow the build directory to be in other places. +# A parameter is needed to pass the value. +cmake -DCMAKE_TOOLCHAIN_FILE=Toolchain.cmake .. + -- cgit v1.2.3 From 2dbda7d9bb23f050673841c42f845be539e19a2c Mon Sep 17 00:00:00 2001 From: Juergen Kahrs Date: Sun, 19 May 2013 17:15:26 +0200 Subject: configure parameters CC and --prefix work now. --- cmake/configure | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'cmake/configure') diff --git a/cmake/configure b/cmake/configure index 922568de..356bdfca 100755 --- a/cmake/configure +++ b/cmake/configure @@ -34,6 +34,15 @@ fi # TODO: Evaluate all the options and translate the options into CMake variables. CC=$( which cc ) +PREFIX="" + +for p in $@ +do + if [ ${p:0:3} = "CC=" ]; then CC=${p:3}; fi + if [ ${p:0:9} = "--prefix=" ]; then PREFIX=-DCMAKE_INSTALL_PREFIX=${p:9}; fi +done +CC=$( which $CC ) + rm -f Toolchain.cmake ( echo "set(CMAKE_C_COMPILER $CC)" @@ -44,5 +53,5 @@ rm -f Toolchain.cmake # TODO: Allow the build directory to be in other places. # A parameter is needed to pass the value. -cmake -DCMAKE_TOOLCHAIN_FILE=Toolchain.cmake .. +cmake ${PREFIX} -DCMAKE_TOOLCHAIN_FILE=Toolchain.cmake .. -- cgit v1.2.3 From 6013197b678697404fe44e8db58a9d40a2832ce4 Mon Sep 17 00:00:00 2001 From: Juergen Kahrs Date: Sun, 19 May 2013 18:29:01 +0200 Subject: configure parameters --srcdir and --with-whiny-user-strftime work now. --- cmake/configure | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'cmake/configure') diff --git a/cmake/configure b/cmake/configure index 356bdfca..d375a81c 100755 --- a/cmake/configure +++ b/cmake/configure @@ -26,20 +26,18 @@ if [ -f CMakeLists.txt ] ; then exit 1 fi -if ! [ -f ../CMakeLists.txt ] ; then - echo "The directory above your current working directory does not contain a file CMakeLists.txt." - echo "This script will run only if you are one level below the source directory." - exit 1 -fi - # TODO: Evaluate all the options and translate the options into CMake variables. CC=$( which cc ) PREFIX="" +SRCDIR=".." +WHINY="" for p in $@ do if [ ${p:0:3} = "CC=" ]; then CC=${p:3}; fi if [ ${p:0:9} = "--prefix=" ]; then PREFIX=-DCMAKE_INSTALL_PREFIX=${p:9}; fi + if [ ${p:0:9} = "--srcdir=" ]; then SRCDIR=${p:9}; fi + if [ ${p:0:26} = "--with-whiny-user-strftime" ]; then WHINY=-DUSE_INCLUDED_STRFTIME=1; fi done CC=$( which $CC ) @@ -51,7 +49,10 @@ rm -f Toolchain.cmake echo "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)" ) > Toolchain.cmake -# TODO: Allow the build directory to be in other places. -# A parameter is needed to pass the value. -cmake ${PREFIX} -DCMAKE_TOOLCHAIN_FILE=Toolchain.cmake .. +if ! [ -f ${SRCDIR}/CMakeLists.txt ] ; then + echo "The source directory (${SRCDIR}) does not contain a file CMakeLists.txt." + exit 1 +fi + +cmake ${PREFIX} ${WHINY} -DCMAKE_TOOLCHAIN_FILE=Toolchain.cmake ${SRCDIR} -- cgit v1.2.3