Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mwormit committed Dec 17, 2013
0 parents commit c100e65
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
13 changes: 13 additions & 0 deletions CMakeLists.txt
@@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 2.6)
project(LIBWFA)

get_filename_component(LIBTEST_DIR ${LIBWFA_SOURCE_DIR}/../libtest ABSOLUTE)
set(LIBWFA_DIR ${LIBWFA_SOURCE_DIR})

include(${LIBWFA_DIR}/cmake/DepsLibWFA.txt)

include_directories(${LIBWFA_DIR})

add_subdirectory(libwfa)
add_subdirectory(tests)

6 changes: 6 additions & 0 deletions cmake/DepsLibWFA.txt
@@ -0,0 +1,6 @@
#
# Set up third-party dependencies for libwfa
#


# TODO: add armadillo here
68 changes: 68 additions & 0 deletions configure
@@ -0,0 +1,68 @@
#!/bin/bash

CC0=
CXX0=
BUILD_TYPE=
GENERATOR_UNIX="Unix Makefiles"
GENERATOR_MINGW32="MinGW Makefiles"
GENERATOR=$GENERATOR_UNIX

function set_compilers() {
if [ "x$CC0" != "x" ]; then
echo "Choose only one compiler option."
exit 1
fi
CC0=$1
CXX0=$2
if [ "x$3" != "x" ]; then
GENERATOR=$3
fi
}

function set_build_type() {
if [ "x$BUILD_TYPE" != "x" ]; then
echo "Choose only one build type."
exit 1
fi
BUILD_TYPE=$1
}

while [ $# -gt 0 ]; do
case $1 in
gcc ) set_compilers "gcc" "g++"
;;
mingw32 ) set_compilers "gcc" "g++" "$GENERATOR_MINGW"
;;
intel ) set_compilers "icc" "icpc"
;;
open64 ) set_compilers "opencc" "openCC"
;;
pgi ) set_compilers "pgcc" "pgCC"
;;
ibm ) set_compilers "xlc" "xlC"
;;
debug ) set_build_type "DEBUG"
;;
release ) set_build_type "RELEASE"
;;
relwdeb ) set_build_type "RELWITHDEBINFO"
;;
esac
shift
done

CC0_SPEC=1
if [ "x$CC0" == "x" ]; then
CC0_SPEC=0
fi
if [ "x$CC" != "x" -o "x$CXX" != "x" ]; then
if [ $CC0_SPEC -eq 0 ]; then
CC0=$CC
CXX0=$CXX
fi
fi

mkdir build
cd build
CC="$CC0" CXX="$CXX0" cmake -G "$GENERATOR" -D CMAKE_BUILD_TYPE="$BUILD_TYPE" ..

0 comments on commit c100e65

Please sign in to comment.