-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
### | ||
# Set minimum version of CMake. Since command 'project' use | ||
# VERSION sub-option we need at least 3.0. | ||
# Note: If you use 2.6 or 2.4, God kills a kitten. Seriously. | ||
cmake_minimum_required(VERSION 3.2 FATAL_ERROR) | ||
|
||
#### | ||
# Set variables: | ||
# * PROJECT_NAME | ||
# * PROJECT_VERSION | ||
project(dlpack VERSION 0.0.0 LANGUAGES C CXX) | ||
|
||
##### | ||
# Change the default build type from Debug to Release, while still | ||
# supporting overriding the build type. | ||
# | ||
# The CACHE STRING logic here and elsewhere is needed to force CMake | ||
# to pay attention to the value of these variables. | ||
if(NOT CMAKE_BUILD_TYPE) | ||
message(STATUS "No build type specified; defaulting to CMAKE_BUILD_TYPE=Release.") | ||
set(CMAKE_BUILD_TYPE Release CACHE STRING | ||
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." | ||
FORCE) | ||
else(NOT CMAKE_BUILD_TYPE) | ||
if(CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
message("==========================================================================================") | ||
message(STATUS "Build type: Debug. Performance will be terrible!") | ||
message(STATUS "Add -DCMAKE_BUILD_TYPE=Release to the CMake command line to get an optimized build.") | ||
message("==========================================================================================") | ||
endif(CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
endif(NOT CMAKE_BUILD_TYPE) | ||
|
||
#### | ||
# Setup the compiler options | ||
|
||
# set c++ standard to c++11. | ||
# Note: not working on CMake 2.8. We assume that user has | ||
# a compiler with C++11 support. | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
message(STATUS "C++11 support has been enabled by default.") | ||
|
||
option(BUILD_DOCS "Set to ON to build documentation" OFF) | ||
|
||
if(BUILD_DOCS) | ||
add_subdirectory(docs) | ||
endif(BUILD_DOCS) | ||
|
||
set(DLPACK_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include) | ||
|
||
include_directories(${DLPACK_INCLUDE_DIR}) | ||
add_executable(mock ${CMAKE_SOURCE_DIR}/src/mock.cc) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
find_package(Doxygen QUIET) | ||
if(NOT DOXYGEN_FOUND) | ||
message(FATAL_ERROR "Doxygen is needed to build the documentation.") | ||
endif() | ||
|
||
# TODO: add config file | ||
set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) | ||
set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) | ||
|
||
configure_file(${doxyfile_in} ${doxyfile} @ONLY) | ||
|
||
add_custom_target(docs | ||
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
COMMENT "Generating API documentation with Doxygen" | ||
VERBATIM) | ||
|
||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/${PROJECT_NAME}/docs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
PROJECT_NAME = @PROJECT_NAME@ | ||
PROJECT_NUMBER = @PROJECT_VERSION@ | ||
PROJECT_BRIEF = "RFC for common tensor and operator guideline in deep learning system" | ||
STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@ \ | ||
@PROJECT_BINARY_DIR@ | ||
OUTPUT_LANGUAGE = English | ||
FILE_PATTERNS = *.h *.md | ||
RECURSIVE = YES | ||
IMAGE_PATH = @CMAKE_SOURCE_DIR@/docs | ||
USE_MDFILE_AS_MAINPAGE = @CMAKE_SOURCE_DIR@/docs/readme.md | ||
JAVADOC_AUTOBRIEF = YES | ||
GENERATE_HTML = YES | ||
GENERATE_LATEX = NO | ||
OUTPUT_DIRECTORY = @CMAKE_BINARY_DIR@/docs/doxygen |