-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathCMakeLists.txt
29 lines (25 loc) · 935 Bytes
/
CMakeLists.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
cmake_minimum_required(VERSION 3.5)
enable_testing()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(ONNC_UMBRELLA_ROOT ${CMAKE_CURRENT_LIST_DIR})
# Set build type
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type [Release(default)/Debug/Regression]")
# for build.cmake.sh
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
option(ENABLE_UNITTEST "enable unittest" ON)
set(build_mode_for_command "dbg")
elseif(CMAKE_BUILD_TYPE STREQUAL "Regression")
option(ENABLE_UNITTEST "enable unittest" OFF)
set(build_mode_for_command "rgn")
else()
option(ENABLE_UNITTEST "enable unittest" OFF)
set(build_mode_for_command "normal")
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
# Build
# TODO: Integrate src CMake later
add_custom_target(onnc ALL
COMMAND MAX_MAKE_JOBS=$ENV{MAX_MAKE_JOBS} ./build.cmake.sh ${build_mode_for_command} ${CMAKE_INSTALL_PREFIX}
WORKING_DIRECTORY ${ONNC_UMBRELLA_ROOT}
)
# Test
add_subdirectory(test)