-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
38 lines (26 loc) · 1.06 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
cmake_minimum_required( VERSION 3.12 )
project( JpDrawApplication )
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
include_directories( "include" )
# https://stackoverflow.com/questions/31259861/multiple-cmake-prefix-paths/31261919
# this is some information on how to set multiple prefix paths
# Some of these paths are set to local machine config.
# You should adjust your paths here.
if(WIN32)
set(CMAKE_PREFIX_PATH "C:\\Qt\\5.15.2\\msvc2019_64\\")
set(OpenCV_DIR "C:\\opencv\\build")
set(GTEST_ROOT "C:\\Program Files\\googletest-distribution")
endif()
file( GLOB SOURCES "source/*.cpp" "include/*.hpp" )
find_package(Qt5 COMPONENTS Widgets REQUIRED)
# this is dependant on installation path.
# include("/usr/local/lib/cmake/opencv4/OpenCVConfig.cmake")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
find_package(GTest REQUIRED)
add_executable( RUN ${SOURCES} )
target_link_libraries( RUN PRIVATE Qt5::Widgets GTest::GTest GTest::Main ${OpenCV_LIBS})