Commit 5441a064 authored by Dominik Charousset's avatar Dominik Charousset

Reorganize main repository

Add nexus, probe-event, and benchmarks as submodules and cleaned up all CMake
build scripts.
parent 068470bb
[submodule "benchmarks"]
path = benchmarks
url = https://github.com/actor-framework/benchmarks.git
[submodule "probe-event"]
path = probe-event
url = https://github.com/actor-framework/probe-event.git
[submodule "nexus"]
path = nexus
url = https://github.com/actor-framework/nexus.git
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
project(caf C CXX) project(caf C CXX)
################################################################################
# make sure all variables are set to "no" if undefined for summary output #
################################################################################
if(NOT CAF_ENABLE_RUNTIME_CHECKS)
set(CAF_ENABLE_RUNTIME_CHECKS no)
endif()
if(NOT CAF_NO_MEM_MANAGEMENT)
set(CAF_NO_MEM_MANAGEMENT no)
endif()
if(NOT CAF_HAS_PROBE_EVENTS)
set(CAF_HAS_PROBE_EVENTS no)
endif()
if(NOT CAF_BUILD_STATIC_ONLY)
set(CAF_BUILD_STATIC_ONLY no)
endif()
if(NOT CAF_BUILD_STATIC)
set(CAF_BUILD_STATIC no)
endif()
################################################################################
# get version of CAF #
################################################################################
# read content of config.hpp # read content of config.hpp
file(READ "libcaf_core/caf/config.hpp" CONFIG_HPP) file(READ "libcaf_core/caf/config.hpp" CONFIG_HPP)
# get line containing the version # get line containing the version
...@@ -12,260 +38,313 @@ math(EXPR CAF_VERSION_MAJOR "${VERSION_INT} / 10000") ...@@ -12,260 +38,313 @@ math(EXPR CAF_VERSION_MAJOR "${VERSION_INT} / 10000")
math(EXPR CAF_VERSION_MINOR "( ${VERSION_INT} / 100) % 100") math(EXPR CAF_VERSION_MINOR "( ${VERSION_INT} / 100) % 100")
math(EXPR CAF_VERSION_PATCH "${VERSION_INT} % 100") math(EXPR CAF_VERSION_PATCH "${VERSION_INT} % 100")
# create full version string # create full version string
set(CAF_VERSION "${CAF_VERSION_MAJOR}.${CAF_VERSION_MINOR}.${CAF_VERSION_PATCH}") set(CAF_VERSION
"${CAF_VERSION_MAJOR}.${CAF_VERSION_MINOR}.${CAF_VERSION_PATCH}")
################################################################################
# set output paths for binaries and libraries if not provided by the user #
################################################################################
# prohibit in-source builds # prohibit in-source builds
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "In-source builds are not allowed. Please use " message(FATAL_ERROR "In-source builds are not allowed. Please use "
"./configure to choose a build directory and " "./configure to choose a build directory and "
"initialize the build configuration.") "initialize the build configuration.")
endif () endif()
# set module path appropriately
set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
# set binary output path if not defined by user
# set binary output path if("${EXECUTABLE_OUTPUT_PATH}" STREQUAL "")
if ("${EXECUTABLE_OUTPUT_PATH}" STREQUAL "")
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin") set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
endif () endif()
# set library output path if not defined by user, but always set
# set library output path # library output path to binary output path for Xcode projects
if ("${LIBRARY_OUTPUT_PATH}" STREQUAL "") if("${CMAKE_GENERATOR}" STREQUAL "Xcode")
set(LIBRARY_OUTPUT_PATH "${EXECUTABLE_OUTPUT_PATH}")
elseif("${LIBRARY_OUTPUT_PATH}" STREQUAL "")
set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib") set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib")
endif () endif()
# set library output path to binary output path for Xcode projects
if ("${CMAKE_GENERATOR}" STREQUAL "Xcode") ################################################################################
set(LIBRARY_OUTPUT_PATH "${EXECUTABLE_OUTPUT_PATH}") # compiler setup #
endif () ################################################################################
# check for g++ >= 4.7 or clang++ > = 3.2 # check for g++ >= 4.7 or clang++ > = 3.2
try_run(ProgramResult try_run(ProgramResult
CompilationSucceeded CompilationSucceeded
${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/get_compiler_version.cpp ${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/cmake/get_compiler_version.cpp
RUN_OUTPUT_VARIABLE CompilerVersion) RUN_OUTPUT_VARIABLE CompilerVersion)
if (NOT CompilationSucceeded OR NOT ProgramResult EQUAL 0) if(NOT CompilationSucceeded OR NOT ProgramResult EQUAL 0)
message(FATAL_ERROR "Cannot determine compiler version") message(FATAL_ERROR "Cannot determine compiler version")
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
if (CompilerVersion VERSION_GREATER 4.6) if(CompilerVersion VERSION_GREATER 4.6)
message(STATUS "Found g++ version ${CompilerVersion}") message(STATUS "Found g++ version ${CompilerVersion}")
else () else()
message(FATAL_ERROR "g++ >= 4.7 required (found: ${CompilerVersion}.") message(FATAL_ERROR "g++ >= 4.7 required (found: ${CompilerVersion})")
endif () endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
if (CompilerVersion VERSION_GREATER 3.1) if(CompilerVersion VERSION_GREATER 3.1)
message(STATUS "Found clang++ version ${CompilerVersion}") message(STATUS "Found clang++ version ${CompilerVersion}")
else () else()
message(FATAL_ERROR "clang++ >= 3.2 required (found: ${CompilerVersion}.") message(FATAL_ERROR "clang++ >= 3.2 required (found: ${CompilerVersion})")
endif () endif()
else () else()
message(FATAL_ERROR "Your C++ compiler does not support C++11 " message(FATAL_ERROR "Your C++ compiler does not support C++11 "
"or is not supported") "or is not supported")
endif () endif()
# check if the user provided CXXFLAGS, set defaults otherwise
# check if the user provided CXXFLAGS on the command line if(CMAKE_CXX_FLAGS)
if (CMAKE_CXX_FLAGS)
set(CXXFLAGS_PROVIDED true) set(CXXFLAGS_PROVIDED true)
set(CMAKE_CXX_FLAGS_DEBUG "") set(CMAKE_CXX_FLAGS_DEBUG "")
set(CMAKE_CXX_FLAGS_MINSIZEREL "") set(CMAKE_CXX_FLAGS_MINSIZEREL "")
set(CMAKE_CXX_FLAGS_RELEASE "") set(CMAKE_CXX_FLAGS_RELEASE "")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "")
else () else()
set(CXXFLAGS_PROVIDED false) set(CXXFLAGS_PROVIDED false)
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
message(STATUS "NOTE: Automatically added -stdlib=libc++ flag, " message(STATUS "NOTE: Automatically added -stdlib=libc++ flag, "
"you can override this by defining CMAKE_CXX_FLAGS " "you can override this by defining CMAKE_CXX_FLAGS "
"(see 'configure --help')") "(see 'configure --help')")
set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++") set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++")
if (MORE_CLANG_WARNINGS) if(MORE_CLANG_WARNINGS)
set(CMAKE_CXX_FLAGS "-pedantic -Weverything -Wno-c++98-compat -Wno-padded -Wno-documentation-unknown-command -Wno-exit-time-destructors -Wno-global-constructors -Wno-missing-prototypes -Wno-c++98-compat-pedantic -Wno-unused-member-function -Wno-unused-const-variable") set(CMAKE_CXX_FLAGS "-pedantic -Weverything -Wno-c++98-compat "
endif () "-Wno-padded -Wno-documentation-unknown-command "
else () "-Wno-exit-time-destructors -Wno-global-constructors "
"-Wno-missing-prototypes -Wno-c++98-compat-pedantic "
"-Wno-unused-member-function "
"-Wno-unused-const-variable")
endif()
else()
set(CMAKE_CXX_FLAGS "-std=c++11 -Wextra -Wall -pedantic") set(CMAKE_CXX_FLAGS "-std=c++11 -Wextra -Wall -pedantic")
endif () endif()
if (MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWIN32")
include (GenerateExportHeader)
endif(MINGW)
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os") set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
endif () endif()
# set build default build type to RelWithDebInfo if not set
# set build type (evaluate CAF_ENABLE_RUNTIME_CHECKS flag) if(NOT CMAKE_BUILD_TYPE)
if (CAF_ENABLE_RUNTIME_CHECKS) set(CMAKE_BUILD_TYPE RelWithDebInfo)
add_definitions(-DCAF_ENABLE_RUNTIME_CHECKS) endif()
message(STATUS "Enable runtime checks") # enable clang's address sanitizer if requested by the user
endif (CAF_ENABLE_RUNTIME_CHECKS) if(ENABLE_ADDRESS_SANITIZER)
set(CMAKE_CXX_FLAGS
if (ENABLE_ADDRESS_SANITIZER) "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
message(STATUS "Enable address sanitizer") message(STATUS "Enable address sanitizer")
endif (ENABLE_ADDRESS_SANITIZER) endif(ENABLE_ADDRESS_SANITIZER)
# -pthread is ignored on MacOSX, enable it for all other platforms
if(NOT APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
endif()
# extra setup steps needed on MinGW
if(MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWIN32")
include(GenerateExportHeader)
set(LD_FLAGS "ws2_32 -liphlpapi")
endif()
# needed by subprojects
set(LD_FLAGS ${CMAKE_LD_LIBS})
if (CAF_LOG_LEVEL)
add_definitions(-DCAF_LOG_LEVEL=${CAF_LOG_LEVEL})
endif(CAF_LOG_LEVEL)
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") ################################################################################
# add custom definitions requested via configure script #
################################################################################
# set build default build type if not set if(CAF_LOG_LEVEL)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "") add_definitions(-DCAF_LOG_LEVEL=${CAF_LOG_LEVEL})
set(CMAKE_BUILD_TYPE RelWithDebInfo) endif()
endif ("${CMAKE_BUILD_TYPE}" STREQUAL "")
# all libs need access to core headers if(CAF_ENABLE_RUNTIME_CHECKS)
set(INCLUDE_DIRS libcaf_core) add_definitions(-DCAF_ENABLE_RUNTIME_CHECKS)
set(LD_DIRS) endif()
set(LD_FLAGS ${CMAKE_LD_LIBS})
if (APPLE) if(CAF_NO_MEM_MANAGEMENT)
# -pthread is ignored on MacOSX add_definitions(-DCAF_NO_MEM_MANAGEMENT)
elseif (UNIX) endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
elseif (MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
set(LD_FLAGS "ws2_32 -liphlpapi")
endif ()
if (DISABLE_MEM_MANAGEMENT)
add_definitions(-DCAF_DISABLE_MEM_MANAGEMENT)
endif (DISABLE_MEM_MANAGEMENT)
link_directories(${LD_DIRS}) ################################################################################
include_directories(${INCLUDE_DIRS}) # setup for install target #
################################################################################
# install includes from core # install includes from core
install(DIRECTORY libcaf_core/caf/ DESTINATION include/caf FILES_MATCHING PATTERN "*.hpp") install(DIRECTORY libcaf_core/caf/
install(DIRECTORY libcaf_core/cppa/ DESTINATION include/cppa FILES_MATCHING PATTERN "*.hpp") DESTINATION include/caf FILES_MATCHING PATTERN "*.hpp")
# install CPPA compatibility headers
install(DIRECTORY libcaf_core/cppa/
DESTINATION include/cppa FILES_MATCHING PATTERN "*.hpp")
# install includes from io # install includes from io
install(DIRECTORY libcaf_io/caf/ DESTINATION include/caf FILES_MATCHING PATTERN "*.hpp") install(DIRECTORY libcaf_io/caf/ DESTINATION include/caf
FILES_MATCHING PATTERN "*.hpp")
# process cmake_uninstall.cmake.in # process cmake_uninstall.cmake.in
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY) IMMEDIATE @ONLY)
# add uninstall target # add uninstall target
add_custom_target(uninstall add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
# set path to caf core & io headers for subdirectories
set (LIBCAF_INCLUDE_DIRS
${CMAKE_SOURCE_DIR}/libcaf_core
${CMAKE_SOURCE_DIR}/libcaf_io)
# set up subdirectories, todo: allow configure option to disable io ################################################################################
# set inclue paths for subprojects #
################################################################################
# path to caf core & io headers
set(LIBCAF_INCLUDE_DIRS
${CMAKE_SOURCE_DIR}/libcaf_core
${CMAKE_SOURCE_DIR}/libcaf_io)
# path to probe-event headers (if submodule is loaded)
if(EXISTS "${CMAKE_SOURCE_DIR}/probe-event/caf")
set(LIBCAF_INCLUDE_DIRS
${CMAKE_SOURCE_DIR}/probe-event/ ${LIBCAF_INCLUDE_DIRS})
# make files from probe-event show up in IDE
file(GLOB PROBE_EVENTS_HDRS
"${CMAKE_SOURCE_DIR}/probe-event/caf/probe_event/*.hpp")
add_custom_target(caf_probe_events_dummy SOURCES ${PROBE_EVENTS_HDRS})
set(CAF_HAS_PROBE_EVENTS yes)
endif()
# all projects need the headers of the core components
include_directories(${LIBCAF_INCLUDE_DIRS})
################################################################################
# add subprojects #
################################################################################
# core library
message(STATUS "Enter subdirectory libcaf_core")
add_subdirectory(libcaf_core) add_subdirectory(libcaf_core)
# set core lib for sub directories # set core lib for sub directories
set (LIBCAF_CORE_LIBRARY libcaf_core) set(LIBCAF_CORE_LIBRARY libcaf_core)
message(STATUS "Enter subdirectory libcaf_io")
add_subdirectory(libcaf_io) add_subdirectory(libcaf_io)
# set io lib for sub directories # set io lib for sub directories
set (LIBCAF_IO_LIBRARY libcaf_io) set(LIBCAF_IO_LIBRARY libcaf_io)
if ("${CAF_BUILD_STATIC_ONLY}" STREQUAL "yes" OR "${CAF_BUILD_STATIC}" STREQUAL "yes") # tell CMake caf_io depends on caf_core
if(CAF_BUILD_STATIC_ONLY OR CAF_BUILD_STATIC)
add_dependencies(libcaf_ioStatic libcaf_coreStatic) add_dependencies(libcaf_ioStatic libcaf_coreStatic)
endif () endif()
if (NOT "${CAF_BUILD_STATIC_ONLY}" STREQUAL "yes") if(NOT "${CAF_BUILD_STATIC_ONLY}" STREQUAL "yes")
add_dependencies(libcaf_io libcaf_core) add_dependencies(libcaf_io libcaf_core)
endif () endif()
# set list variable for sub directories # set LIBCAF_LIBRARIES for other subprojects
set (LIBCAF_LIBRARIES ${LIBCAF_CORE_LIBRARY} ${LIBCAF_IO_LIBRARY}) set(LIBCAF_LIBRARIES ${LIBCAF_CORE_LIBRARY} ${LIBCAF_IO_LIBRARY})
# add unit tests if not being told otherwise
if (NOT "${CAF_NO_UNIT_TESTS}" STREQUAL "yes") if(NOT CAF_NO_UNIT_TESTS)
enable_testing() enable_testing()
message(STATUS "Enter subdirectory unit_testing")
add_subdirectory(unit_testing) add_subdirectory(unit_testing)
add_dependencies(all_unit_tests libcaf_io) add_dependencies(all_unit_tests libcaf_io)
endif () endif()
if (NOT "${CAF_NO_EXAMPLES}" STREQUAL "yes") # build examples if not being told otherwise
if(NOT CAF_NO_EXAMPLES)
message(STATUS "Enter subdirectory examples")
add_subdirectory(examples) add_subdirectory(examples)
add_dependencies(all_examples libcaf_io) add_dependencies(all_examples libcaf_io)
endif () endif()
# build nexus if not being told otherwise
# set optional flags if(NOT CAF_NO_NEXUS AND EXISTS "${CMAKE_SOURCE_DIR}/nexus/caf/")
string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) if(NOT CAF_HAS_PROBE_EVENTS)
message(WARNING "cannot build nexus: probe-event submodule missing")
set(CAF_NO_NEXUS yes)
else()
message(STATUS "Enter subdirectory nexus")
add_subdirectory(nexus)
add_dependencies(nexus libcaf_io)
set(CAF_NO_NEXUS no)
endif()
else()
# make sure variable is set for build log
set(CAF_NO_NEXUS yes)
endif()
# build benchmarks if not being told otherwise
if(NOT CAF_NO_BENCHMARKS AND EXISTS "${CMAKE_SOURCE_DIR}/benchmarks/caf/")
message(STATUS "Enter subdirectory benchmarks")
add_subdirectory(benchmarks)
add_dependencies(all_benchmarks libcaf_io)
else()
# make sure variable is set for build log
set(CAF_NO_BENCHMARKS yes)
endif()
################################################################################
# Doxygen setup #
################################################################################
# check for doxygen and add custom "doc" target to Makefile # check for doxygen and add custom "doc" target to Makefile
find_package(Doxygen) find_package(Doxygen)
if (DOXYGEN_FOUND) if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile
@ONLY) @ONLY)
add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/Doxyfile add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/Doxyfile
WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY} WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}
COMMENT "Generating API documentation with Doxygen" COMMENT "Generating API documentation with Doxygen"
VERBATIM) VERBATIM)
endif (DOXYGEN_FOUND) endif(DOXYGEN_FOUND)
# set variables for summary ################################################################################
# print summary #
################################################################################
# set human-readable representation for log level
set(LOG_LEVEL_STR "none") set(LOG_LEVEL_STR "none")
if (CAF_LOG_LEVEL) if(CAF_LOG_LEVEL)
if (${CAF_LOG_LEVEL} EQUAL 0) if(${CAF_LOG_LEVEL} EQUAL 0)
set(LOG_LEVEL_STR "ERROR") set(LOG_LEVEL_STR "ERROR")
elseif (${CAF_LOG_LEVEL} EQUAL 1) elseif(${CAF_LOG_LEVEL} EQUAL 1)
set(LOG_LEVEL_STR "WARNING") set(LOG_LEVEL_STR "WARNING")
elseif (${CAF_LOG_LEVEL} EQUAL 2) elseif(${CAF_LOG_LEVEL} EQUAL 2)
set(LOG_LEVEL_STR "INFO") set(LOG_LEVEL_STR "INFO")
elseif (${CAF_LOG_LEVEL} EQUAL 3) elseif(${CAF_LOG_LEVEL} EQUAL 3)
set(LOG_LEVEL_STR "DEBUG") set(LOG_LEVEL_STR "DEBUG")
elseif (${CAF_LOG_LEVEL} EQUAL 4) elseif(${CAF_LOG_LEVEL} EQUAL 4)
set(LOG_LEVEL_STR "TRACE") set(LOG_LEVEL_STR "TRACE")
else () else()
set(LOG_LEVEL_STR "invalid") set(LOG_LEVEL_STR "invalid")
endif () endif()
endif (CAF_LOG_LEVEL) endif()
# little helper macro to invert a boolean
macro (toYesNo in out) macro(invertYesNo in out)
if (${in}) if(${in})
set(${out} "yes") set(${out} no)
else () else()
set(${out} "no") set(${out} yes)
endif () endif()
endmacro () endmacro()
# invert CAF_NO_* variables for nicer output
macro (invertYesNo in out) invertYesNo(CAF_NO_EXAMPLES CAF_BUILD_EXAMPLES)
if ("${in}" STREQUAL "yes") invertYesNo(CAF_NO_UNIT_TESTS CAF_BUILD_UNIT_TESTS)
set(${out} "no") invertYesNo(CAF_NO_NEXUS CAF_BUILD_NEXUS)
else () invertYesNo(CAF_NO_MEM_MANAGEMENT CAF_BUILD_MEM_MANAGEMENT)
set(${out} "yes") invertYesNo(CAF_NO_BENCHMARKS CAF_BUILD_BENCHMARKS)
endif () # collect all compiler flags
endmacro () string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE)
set(ALL_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPER_BUILD_TYPE}}")
toYesNo(CAF_ENABLE_RUNTIME_CHECKS DEBUG_MODE_STR) # done
toYesNo(ENABLE_OPENCL BUILD_OPENCL_STR)
toYesNo(DISABLE_MEM_MANAGEMENT DISABLE_MEM_MANAGEMENT_STR)
invertYesNo(CAF_NO_EXAMPLES BUILD_EXAMPLES)
invertYesNo(CAF_NO_UNIT_TESTS BUILD_UNIT_TESTS)
invertYesNo(DISABLE_MEM_MANAGEMENT_STR WITH_MEM_MANAGEMENT)
if (NOT "${CAF_BUILD_STATIC}" STREQUAL "yes")
set(CAF_BUILD_STATIC "no")
endif ()
if (NOT "${CAF_BUILD_STATIC_ONLY}" STREQUAL "yes")
set(CAF_BUILD_STATIC_ONLY "no")
else ()
set(CAF_BUILD_STATIC "yes")
endif ()
# done (print summary)
message(STATUS message(STATUS
"\n====================| Build Summary |====================" "\n====================| Build Summary |===================="
"\n" "\n"
"\nLibcaf version: ${CAF_VERSION}" "\nLibcaf version: ${CAF_VERSION}"
"\n" "\n"
"\nBuild type: ${CMAKE_BUILD_TYPE}" "\nBuild type: ${CMAKE_BUILD_TYPE}"
"\nRuntime checks: ${DEBUG_MODE_STR}"
"\nLog level: ${LOG_LEVEL_STR}"
"\nBuild examples: ${BUILD_EXAMPLES}"
"\nBuild unit tests: ${BUILD_UNIT_TESTS}"
"\nBuild static: ${CAF_BUILD_STATIC}" "\nBuild static: ${CAF_BUILD_STATIC}"
"\nBulid static only: ${CAF_BUILD_STATIC_ONLY}" "\nBulid static only: ${CAF_BUILD_STATIC_ONLY}"
"\nWith mem. mgmt.: ${WITH_MEM_MANAGEMENT}" "\nRuntime checks: ${CAF_ENABLE_RUNTIME_CHECKS}"
"\nLog level: ${LOG_LEVEL_STR}"
"\nWith mem. mgmt.: ${CAF_BUILD_MEM_MANAGEMENT}"
"\n"
"\nBuild examples: ${CAF_BUILD_EXAMPLES}"
"\nBuild unit tests: ${CAF_BUILD_UNIT_TESTS}"
"\nBuild nexus: ${CAF_BUILD_NEXUS}"
"\nBuild benchmarks: ${CAF_BUILD_BENCHMARKS}"
"\n" "\n"
"\nCXX: ${CMAKE_CXX_COMPILER}" "\nCXX: ${CMAKE_CXX_COMPILER}"
"\nCXXFLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${build_type}}" "\nCXXFLAGS: ${ALL_CXX_FLAGS}"
"\nLD_DIRS: ${LD_DIRS}"
"\nLIBRARIES: ${LD_FLAGS}" "\nLIBRARIES: ${LD_FLAGS}"
"\n" "\n"
"\nSource directory: ${CMAKE_SOURCE_DIR}" "\nSource directory: ${CMAKE_SOURCE_DIR}"
......
Subproject commit 5a0d36801a387b718e4bb1b34bcb75f3e6e25d3f
...@@ -5,15 +5,13 @@ int main() { ...@@ -5,15 +5,13 @@ int main() {
# ifdef __clang__ # ifdef __clang__
cout << __clang_major__ cout << __clang_major__
<< "." << "."
<< __clang_minor__ << __clang_minor__;
<< endl;
# elif defined(__GNUC__) # elif defined(__GNUC__)
cout << __GNUC__ cout << __GNUC__
<< "." << "."
<< __GNUC_MINOR__ << __GNUC_MINOR__;
<< endl;
# else # else
cout << "0.0" << endl; cout << "0.0";
# endif # endif
return 0; return 0;
} }
...@@ -181,27 +181,27 @@ while [ $# -ne 0 ]; do ...@@ -181,27 +181,27 @@ while [ $# -ne 0 ]; do
append_cache_entry CMAKE_INSTALL_PREFIX PATH $optarg append_cache_entry CMAKE_INSTALL_PREFIX PATH $optarg
;; ;;
--with-runtime-checks) --with-runtime-checks)
append_cache_entry CAF_ENABLE_RUNTIME_CHECKS BOOL true append_cache_entry CAF_ENABLE_RUNTIME_CHECKS BOOL yes
;; ;;
--enable-debug) --enable-debug)
echo "*** warning: --enable-debug is deprecated, please use --with-runtime-checks instead" echo "*** warning: --enable-debug is deprecated, please use --with-runtime-checks instead"
append_cache_entry CAF_ENABLE_RUNTIME_CHECKS BOOL true append_cache_entry CAF_ENABLE_RUNTIME_CHECKS BOOL yes
;; ;;
--enable-address-sanitizer) --enable-address-sanitizer)
append_cache_entry ENABLE_ADDRESS_SANITIZER BOOL true append_cache_entry ENABLE_ADDRESS_SANITIZER BOOL yes
;; ;;
--no-memory-management) --no-memory-management)
append_cache_entry DISABLE_MEM_MANAGEMENT BOOL true append_cache_entry CAF_NO_MEM_MANAGEMENT BOOL yes
;; ;;
--without-memory-management) --without-memory-management)
echo "*** WARNING: --without-memory-management is deprecated" echo "*** WARNING: --without-memory-management is deprecated"
append_cache_entry DISABLE_MEM_MANAGEMENT BOOL true append_cache_entry DISABLE_MEM_MANAGEMENT BOOL yes
;; ;;
--standalone-build) --standalone-build)
echo "*** WARNING: --standalone-build is deprecated" echo "*** WARNING: --standalone-build is deprecated"
;; ;;
--more-clang-warnings) --more-clang-warnings)
append_cache_entry MORE_CLANG_WARNINGS BOOL true append_cache_entry MORE_CLANG_WARNINGS BOOL yes
;; ;;
--with-log-level=*) --with-log-level=*)
level=`echo "$optarg" | tr '[:lower:]' '[:upper:]'` level=`echo "$optarg" | tr '[:lower:]' '[:upper:]'`
......
...@@ -14,8 +14,8 @@ endif () ...@@ -14,8 +14,8 @@ endif ()
macro(add name folder) macro(add name folder)
add_executable(${name} ${folder}/${name}.cpp ${ARGN}) add_executable(${name} ${folder}/${name}.cpp ${ARGN})
target_link_libraries(${name} target_link_libraries(${name}
${CMAKE_DL_LIBS} ${LD_FLAGS}
${LIBCAF_LIBRARIES} ${LIBCAF_LIBRARIES}
${PTHREAD_LIBRARIES} ${PTHREAD_LIBRARIES}
${WSLIB}) ${WSLIB})
add_dependencies(${name} all_examples) add_dependencies(${name} all_examples)
......
Subproject commit 600a2a5ea21c9aa17d75bd4c28978349fbbd559b
Subproject commit 7592f1b6b8152445b2b7343d4d67a070001d742a
...@@ -8,9 +8,8 @@ include_directories(${LIBCAF_INCLUDE_DIRS}) ...@@ -8,9 +8,8 @@ include_directories(${LIBCAF_INCLUDE_DIRS})
macro(add_unit_test name) macro(add_unit_test name)
add_executable(test_${name} test_${name}.cpp test.cpp ${ARGN}) add_executable(test_${name} test_${name}.cpp test.cpp ${ARGN})
target_link_libraries(test_${name} target_link_libraries(test_${name}
${CMAKE_DL_LIBS} ${LD_FLAGS}
${LIBCAF_CORE_LIBRARY} ${LIBCAF_LIBRARIES}
${LIBCAF_IO_LIBRARY}
${PTHREAD_LIBRARIES}) ${PTHREAD_LIBRARIES})
add_test(${name} ${EXECUTABLE_OUTPUT_PATH}/test_${name}) add_test(${name} ${EXECUTABLE_OUTPUT_PATH}/test_${name})
add_dependencies(test_${name} all_unit_tests) add_dependencies(test_${name} all_unit_tests)
......
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