forked from JUSDJTIN/lib-tdt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeTargetFunctions.txt
77 lines (67 loc) · 2.86 KB
/
CMakeTargetFunctions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#********************************************************************************
# Copyright (C) 2019 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#********************************************************************************
#
# @file CMakeRelTargetFunctions.txt
#
# @brief Functions to be used in the release package
#
#
#********************************************************************************
CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION})
SET(CONFIGURATION_FILES_DIR ${TDT_LIBRARY_DIR}/configuration)
SET(REFERENCE_APP_DIR ${TDT_LIBRARY_DIR})
SET(SIGNVERIFY_LIB_DIR ${REFERENCE_APP_DIR}/windows/signverify_lib)
#Configure Deliverable Package
FUNCTION(configureDeliverablePackage)
ENDFUNCTION()
#Get the list of plugins in directory
FUNCTION(getAllPlugins)
FILE(GLOB PLUGIN_FILES_AND_DIRS LIST_DIRECTORIES TRUE ${PLUGIN_DIR}/*)
SET(PLUGIN_LIST_INTERNAL "")
FOREACH(child ${PLUGIN_FILES_AND_DIRS})
IF(IS_DIRECTORY ${child})
LIST(APPEND PLUGIN_LIST_INTERNAL ${child})
ENDIF(IS_DIRECTORY ${child})
ENDFOREACH(child ${PLUGIN_FILES_AND_DIRS})
SET(PLUGIN_LIST ${PLUGIN_LIST_INTERNAL} PARENT_SCOPE)
ENDFUNCTION()
#Add additional projects to the solution
FUNCTION(addAdditionalProjects)
IF (${PLATFORM} STREQUAL "linux")
SET(LIB_DEST_DIR ${BUILD_DIR}/${CMAKE_CFG_INTDIR}/lib)
ELSEIF (${PLATFORM} STREQUAL "windows")
INCLUDE_EXTERNAL_MSPROJECT(IntelTM ${DRIVER_WINDOWS_DIR}/IntelTM.vcxproj)
#Support for Windows Signature verification
INCLUDE(${SIGNVERIFY_LIB_DIR}/CMakeLists.txt)
SET(LIB_DEST_DIR ${BUILD_DIR}/${CMAKE_CFG_INTDIR}/)
# Version Info File Description field data
SET(TDT_STRFILE_DESCRIPTION "Intel (R) TDT Reference Plugin.")
ENDIF(${PLATFORM} STREQUAL "linux")
SET(LIB_EXT ${CMAKE_SHARED_LIBRARY_SUFFIX})
#Include source code plugins
getAllPlugins()
FOREACH (PLUGIN ${PLUGIN_LIST})
IF (EXISTS ${PLUGIN}/CMakeLists.txt)
INCLUDE(${PLUGIN}/CMakeLists.txt)
ENDIF (EXISTS ${PLUGIN}/CMakeLists.txt)
ENDFOREACH (PLUGIN ${SOURCE_CODE_FORMAT_PLUGINS})
ENDFUNCTION()
# Intentionally empty function. Do not update the version number in
# source package build
FUNCTION(configureVersion)
ENDFUNCTION()
#Post build event to copy precompiled binary files to binary directory
FUNCTION(copyPrecompiledPluginToBinaryPackage)
#Copy precompiled plugins to binary directory
getAllPlugins()
FOREACH (PLUGIN ${PLUGIN_LIST})
IF (EXISTS ${PLUGIN}/lib)
ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PLUGIN}/lib/. ${BUILD_DIR}/${CMAKE_CFG_INTDIR}/.
)
ENDIF (EXISTS ${PLUGIN}/lib)
ENDFOREACH (PLUGIN ${PLUGIN_LIST})
ENDFUNCTION()