Skip to content

Commit

Permalink
added --no-examples and --no-unit-tests options
Browse files Browse the repository at this point in the history
  • Loading branch information
Neverlord committed Nov 4, 2012
1 parent 27d75ca commit 3f3b9a3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 14 deletions.
44 changes: 30 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,16 @@ else ()
set (EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin CACHE PATH "Single directory for all executables")
endif ()

enable_testing()

# set up subdirectories
add_subdirectory(unit_testing)
add_subdirectory(examples)
add_subdirectory(benchmarks)

add_dependencies(all_examples libcppa)
add_dependencies(all_unit_tests libcppa)
add_dependencies(all_benchmarks libcppa)
if (NOT "${CPPA_NO_UNIT_TESTS}" STREQUAL "yes")
add_subdirectory(unit_testing)
add_dependencies(all_unit_tests libcppa)
enable_testing()
endif ()
if (NOT "${CPPA_NO_EXAMPLES}" STREQUAL "yes")
add_subdirectory(examples)
add_dependencies(all_examples libcppa)
endif ()

# set optional flags
string(TOUPPER ${CMAKE_BUILD_TYPE} build_type)
Expand Down Expand Up @@ -274,11 +274,25 @@ if (CPPA_LOG_LEVEL)
endif ()
endif (CPPA_LOG_LEVEL)

if (ENABLE_DEBUG)
set(DEBUG_MODE_STR "yes")
else (ENABLE_DEBUG)
set(DEBUG_MODE_STR "no")
endif (ENABLE_DEBUG)
macro (toYesNo in out)
if (${in})
set(${out} "yes")
else ()
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)
message("\n====================| Build Summary |===================="
Expand All @@ -289,6 +303,8 @@ message("\n====================| Build Summary |===================="
"\nDebug mode: ${DEBUG_MODE_STR}"
"\nLog level: ${LOG_LEVEL_STR}"
"\nContext switching: ${CONTEXT_SWITCHING}"
"\nBuild examples: ${BUILD_EXAMPLES}"
"\nBuild unit tests: ${BUILD_UNIT_TESTS}"
"\n"
"\nCXX: ${CMAKE_CXX_COMPILER}"
"\nCXXFLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${build_type}}"
Expand Down
8 changes: 8 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
--with-clang=FILE path to clang++ executable
--with-gcc=FILE path to g++ executable
--dual-build build both with gcc and clang
--no-examples build libcppa without examples
--no-unit-tests build libcppa without unit tests
Installation Directories:
--prefix=PREFIX installation directory [/usr/local]
Expand Down Expand Up @@ -206,6 +208,12 @@ while [ $# -ne 0 ]; do
--dual-build)
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."
exit 1
Expand Down

0 comments on commit 3f3b9a3

Please sign in to comment.