11include (Functions)
22
3- if (NOT CMAKE_BUILD_TYPE )
3+ if (NOT CMAKE_BUILD_TYPE )
44 set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose Release or Debug" FORCE)
5- endif ()
5+ endif ()
66
77set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /bin)
88set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR} /bin)
@@ -33,20 +33,20 @@ set(_7BIT_DI_DETAILS_DIR "${_7BIT_DI_DI_DIR}/Details")
3333set (_7BIT_DI_MAIN_HEADER "${_7BIT_DI_INCLUDE_DIR} /SevenBit/DI.hpp" )
3434file (GLOB _7BIT_DI_TOP_HEADERS "${_7BIT_DI_DI_DIR} /*.hpp" )
3535file (GLOB _7BIT_DI_DETAILS_HEADERS
36- "${_7BIT_DI_DETAILS_DIR} /Containers/*.hpp"
37- "${_7BIT_DI_DETAILS_DIR} /Core/*.hpp"
38- "${_7BIT_DI_DETAILS_DIR} /Factories/*.hpp"
39- "${_7BIT_DI_DETAILS_DIR} /Helpers/*.hpp"
40- "${_7BIT_DI_DETAILS_DIR} /Services/*.hpp"
41- "${_7BIT_DI_DETAILS_DIR} /Utils/*.hpp"
36+ "${_7BIT_DI_DETAILS_DIR} /Containers/*.hpp"
37+ "${_7BIT_DI_DETAILS_DIR} /Core/*.hpp"
38+ "${_7BIT_DI_DETAILS_DIR} /Factories/*.hpp"
39+ "${_7BIT_DI_DETAILS_DIR} /Helpers/*.hpp"
40+ "${_7BIT_DI_DETAILS_DIR} /Services/*.hpp"
41+ "${_7BIT_DI_DETAILS_DIR} /Utils/*.hpp"
4242)
4343file (GLOB _7BIT_DI_IMPL_HEADERS
44- "${_7BIT_DI_DI_DIR} /Impl/*.hpp"
45- "${_7BIT_DI_DETAILS_DIR} /Containers/Impl/*.hpp"
46- "${_7BIT_DI_DETAILS_DIR} /Core/Impl/*.hpp"
47- "${_7BIT_DI_DETAILS_DIR} /Factories/Impl/*.hpp"
48- "${_7BIT_DI_DETAILS_DIR} /Helpers/Impl/*.hpp"
49- "${_7BIT_DI_DETAILS_DIR} /Utils/Impl/*.hpp"
44+ "${_7BIT_DI_DI_DIR} /Impl/*.hpp"
45+ "${_7BIT_DI_DETAILS_DIR} /Containers/Impl/*.hpp"
46+ "${_7BIT_DI_DETAILS_DIR} /Core/Impl/*.hpp"
47+ "${_7BIT_DI_DETAILS_DIR} /Factories/Impl/*.hpp"
48+ "${_7BIT_DI_DETAILS_DIR} /Helpers/Impl/*.hpp"
49+ "${_7BIT_DI_DETAILS_DIR} /Utils/Impl/*.hpp"
5050)
5151set (_7BIT_DI_ALL_HEADERS ${_7BIT_DI_MAIN_HEADER} ${_7BIT_DI_TOP_HEADERS} ${_7BIT_DI_DETAILS_HEADERS} ${_7BIT_DI_IMPL_HEADERS} )
5252
@@ -58,48 +58,59 @@ set_property(CACHE _7BIT_DI_LIBRARY_TYPE PROPERTY STRINGS Shared Static HeaderOn
5858option (_7BIT_DI_BUILD_PIC "Build position independent code (-fPIC)" OFF )
5959option (_7BIT_DI_BUILD_EXAMPLES "Build example" OFF )
6060option (_7BIT_DI_BUILD_BENCHMARKS "Build benchmarks" OFF )
61- option (_7BIT_DI_BUILD_TESTS "Build tests" OFF )
61+ option (_7BIT_DI_BUILD_ALL_TESTS "Build all tests" OFF )
62+ option (_7BIT_DI_BUILD_UNIT_TESTS "Build unit tests" OFF )
63+ option (_7BIT_DI_BUILD_INTEGRATION_TESTS "Build integration tests" OFF )
64+ option (_7BIT_DI_BUILD_E2E_TESTS "Build e2e tests" OFF )
6265option (_7BIT_DI_BUILD_DOCS "Turn on to build documentation (requires sphinx and doxygen installed)" OFF )
6366option (_7BIT_DI_INSTALL "Installs 7bitDI" OFF )
6467option (_7BIT_DI_BUILD_SINGLE_HEADER "Builds single header SevenBitDI.hpp" OFF )
6568
66- if (_7BIT_DI_BUILD_PIC)
69+ if (_7BIT_DI_BUILD_ALL_TESTS)
70+ set (_7BIT_DI_BUILD_UNIT_TESTS ${_7BIT_DI_BUILD_ALL_TESTS} )
71+ set (_7BIT_DI_BUILD_INTEGRATION_TESTS ${_7BIT_DI_BUILD_ALL_TESTS} )
72+ set (_7BIT_DI_BUILD_E2E_TESTS ${_7BIT_DI_BUILD_ALL_TESTS} )
73+ endif ()
74+
75+ if (_7BIT_DI_BUILD_PIC)
6776 set (CMAKE_POSITION_INDEPENDENT_CODE ON )
68- endif ()
77+ endif ()
6978
70- if (_7BIT_DI_LIBRARY_TYPE STREQUAL "Shared" OR BUILD_SHARED_LIBS )
79+ if (_7BIT_DI_LIBRARY_TYPE STREQUAL "Shared" OR BUILD_SHARED_LIBS )
7180 set (_7BIT_DI_BUILD_LIBRARY_TYPE "Shared" )
7281 set (_7BIT_DI_SHARED_LIB ON )
73- elseif (_7BIT_DI_LIBRARY_TYPE STREQUAL "HeaderOnly" )
82+ elseif (_7BIT_DI_LIBRARY_TYPE STREQUAL "HeaderOnly" )
7483 set (_7BIT_DI_BUILD_LIBRARY_TYPE "HeaderOnly" )
7584 set (_7BIT_DI_HEADER_ONLY_LIB ON )
76- else ()
85+ else ()
7786 set (_7BIT_DI_BUILD_LIBRARY_TYPE "Static" )
7887 set (_7BIT_DI_STATIC_LIB ON )
79- endif ()
88+ endif ()
8089
8190configure_file (${_7BIT_DI_DI_DIR} /CmakeDef.hpp.input ${_7BIT_DI_DI_DIR} /CmakeDef.hpp)
8291
8392set (BYTE_SIZE 8)
8493math (EXPR MEMORY_SIZE "${CMAKE_SIZEOF_VOID_P} * ${BYTE_SIZE} " )
8594
8695set (INFOS
87- "${_7BIT_DI_LIBRARY} ${_7BIT_DI_VERSION} "
88- "Build type: ${CMAKE_BUILD_TYPE} "
89- "Library type: ${_7BIT_DI_BUILD_LIBRARY_TYPE} "
90- "=================================================="
91- "Cmake version: ${CMAKE_VERSION} "
92- "Os: ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} "
93- "Architecture: ${CMAKE_SYSTEM_PROCESSOR} ${MEMORY_SIZE} bit"
94- "CXX compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} "
95- "CXX standard: ${CMAKE_CXX_STANDARD} "
96- "Generator: ${CMAKE_GENERATOR} "
97- "=================================================="
98- "Build tests: ${_7BIT_DI_BUILD_TESTS} "
99- "Build examples: ${_7BIT_DI_BUILD_EXAMPLES} "
100- "Build benchmarks: ${_7BIT_DI_BUILD_BENCHMARKS} "
101- "Build documentation: ${_7BIT_DI_BUILD_DOCS} "
102- "Build single header: ${_7BIT_DI_BUILD_SINGLE_HEADER} "
103- "Install project: ${_7BIT_DI_INSTALL} "
96+ "${_7BIT_DI_LIBRARY} ${_7BIT_DI_VERSION} "
97+ "Build type: ${CMAKE_BUILD_TYPE} "
98+ "Library type: ${_7BIT_DI_BUILD_LIBRARY_TYPE} "
99+ "=================================================="
100+ "Cmake version: ${CMAKE_VERSION} "
101+ "Os: ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} "
102+ "Architecture: ${CMAKE_SYSTEM_PROCESSOR} ${MEMORY_SIZE} bit"
103+ "CXX compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} "
104+ "CXX standard: ${CMAKE_CXX_STANDARD} "
105+ "Generator: ${CMAKE_GENERATOR} "
106+ "=================================================="
107+ "Build unit tests: ${_7BIT_DI_BUILD_UNIT_TESTS} "
108+ "Build integration tests: ${_7BIT_DI_BUILD_INTEGRATION_TESTS} "
109+ "Build e2e tests: ${_7BIT_DI_BUILD_E2E_TESTS} "
110+ "Build examples: ${_7BIT_DI_BUILD_EXAMPLES} "
111+ "Build benchmarks: ${_7BIT_DI_BUILD_BENCHMARKS} "
112+ "Build documentation: ${_7BIT_DI_BUILD_DOCS} "
113+ "Build single header: ${_7BIT_DI_BUILD_SINGLE_HEADER} "
114+ "Install project: ${_7BIT_DI_INSTALL} "
104115)
105116printInfo("${INFOS} " = 50 7 0)
0 commit comments