-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
47 lines (41 loc) · 1.24 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
cmake_minimum_required (VERSION 3.10)
project(kmeansUE1 VERSION 1.0 LANGUAGES CXX)
# Require out-of-source builds
file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH)
if(EXISTS "${LOC_PATH}")
string(CONCAT errormsg
"You cannot build in a source directory (or any directory with "
"a CMakeLists.txt file). Please make a build subdirectory. Feel "
"free to remove CMakeCache.txt and CMakeFiles.")
message(FATAL_ERROR "${errormsg}")
endif()
# Require C++ 11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
# Fix behavior of CMAKE_CXX_STANDARD when targeting macOS.
if (POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif ()
# External config
# ---------------
# CTest
include(CTest)
# ---------------
# GoogleTest
# Prevent overriding the parent project's
# compiler/linker settings on Windows
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
# ---------------
# OpenCV
find_package(OpenCV REQUIRED)
# UNCOMMENT CONDITIONAL IF CMAKE < 4.0
if(OpenCV_FOUND)
message(STATUS "Indexing OpenCV headers")
include_directories(${OpenCV_INCLUDE_DIRS})
endif(OpenCV_FOUND)
# Internal sub-indexing
add_subdirectory(app)
add_subdirectory(src)
add_subdirectory(test)
# External sub-indexing
add_subdirectory(external/googletest)