Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mwormit
committed
Dec 17, 2013
0 parents
commit c100e65
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# | ||
# Set up third-party dependencies for libwfa | ||
# | ||
|
||
|
||
# TODO: add armadillo here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" .. | ||
|