~iliaplatone/spacedrone.eu/inova-sis-pack

« back to all changes in this revision

Viewing changes to usr/src/extension/CMakeLists.txt

  • Committer: Ilia Platone
  • Date: 2022-11-15 16:19:28 UTC
  • Revision ID: git-v1:b9f4c8dff67bb705341db6a18f84a3d5f61c23ce
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2018-2019 Intel Corporation
 
2
# SPDX-License-Identifier: Apache-2.0
 
3
#
 
4
 
 
5
set(TARGET_NAME "ie_cpu_extension")
 
6
 
 
7
if (NOT(IE_MAIN_SOURCE_DIR))
 
8
    list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
 
9
    include(feature_defs)
 
10
 
 
11
    # to use C++11 if samples are built outside of IE repo
 
12
    set (CMAKE_CXX_STANDARD 11)
 
13
    set (CMAKE_CXX_STANDARD_REQUIRED ON)
 
14
    if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
 
15
        set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
 
16
    endif()
 
17
endif()
 
18
 
 
19
# treating warnings as errors
 
20
if (WIN32)
 
21
    if (TREAT_WARNING_AS_ERROR)
 
22
        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
 
23
    endif ()
 
24
    if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
 
25
        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251 /wd4275 /wd4267") #disable some warnings
 
26
    endif()
 
27
else()
 
28
    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
 
29
endif()
 
30
 
 
31
if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
 
32
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
 
33
endif()
 
34
 
 
35
file(GLOB_RECURSE SRC *.cpp)
 
36
file(GLOB_RECURSE HDR *.hpp)
 
37
 
 
38
add_definitions(-DIMPLEMENT_INFERENCE_ENGINE_API)
 
39
 
 
40
include_directories (PRIVATE
 
41
        ${CMAKE_CURRENT_SOURCE_DIR}/common
 
42
        ${InferenceEngine_INCLUDE_DIRS}
 
43
)
 
44
 
 
45
add_library(${TARGET_NAME} SHARED ${SRC} ${HDR})
 
46
set_ie_threading_interface_for(${TARGET_NAME})
 
47
 
 
48
set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "cpu_extension")
 
49
 
 
50
target_link_libraries(${TARGET_NAME} PRIVATE ${InferenceEngine_LIBRARIES})
 
51
 
 
52
target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
 
53
set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME})
 
54
 
 
55
set_target_cpu_flags(${TARGET_NAME})
 
56
 
 
57
if (IE_MAIN_SOURCE_DIR)
 
58
    export(TARGETS ${TARGET_NAME} NAMESPACE IE:: APPEND FILE "${CMAKE_BINARY_DIR}/targets.cmake")
 
59
 
 
60
    # developer package
 
61
    export(TARGETS ${TARGET_NAME} NAMESPACE IE:: APPEND FILE "${CMAKE_BINARY_DIR}/targets_developer.cmake")
 
62
endif()
 
63