# Copyright (c) 2013-2020 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 Bartlomiej Grzelewski (b.grzelewski@samsung.com) # @brief # INCLUDE(FindPkgConfig) # mdpp flag IF (DEFINED SECURITY_MDFPP_STATE_ENABLED) MESSAGE("SECURITY_MDFPP_STATE_ENABLE ENABLED !") ADD_DEFINITIONS("-DSECURITY_MDFPP_STATE_ENABLE") ELSE (DEFINED SECURITY_MDFPP_STATE_ENABLED) MESSAGE("SECURITY_MDFPP_STATE_ENABLE DISABLED !") ENDIF (DEFINED SECURITY_MDFPP_STATE_ENABLED) ADD_DEFINITIONS("-DCKM_TEST_DIR=\"${CKM_TEST_DIR}\"") ADD_DEFINITIONS("-DCKM_RW_DATA_DIR=\"${CKM_RW_DATA_DIR}\"") PKG_CHECK_MODULES(CKM_TEST_COMMON_DEP REQUIRED openssl1.1 key-manager>=0.1.49 libtzplatform-config ) SET(CKM_TEST_COMMON_SRCS ckm-common.cpp test-certs.cpp ) INCLUDE_DIRECTORIES(SYSTEM ${CKM_TEST_COMMON_DEP_INCLUDE_DIRS}) INCLUDE_DIRECTORIES( . ${PROJECT_SOURCE_DIR}/src/common ) ADD_LIBRARY(${TARGET_CKM_TEST_COMMON} ${CKM_TEST_COMMON_SRCS}) TARGET_LINK_LIBRARIES(${TARGET_CKM_TEST_COMMON} ${CKM_TEST_COMMON_DEP_LIBRARIES} ${COMMON_TARGET_TEST} ) # C compilation test SET(TARGET_C_COMPILATION_TEST "ckm-c-compilation-test") SET(C_COMPILATION_SOURCES c-compilation.c) PKG_CHECK_MODULES(CKM_C_COMPILATION_DEP REQUIRED key-manager) ADD_EXECUTABLE(${TARGET_C_COMPILATION_TEST} ${C_COMPILATION_SOURCES}) TARGET_LINK_LIBRARIES(${TARGET_C_COMPILATION_TEST} ${CKM_C_COMPILATION_DEP_LIBRARIES}) INSTALL(DIRECTORY resource/ DESTINATION ${CKM_TEST_DIR}) ADD_SUBDIRECTORY(privileged) ADD_SUBDIRECTORY(unprivileged)