# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+cmake_minimum_required(VERSION 2.8.0)
+
+set (PROJECT smartDeviceLinkCore)
+
#Jenkins integration section
#dont modify this section if you dont know details about integration with Jenkins!!!
set (HMI "web" CACHE STRING "HMI type")
option(HMI2 "Use Qt HMI" OFF)
-option(EXTENDED_MEDIA_MODE "Turn on and off extended Madia Manager features relates to PulseAudio A2DP and GSteamer" OFF)
+option(EXTENDED_MEDIA_MODE "Turn on and off extended Madia Manager features relates to PulseAudio A2DP and GStreamer" OFF)
option(BUILD_SHARED_LIBS "Build all libraries as shared (if ON) or static (if OFF)" OFF)
option(BUILD_BT_SUPPORT "Bluetooth support" ON)
option(BUILD_USB_SUPPORT "libusb support" ON)
option(BUILD_RWLOCK_SUPPORT "rwlocks support" OFF)
option(BUILD_BACKTRACE_SUPPORT "backtrace support" ON)
option(BUILD_TESTS "Possibility to build and run tests" OFF)
+option(TIME_TESTER "Enable profiling time test util" ON)
+option(BUILD_TESTS_WITH_HMI "Possibility to build and run HMI tests" OFF)
+option(ENABLE_LOG "Logging feature" ON)
+option(ENABLE_GCOV "gcov code coverage feature" OFF)
+option(EXTENDED_POLICY_FLAG "Build with specific features and extended functionality" OFF)
set(OS_TYPE_OPTION "$ENV{OS_TYPE}")
set(DEBUG_OPTION "$ENV{DEBUG}")
set(TARGET_OPTION "$ENV{TARGET}")
set(MEDIA_MODE_OPTION "$ENV{MEDIA_MODE}")
set(HMI_ADAPTER_OPTION "$ENV{HMI_ADAPTER}")
+set(ENABLE_LOG_OPTION "$ENV{ENABLE_LOG}")
if (OS_TYPE_OPTION)
if (${OS_TYPE_OPTION} STREQUAL "QNX")
message(STATUS "Jenkins integration: set build process for QNX")
+ #do not use include after project() command.
+ #Such usecase results in infinite cycle of reinitialization of compiler and other variables
INCLUDE("./qnx_6.5.0_linux_x86.cmake")
- #tests are not supported yet for QNX build
+ #tests are not supported yet for QNX build
set (BUILD_TESTS OFF)
endif()
endif()
if (DEBUG_OPTION)
if (${DEBUG_OPTION} STREQUAL "DBG_OFF")
message(STATUS "Jenkins integration: build release version")
- set (CMAKE_BUILD_TYPE Release)
+ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
endif()
endif()
endif()
-#Jenkins integration section end
-
+if (ENABLE_LOG_OPTION)
+ if (${ENABLE_LOG_OPTION} STREQUAL "LOG_OFF")
+ message(STATUS "Jenkins integration: Log is turned off")
+ set (ENABLE_LOG OFF)
+ endif()
+endif()
-cmake_minimum_required(VERSION 2.8.0)
+#Jenkins integration section end
-set (PROJECT smartDeviceLinkCore)
project (${PROJECT})
+#ADD_DEPENDENCIES(${PROJECT} Policy)
+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
# Please do not change compiler/linker flags if You do not know how particular
# flag is handled by CMake
set(CMAKE_INSTALL_PREFIX .)
set(ARCHIVE_OUTPUT_DIRECTORY ./bin)
-set(CMAKE_CXX_FLAGS "-g3 -ggdb3 -std=gnu++0x -Werror=return-type -Wuninitialized --coverage")
-set(CMAKE_CXX_FLAGS_RELEASE "-s -O2") #It will be appended to CMAKE_CXX_FLAGS in release
+set(CMAKE_CXX_FLAGS "-fPIC -g3 -ggdb3 -std=gnu++0x -Werror=return-type -Wuninitialized")
+if (ENABLE_GCOV)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
+ add_definitions(-DGCOV_ENABLED)
+endif()
+set(CMAKE_CXX_FLAGS_RELEASE "-fPIC -s -O2") #It will be appended to CMAKE_CXX_FLAGS in release
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_definitions(-DOS_LINUX)
add_definitions(-DBLUETOOTH_SUPPORT)
endif()
+if (BUILD_MME_SUPPORT)
+ add_definitions(-DMME_SUPPORT)
+ if (MME_MQ)
+ add_definitions(-DMME_MQ)
+ endif(MME_MQ)
+endif(BUILD_MME_SUPPORT)
+
if (BUILD_AVAHI_SUPPORT)
add_definitions(-DAVAHI_SUPPORT)
# --- Check libavahi-common, libavahi-client availability
add_definitions(-DBACKTRACE_SUPPORT)
endif()
+if(ENABLE_LOG)
+ add_definitions(-DENABLE_LOG)
+endif()
+
+if (TIME_TESTER)
+ add_definitions(-DTIME_TESTER)
+endif()
+
# TODO(AK): check current OS here
add_definitions(-DOS_POSIX)
+# FIXME(DC): weird logic
IF(CMAKE_C_FLAGS_DEBUG)
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG" )
add_definitions(-DDEBUG)
add_definitions(-DNO_HMI)
endif ()
-if (HMI STREQUAL "qt" AND NOT DEFINED HMIADAPTER)
+if (HMI STREQUAL "qt" AND NOT DEFINED HMIADAPTER)
set(HMIADAPTER "dbus")
endif()
-if (HMI STREQUAL "web" AND NOT DEFINED HMIADAPTER)
+if (HMI STREQUAL "web" AND NOT DEFINED HMIADAPTER)
set(HMIADAPTER "messagebroker")
endif()
-if (HMI STREQUAL "no" AND NOT DEFINED HMIADAPTER)
+if (HMI STREQUAL "no" AND NOT DEFINED HMIADAPTER)
set(HMIADAPTER "mqueue")
endif()
# Building tests
if(BUILD_TESTS)
+ if(BUILD_TESTS_WITH_HMI)
+ add_definitions(-DTESTS_WITH_HMI)
+ endif()
enable_testing()
include(Dart)
# Framework GoogleTest is also integrated together gmock
# and must not be added separately
- add_subdirectory(./src/thirdPartyLibs/gmock-1.6.0)
+ add_subdirectory(./src/thirdPartyLibs/gmock-1.7.0)
add_subdirectory(./test)
endif()
MESSAGE(STATUS "To enable processing of MscGen comments please install mscgen")
MESSAGE(STATUS "sudo apt-get install mscgen")
ENDIF(DOXYGEN_FOUND)
-
-