-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
60 lines (48 loc) · 1.62 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
48
49
50
51
52
53
54
55
56
57
58
59
60
###############################################################################
## Name: CMakeLists.txt
## Purpose: To build wxOpenCVCameras application
## Author: PB
## Created: 2021-11-18
## Copyright: (c) 2021 PB
## Licence: wxWindows licence
###############################################################################
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(wxOpenCVCameras)
find_package(wxWidgets 3.1.0 COMPONENTS core base REQUIRED)
find_package(OpenCV 4.2 REQUIRED)
set(SOURCES
cameragridframe.h
camerapanel.h
camerathread.h
convertmattowxbmp.h
onecameraframe.h
cameraapp.cpp
cameragridframe.cpp
camerapanel.cpp
camerathread.cpp
convertmattowxbmp.cpp
onecameraframe.cpp
)
if (WIN32)
list(APPEND SOURCES "${wxWidgets_ROOT_DIR}/include/wx/msw/wx.rc")
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property (DIRECTORY PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
add_executable(${PROJECT_NAME} ${SOURCES})
include(${wxWidgets_USE_FILE})
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
)
if (WIN32)
target_compile_definitions(${PROJECT_NAME} PRIVATE
wxUSE_RC_MANIFEST
wxUSE_DPI_AWARE_MANIFEST=2)
set_target_properties(${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE YES)
if (MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
endif(MSVC)
elseif(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE YES)
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE ${wxWidgets_LIBRARIES} ${OpenCV_LIBS})