#the following variables are project-wide and can be used with cmake-gui
option(run_unittests"set run_unittests to ON to run unittests (default is OFF)"OFF)
option(run_e2e_tests"set run_e2e_tests to ON to run e2e tests (default is OFF). Chsare dutility does not have any e2e tests, but the option needs to exist to evaluate in IF statements"OFF)
option(run_int_tests"set run_int_tests to ON to integration tests (default is OFF)."OFF)
option(run_perf_tests"set run_perf_tests to ON to run perf tests (default is OFF)."OFF)
option(use_cppunittest"set use_cppunittest to ON to build CppUnitTest tests on Windows (default is OFF)"OFF)
option(run_traceability"run traceability tool (default is ON)"ON)
option(run_reals_check"set run_reals_check to ON to run reals check (default is OFF)."OFF)
MESSAGE(FATAL_ERROR"cannot find BUILD_BINARIESDIRECTORY env variable which is absolutely needed. It can point to any folder where the binaries will pe placed. Here's an example: \nWindows:\nset BUILD_BINARIESDIRECTORY=d:\\BUILD_BINARIESDIRECTORY\nWSL:\nexport BUILD_BINARIESDIRECTORY=/mnt/d/r/BUILD_BINARIESDIRECTORY/linux")
# enabling this option can help with debugging latency issues for the networking
option(enable_socket_logging"enable logging of each packet send/receive (default is OFF)"OFF)
if(${enable_socket_logging})
add_definitions(-DENABLE_SOCKET_LOGGING)
endif()
#canon way of limiting an option to a predefined set of values
set(GBALLOC_LL_TYPE_VALUESPASSTHROUGHWIN32HEAPMIMALLOCJEMALLOC)#the list of values which are allowed
set(GBALLOC_LL_TYPEPASSTHROUGHCACHESTRING"Value of GBALLOC_LL_TYPE")#setting the property's default value in case none is taken from the command line
set_property(CACHEGBALLOC_LL_TYPEPROPERTYSTRINGS${GBALLOC_LL_TYPE_VALUES})#build a property that can have only the allowed values
list(FINDGBALLOC_LL_TYPE_VALUES${GBALLOC_LL_TYPE}index)#check that the received value (either the default or the one from command line) matches one of the allowed values.
if(indexEQUAL-1)
message(FATAL_ERROR"GBALLOC_LL_TYPE must be one of '${GBALLOC_LL_TYPE_VALUES}'. It was actually '${GBALLOC_LL_TYPE}'")
endif()
#canon way of limiting an option to a predefined set of values
set(GBALLOC_HL_TYPE_VALUESPASSTHROUGHMETRICS)#the list of values which are allowed
set(GBALLOC_HL_TYPEPASSTHROUGHCACHESTRING"Value of GBALLOC_HL_TYPE")#build a property that can have only the allowed values
set_property(CACHEGBALLOC_HL_TYPEPROPERTYSTRINGS${GBALLOC_HL_TYPE_VALUES})#setting the property's default value in case none is taken from the command line
list(FINDGBALLOC_HL_TYPE_VALUES${GBALLOC_HL_TYPE}index)#check that the received value (either the default or the one from command line) matches one of the allowed values.
if(indexEQUAL-1)
message(FATAL_ERROR"GBALLOC_HL_TYPE must be one of '${GBALLOC_HL_TYPE_VALUES}'. It was actually '${GBALLOC_HL_TYPE}'")
endif()
#bring in dependencies
#do not add or build any tests of the dependencies
set(MI_BUILD_SHAREDOFFCACHEBOOL"Build shared library"FORCE)#not building a dll allows building on 32 bit, otherwise there's some errors on init.c about not finding a imported symbol