# Copyright (c) 2014-2017 Samsung Electronics Co., Ltd All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # @file CMakeLists.txt # @author # @author # @brief Cmake for tests # LINK_DIRECTORIES(${CMAKE_BINARY_DIR}) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/lib) SET(TARGET_GTEST_TESTS "gtest-docker-adaptor") FILE(GLOB TARGET_GTEST_TESTS_SRCS *.cpp ${CMAKE_SOURCE_DIR}/src/adaptor_setting.c ${CMAKE_SOURCE_DIR}/src/input_file.c ${CMAKE_SOURCE_DIR}/src/parse_file.c ${CMAKE_SOURCE_DIR}/src/setup_system.c ${CMAKE_SOURCE_DIR}/src/adaptor_util.c) INCLUDE(FindPkgConfig) IF(NONE_GBS_BUILD) INCLUDE_DIRECTORIES(${LINK_LIB_INCLUDE}) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fprofile-arcs -ftest-coverage") set(CMAKE_EXE_LINKER_FLAGS ${LINK_FLAG}) ELSE(NONE_GBS_BUILD) pkg_check_modules(gtest_pkgs REQUIRED dlog json-c gmock) ENDIF(NONE_GBS_BUILD) INCLUDE_DIRECTORIES(${gtest_pkgs_INCLUDE_DIRS}) LINK_DIRECTORIES(${gtest_pkgs_LIBRARY_DIRS}) ADD_EXECUTABLE(${TARGET_GTEST_TESTS} ${TARGET_GTEST_TESTS_SRCS}) TARGET_LINK_LIBRARIES(${TARGET_GTEST_TESTS} ${gtest_pkgs_LIBRARIES} gmock json-c pthread gcov --coverage) INSTALL(TARGETS ${TARGET_GTEST_TESTS} DESTINATION ${BIN_INSTALL_DIR})