Commit 3f3b9a39 authored by Dominik Charousset's avatar Dominik Charousset

added --no-examples and --no-unit-tests options

parent 27d75ca3
...@@ -228,16 +228,16 @@ else () ...@@ -228,16 +228,16 @@ else ()
set (EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin CACHE PATH "Single directory for all executables") set (EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin CACHE PATH "Single directory for all executables")
endif () endif ()
enable_testing()
# set up subdirectories # set up subdirectories
add_subdirectory(unit_testing) if (NOT "${CPPA_NO_UNIT_TESTS}" STREQUAL "yes")
add_subdirectory(examples) add_subdirectory(unit_testing)
add_subdirectory(benchmarks) add_dependencies(all_unit_tests libcppa)
enable_testing()
add_dependencies(all_examples libcppa) endif ()
add_dependencies(all_unit_tests libcppa) if (NOT "${CPPA_NO_EXAMPLES}" STREQUAL "yes")
add_dependencies(all_benchmarks libcppa) add_subdirectory(examples)
add_dependencies(all_examples libcppa)
endif ()
# set optional flags # set optional flags
string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) string(TOUPPER ${CMAKE_BUILD_TYPE} build_type)
...@@ -274,11 +274,25 @@ if (CPPA_LOG_LEVEL) ...@@ -274,11 +274,25 @@ if (CPPA_LOG_LEVEL)
endif () endif ()
endif (CPPA_LOG_LEVEL) endif (CPPA_LOG_LEVEL)
if (ENABLE_DEBUG) macro (toYesNo in out)
set(DEBUG_MODE_STR "yes") if (${in})
else (ENABLE_DEBUG) set(${out} "yes")
set(DEBUG_MODE_STR "no") else ()
endif (ENABLE_DEBUG) set(${out} "no")
endif ()
endmacro ()
macro (invertYesNo in out)
if ("${in}" STREQUAL "yes")
set(${out} "no")
else ()
set(${out} "yes")
endif ()
endmacro ()
toYesNo(ENABLE_DEBUG DEBUG_MODE_STR)
invertYesNo(CPPA_NO_EXAMPLES BUILD_EXAMPLES)
invertYesNo(CPPA_NO_UNIT_TESTS BUILD_UNIT_TESTS)
# done (print summary) # done (print summary)
message("\n====================| Build Summary |====================" message("\n====================| Build Summary |===================="
...@@ -289,6 +303,8 @@ message("\n====================| Build Summary |====================" ...@@ -289,6 +303,8 @@ message("\n====================| Build Summary |===================="
"\nDebug mode: ${DEBUG_MODE_STR}" "\nDebug mode: ${DEBUG_MODE_STR}"
"\nLog level: ${LOG_LEVEL_STR}" "\nLog level: ${LOG_LEVEL_STR}"
"\nContext switching: ${CONTEXT_SWITCHING}" "\nContext switching: ${CONTEXT_SWITCHING}"
"\nBuild examples: ${BUILD_EXAMPLES}"
"\nBuild unit tests: ${BUILD_UNIT_TESTS}"
"\n" "\n"
"\nCXX: ${CMAKE_CXX_COMPILER}" "\nCXX: ${CMAKE_CXX_COMPILER}"
"\nCXXFLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${build_type}}" "\nCXXFLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${build_type}}"
......
...@@ -29,6 +29,8 @@ Usage: $0 [OPTION]... [VAR=VALUE]... ...@@ -29,6 +29,8 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
--with-clang=FILE path to clang++ executable --with-clang=FILE path to clang++ executable
--with-gcc=FILE path to g++ executable --with-gcc=FILE path to g++ executable
--dual-build build both with gcc and clang --dual-build build both with gcc and clang
--no-examples build libcppa without examples
--no-unit-tests build libcppa without unit tests
Installation Directories: Installation Directories:
--prefix=PREFIX installation directory [/usr/local] --prefix=PREFIX installation directory [/usr/local]
...@@ -206,6 +208,12 @@ while [ $# -ne 0 ]; do ...@@ -206,6 +208,12 @@ while [ $# -ne 0 ]; do
--dual-build) --dual-build)
dualbuild=1 dualbuild=1
;; ;;
--no-examples)
append_cache_entry CPPA_NO_EXAMPLES STRING yes
;;
--no-unit-tests)
append_cache_entry CPPA_NO_UNIT_TESTS STRING yes
;;
*) *)
echo "Invalid option '$1'. Try $0 --help to see available options." echo "Invalid option '$1'. Try $0 --help to see available options."
exit 1 exit 1
......
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