-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathCMakeLists.txt
71 lines (62 loc) · 2.44 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
61
62
63
64
65
66
67
68
69
70
71
#*******************************************************************************
# libonvif/CMakeLists.txt
#
# Copyright (c) 2022 Stephen Rhodes
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
#******************************************************************************/
cmake_minimum_required(VERSION 3.17)
project(libonvif-pkg VERSION 1.4.7)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
if(WIN32)
add_compile_options("/EHsc")
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
set(BUILD_SHARED_LIBS TRUE)
else()
set(CMAKE_CXX_FLAGS "-D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wformat -Werror=format-security")
endif()
include(GNUInstallDirs)
set(CMAKE_INSTALL_INCLUDEDIR "include/${CMAKE_LIBRARY_ARCHITECTURE}")
add_subdirectory(libonvif)
add_subdirectory(onvif-util)
IF (NOT WITHOUT_PYTHON)
add_subdirectory(libavio)
endif()
if (WIN32)
install(TARGETS libonvif
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
COMPONENT library
)
IF (NOT WITHOUT_PYTHON)
install(TARGETS libavio
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
COMPONENT library
)
endif()
else()
install(TARGETS libonvif DESTINATION "${CMAKE_INSTALL_LIBDIR}/")
IF (NOT WITHOUT_PYTHON)
install(TARGETS libavio DESTINATION "${CMAKE_INSTALL_LIBDIR}/")
endif()
endif()
install(TARGETS onvif-util DESTINATION bin)
install(FILES libonvif/include/onvif.h libonvif/include/onvif_data.h libonvif/include/session.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(FILES onvif-util/docs/onvif-util.1 DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1")