1 #===============================================================================
2 # Copyright 2016-2018 Intel Corporation
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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 #===============================================================================
17 cmake_minimum_required(VERSION 2.8)
20 cmake_policy(SET CMP0022 NEW)
24 cmake_policy(SET CMP0054 NEW)
27 # Enable RPATH on MacOS/OSX
29 cmake_policy(SET CMP0042 NEW)
32 # Do not export symbols from executables
34 cmake_policy(SET CMP0065 NEW)
37 # Pass all flags to try_compile
39 cmake_policy(SET CMP0056 NEW)
42 cmake_policy(SET CMP0066 NEW)
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")
51 if (CMAKE_VERSION VERSION_LESS 3.0)
52 project(${PROJECT_NAME} C CXX)
54 cmake_policy(SET CMP0048 NEW)
55 project(${PROJECT_NAME} VERSION "${PROJECT_VERSION}" LANGUAGES C CXX)
58 if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
59 message("FATAL_ERROR" "Intel(R) MKL-DNN supports 64 bit platforms only")
62 if("${CMAKE_BUILD_TYPE}" STREQUAL "")
63 message(STATUS "CMAKE_BUILD_TYPE is unset, defaulting to Release")
64 set(CMAKE_BUILD_TYPE "Release")
67 set(CMAKE_SRC_CCXX_FLAGS) # SRC specifics
68 set(CMAKE_EXAMPLE_CCXX_FLAGS) # EXAMPLE specifics
69 set(CMAKE_TEST_CCXX_FLAGS) # TESTS specifics
71 include(GNUInstallDirs)
72 include(CMakePackageConfigHelpers)
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")
87 include_directories(include)
90 add_subdirectory(examples)
91 add_subdirectory(tests)
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})