diff --git a/CMakeLists.txt b/CMakeLists.txt index edcd06ee..a9f0e8e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.8) set(GPU ON) set(CUDNN ON) set(OPENCV ON) -set(DEBUG OFF) #add_definitions(-DOPENMP) cmake_policy(SET CMP0054 NEW) @@ -12,6 +11,18 @@ cmake_policy(SET CMP0046 NEW) project(darknet) +if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt) + if (NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE) + endif() +endif() + +string(ASCII 27 Esc) +set(ColourReset "${Esc}[m") +set(Green "${Esc}[32m") + +message("${Green}-- Project build-type: ${CMAKE_BUILD_TYPE}${ColourReset}") + set(CMAKE_CXX_STANDARD 11) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -183,10 +194,6 @@ if (OPENCV AND GPU) set(OpenCV_CUDA ON) endif() -if (DEBUG) - add_definitions(-DDEBUG) -endif() - set_runtime(STATIC) add_library(darknet_cpp STATIC ${CPP_SOURCES})