Commit efa308f7 authored by Dominik Charousset's avatar Dominik Charousset

Merge branch 'unstable' of github.com:Neverlord/libcppa into unstable

parents f693066a d7a6c2b7
...@@ -17,7 +17,9 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O4") ...@@ -17,7 +17,9 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O4")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
if (ENABLE_DEBUG) if (ENABLE_DEBUG)
set(CMAKE_BUILD_TYPE Debug) set(CMAKE_BUILD_TYPE Debug)
add_definitions("-DCPPA_DEBUG") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCPPA_DEBUG")
else ()
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif () endif ()
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
...@@ -203,3 +205,24 @@ add_dependencies(mailbox_performance libcppa) ...@@ -203,3 +205,24 @@ add_dependencies(mailbox_performance libcppa)
add_dependencies(mixed_case libcppa) add_dependencies(mixed_case libcppa)
add_dependencies(distributed libcppa) add_dependencies(distributed libcppa)
add_dependencies(matching libcppa) add_dependencies(matching libcppa)
string(TOUPPER ${CMAKE_BUILD_TYPE} build_type)
message(
"\n====================| Build Summary |===================="
"\n"
"\nLibcppa version: ${LIBRARY_VERSION}"
"\n"
"\nSource directory: ${CMAKE_SOURCE_DIR}"
"\nBuild directory: ${CMAKE_BINARY_DIR}"
"\nExecutable path: ${EXECUTABLE_OUTPUT_PATH}"
"\nLibrary path: ${LIBRARY_OUTPUT_PATH}"
"\nInstall prefix: ${CMAKE_INSTALL_PREFIX}"
"\nDebug mode: ${ENABLE_DEBUG}"
"\n"
"\nCXX: ${CMAKE_CXX_COMPILER}"
"\nCXXFLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${build_type}}"
"\n"
"\nBoost: ${Boost_INCLUDE_DIR}"
"\n"
"\n===========================================================\n"
)
...@@ -59,15 +59,10 @@ append_cache_entry () ...@@ -59,15 +59,10 @@ append_cache_entry ()
# $5 is the CMake generator. # $5 is the CMake generator.
configure () configure ()
{ {
CMakeCacheEntries="" CMakeCacheEntries=$CMakeDefaultCache
echo "-------------------------------------------------"
if [ -n "$1" ]; then if [ -n "$1" ]; then
append_cache_entry CMAKE_CXX_COMPILER FILEPATH $1 append_cache_entry CMAKE_CXX_COMPILER FILEPATH $1
echo "compiler: $1"
else
echo "compiler: system default"
fi fi
if [ -n "$2" ]; then if [ -n "$2" ]; then
...@@ -76,26 +71,19 @@ configure () ...@@ -76,26 +71,19 @@ configure ()
workdir=$builddir workdir=$builddir
fi fi
workdirs="$workdirs $workdir" workdirs="$workdirs $workdir"
echo "build directory: $workdir"
if [ -n "$3" ]; then if [ -n "$3" ]; then
append_cache_entry EXECUTABLE_OUTPUT_PATH PATH $3 append_cache_entry EXECUTABLE_OUTPUT_PATH PATH $3
echo "executable output directory: $3"
else else
append_cache_entry EXECUTABLE_OUTPUT_PATH PATH "$workdir/bin" append_cache_entry EXECUTABLE_OUTPUT_PATH PATH "$workdir/bin"
echo "executable output directory: $workdir/bin"
fi fi
if [ -n "$4" ]; then if [ -n "$4" ]; then
append_cache_entry LIBRARY_OUTPUT_PATH PATH $4 append_cache_entry LIBRARY_OUTPUT_PATH PATH $4
echo "library output directory: $4"
else else
append_cache_entry LIBRARY_OUTPUT_PATH PATH "$workdir/lib" append_cache_entry LIBRARY_OUTPUT_PATH PATH "$workdir/lib"
echo "library output directory: $workdir/lib"
fi fi
echo "-------------------------------------------------"
if [ -d $workdir ]; then if [ -d $workdir ]; then
# If a build directory exists, check if it has a CMake cache. # If a build directory exists, check if it has a CMake cache.
if [ -f $workdir/CMakeCache.txt ]; then if [ -f $workdir/CMakeCache.txt ]; then
...@@ -176,6 +164,10 @@ while [ $# -ne 0 ]; do ...@@ -176,6 +164,10 @@ while [ $# -ne 0 ]; do
shift shift
done done
# At this point we save the global CMake variables so that configure() can
# later use them.
CMakeDefaultCache=$CMakeCacheEntries
if [ -n "$dualbuild" ]; then if [ -n "$dualbuild" ]; then
# Use what we got in $PATH if --with-clang or --with-gcc is not specified. # Use what we got in $PATH if --with-clang or --with-gcc is not specified.
if [ -z "$clang" ]; then if [ -z "$clang" ]; then
...@@ -202,33 +194,25 @@ fi ...@@ -202,33 +194,25 @@ fi
echo "DIRS :=$workdirs\n" > $sourcedir/Makefile echo "DIRS :=$workdirs\n" > $sourcedir/Makefile
read -d '' makefile <<"EOT" read -d '' makefile <<"EOT"
all: configured all:
@for i in $(DIRS); do $(MAKE) -C $$i $@; done @for i in $(DIRS); do $(MAKE) -C $$i $@; done
configured: test:
@for i in $(DIRS); do \\
test -d $$i || \\
( echo "Error: No build directory found. Did you run configure?" && exit 1 ); \\
test -e $$i/Makefile || \\
( echo "Error: No Makefile in build directory found. Did you run configure?" && exit 1 ); \\
done
test: configured
@for i in $(DIRS); do $(MAKE) -C $$i $@; done @for i in $(DIRS); do $(MAKE) -C $$i $@; done
install: install:
@for i in $(DIRS); do $(MAKE) -C $$i $@; done @for i in $(DIRS); do $(MAKE) -C $$i $@; done
uninstall: configured uninstall:
@for i in $(DIRS); do $(MAKE) -C $$i $@; done @for i in $(DIRS); do $(MAKE) -C $$i $@; done
clean: configured clean:
@for i in $(DIRS); do $(MAKE) -C $$i $@; done @for i in $(DIRS); do $(MAKE) -C $$i $@; done
distclean: distclean:
rm -rf $(DIRS) Makefile rm -rf $(DIRS) Makefile
.PHONY: all configured test install uninstall clean distclean .PHONY: all test install uninstall clean distclean
EOT EOT
echo "$makefile" >> $sourcedir/Makefile echo "$makefile" >> $sourcedir/Makefile
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment