Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / mkl-dnn / CMakeLists.txt
1 #===============================================================================
2 # Copyright 2016-2018 Intel Corporation
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #===============================================================================
16
17 cmake_minimum_required(VERSION 2.8)
18
19 if(POLICY CMP0022)
20     cmake_policy(SET CMP0022 NEW)
21 endif()
22
23 if(POLICY CMP0054)
24     cmake_policy(SET CMP0054 NEW)
25 endif()
26
27 # Enable RPATH on MacOS/OSX
28 if(POLICY CMP0042)
29     cmake_policy(SET CMP0042 NEW)
30 endif()
31
32 # Do not export symbols from executables
33 if(POLICY CMP0065)
34     cmake_policy(SET CMP0065 NEW)
35 endif()
36
37 # Pass all flags to try_compile
38 if(POLICY CMP0056)
39     cmake_policy(SET CMP0056 NEW)
40 endif()
41 if(POLICY CMP0066)
42     cmake_policy(SET CMP0066 NEW)
43 endif()
44
45 set(PROJECT_NAME "Intel(R) MKL-DNN")
46 set(PROJECT_FULL_NAME "Intel(R) Math Kernel Library for Deep Neural Networks (Intel(R) MKL-DNN)")
47 set(PROJECT_VERSION "0.18.0")
48
49 set(LIB_NAME mkldnn)
50
51 if (CMAKE_VERSION VERSION_LESS 3.0)
52     project(${PROJECT_NAME} C CXX)
53 else()
54     cmake_policy(SET CMP0048 NEW)
55     project(${PROJECT_NAME} VERSION "${PROJECT_VERSION}" LANGUAGES C CXX)
56 endif()
57
58 if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
59     message("FATAL_ERROR" "Intel(R) MKL-DNN supports 64 bit platforms only")
60 endif()
61
62 if("${CMAKE_BUILD_TYPE}" STREQUAL "")
63     message(STATUS "CMAKE_BUILD_TYPE is unset, defaulting to Release")
64     set(CMAKE_BUILD_TYPE "Release")
65 endif()
66
67 set(CMAKE_SRC_CCXX_FLAGS)       # SRC specifics
68 set(CMAKE_EXAMPLE_CCXX_FLAGS)   # EXAMPLE specifics
69 set(CMAKE_TEST_CCXX_FLAGS)      # TESTS specifics
70
71 include(GNUInstallDirs)
72 include(CMakePackageConfigHelpers)
73
74 include("cmake/utils.cmake")
75 include("cmake/options.cmake")
76 include("cmake/OpenMP.cmake")
77 include("cmake/TBB.cmake")
78 include("cmake/platform.cmake")
79 include("cmake/SDL.cmake")
80 include("cmake/MKL.cmake")
81 include("cmake/Doxygen.cmake")
82 include("cmake/profiling.cmake")
83 include("cmake/version.cmake")
84
85 enable_testing()
86
87 include_directories(include)
88
89 add_subdirectory(src)
90 add_subdirectory(examples)
91 add_subdirectory(tests)
92
93 # Cannot use CMAKE_INSTALL_DOCDIR since it uses PROJECT_NAME and not LIB_NAME
94 install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/${LIB_NAME})