]> git.proxmox.com Git - ceph.git/blame - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/freeopcua/cmakelists_fixes.patch
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / ports / freeopcua / cmakelists_fixes.patch
CommitLineData
1e59de90
TL
1diff --git a/CMakeLists.txt b/CMakeLists.txt
2index de03564..df3fcf6 100644
3--- a/CMakeLists.txt
4+++ b/CMakeLists.txt
5@@ -1,11 +1,8 @@
6 cmake_minimum_required(VERSION 2.8)
7
8-#It seems Cmake does not set default bild type so we force it
9-if( NOT CMAKE_BUILD_TYPE )
10- set( CMAKE_BUILD_TYPE Debug CACHE STRING "Debug" FORCE )
11-endif()
12-
13 project(freeopcua)
14+set(CMAKE_CXX_STANDARD 11)
15+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
16
17 option(BUILD_CLIENT "Build Client" ON)
18 option(BUILD_SERVER "Build Server" ON)
19@@ -16,28 +13,6 @@ option(BUILD_PYTHON "Build Python bindings" ON)
20 option(BUILD_TESTING "Build and run tests" OFF)
21 OPTION(BUILD_SHARED_LIBS "Build shared libraries." ON)
22
23-IF (NOT DEFINED CMAKE_INSTALL_LIBDIR)
24- SET(CMAKE_INSTALL_LIBDIR lib)
25-ENDIF ()
26-
27-SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY
28- ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}
29- CACHE PATH
30- ""
31- )
32-
33-SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY
34- ${PROJECT_BINARY_DIR}/bin
35- CACHE PATH
36- ""
37- )
38-
39-SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY
40- ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}
41- CACHE PATH
42- ""
43- )
44-
45 # Helper function to generate a pkg-config file for a single library
46 # Takes the filename of the .pc file as a parameter and replaces all
47 # placeholders in the .pc.in file with the actual values
48@@ -60,23 +35,9 @@ function(generate_pkgconfig BASENAME)
49 endif()
50 endfunction(generate_pkgconfig)
51 if(MSVC)
52- SET(STATIC_LIBRARY_CXX_FLAGS /MDd CACHE STRING "")
53- SET(EXECUTABLE_CXX_FLAGS /MDd CACHE STRING "")
54- SET(DYNAMIC_LIBRARY_CXX_FLAGS /MDd CACHE STRING "")
55- SET(D /D)
56-
57- add_definitions(/D_SCL_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS /D_WIN32 /D_WINDOWS /FS /D_WIN32_WINNT=0x0600)
58- add_compile_options(/Zi /Od /EHsc /W4)
59-else(MSVC)
60- set(CMAKE_CXX_FLAGS_DEBUG " -Wall -ggdb -o0 ${CMAKE_CXX_FLAGS_DEBUG}")
61-
62- SET(STATIC_LIBRARY_CXX_FLAGS)
63- SET(EXECUTABLE_CXX_FLAGS)
64- SET(DYNAMIC_LIBRARY_CXX_FLAGS)
65- SET(D -D)
66- set(CMAKE_CXX_FLAGS " -std=c++11 -Wall -fPIC ${CMAKE_CXX_FLAGS} ")
67- SET (CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS})
68- #set(CMAKE_SHARED_LINKER_FLAGS "--no-undefined" )
69+ add_definitions(-D_SCL_SECURE_NO_WARNINGS)
70+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
71+ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
72 endif()
73
74 if(WIN32)
75@@ -105,7 +66,7 @@ else(WIN32)
76
77 endif(WIN32)
78
79-find_package( Boost COMPONENTS system program_options filesystem thread REQUIRED )
80+find_package( Boost COMPONENTS system program_options filesystem thread date_time REQUIRED )
81 include_directories( ${Boost_INCLUDE_DIRS} )
82 link_directories( ${Boost_LIBRARY_DIRS} )
83 message(STATUS "Boost INCLUDE DIR IS: " ${Boost_INCLUDE_DIRS})
84@@ -185,14 +146,12 @@ add_library(opcuaprotocol
85 src/protocol/subscriptions.cpp
86 )
87
88-if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
89- target_compile_options(opcuaprotocol PUBLIC ${STATIC_LIBRARY_CXX_FLAGS})
90-endif ()
91 target_link_libraries(opcuaprotocol ${ADDITIONAL_LINK_LIBRARIES})
92 target_include_directories(opcuaprotocol PUBLIC $<INSTALL_INTERFACE:include>)
93 install(TARGETS opcuaprotocol EXPORT FreeOpcUa
94+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
95 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
96- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static)
97+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
98
99 generate_pkgconfig("libopcuaprotocol.pc")
100
101@@ -227,10 +186,6 @@ if (BUILD_TESTING)
102 gtest_main
103 )
104
105- if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
106- target_compile_options(test_opcuaprotocol PUBLIC ${EXECUTABLE_CXX_FLAGS})
107- endif ()
108-
109 add_test(NAME opcuaprotocol COMMAND test_opcuaprotocol)
110 endif()
111
112@@ -266,15 +221,12 @@ SET(opcuacore_SOURCES
113
114 add_library(opcuacore ${opcuacore_SOURCES})
115
116-if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
117- target_compile_options(opcuacore PUBLIC ${STATIC_LIBRARY_CXX_FLAGS})
118-endif ()
119-
120-target_link_libraries(opcuacore ${ADDITIONAL_LINK_LIBRARIES} opcuaprotocol ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})
121+target_link_libraries(opcuacore ${ADDITIONAL_LINK_LIBRARIES} opcuaprotocol ${Boost_LIBRARIES})
122 target_include_directories(opcuacore PUBLIC $<INSTALL_INTERFACE:include>)
123 install(TARGETS opcuacore EXPORT FreeOpcUa
124+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
125 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
126- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static)
127+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
128
129 generate_pkgconfig("libopcuacore.pc")
130
131@@ -306,7 +258,7 @@ if (BUILD_TESTING)
132 )
133
134 if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
135- target_compile_options(test_opcuacore PUBLIC ${D}DYNAMIC_ADDON_PATH="${DYNAMIC_ADDON_PATH}" ${D}TEST_CORE_CONFIG_PATH="${TEST_CORE_CONFIG_PATH}" ${EXECUTABLE_CXX_FLAGS})
136+ target_compile_options(test_opcuacore PUBLIC -DDYNAMIC_ADDON_PATH="${DYNAMIC_ADDON_PATH}" -DTEST_CORE_CONFIG_PATH="${TEST_CORE_CONFIG_PATH}" )
137 endif ()
138
139 add_test(NAME opcuacore COMMAND test_opcuacore)
140@@ -327,9 +279,6 @@ if (BUILD_CLIENT)
141 src/client/client.cpp
142 )
143
144- if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
145- target_compile_options(opcuaclient PUBLIC ${STATIC_LIBRARY_CXX_FLAGS})
146- endif ()
147 target_link_libraries(opcuaclient
148 opcuacore
149 ${ADDITIONAL_LINK_LIBRARIES}
150@@ -338,8 +287,9 @@ if (BUILD_CLIENT)
151
152 target_include_directories(opcuaclient PUBLIC $<INSTALL_INTERFACE:include>)
153 install(TARGETS opcuaclient EXPORT FreeOpcUa
154+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
155 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
156- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static)
157+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
158
159 generate_pkgconfig("libopcuaclient.pc")
160
161@@ -371,9 +321,6 @@ if (BUILD_CLIENT)
162 opcuacore
163 )
164
165- if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
166- target_compile_options(opcuaclient PUBLIC ${EXECUTABLE_CXX_FLAGS})
167- endif ()
168 endif(BUILD_CLIENT)
169
170
171@@ -423,14 +370,12 @@ if(BUILD_SERVER)
172 src/server/subscription_service_internal.cpp
173 )
174
175- if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
176- target_compile_options(opcuaserver PUBLIC ${STATIC_LIBRARY_CXX_FLAGS})
177- endif ()
178- target_link_libraries(opcuaserver ${ADDITIONAL_LINK_LIBRARIES} opcuacore opcuaprotocol ${Boost_SYSTEM_LIBRARY})
179+ target_link_libraries(opcuaserver ${ADDITIONAL_LINK_LIBRARIES} opcuacore opcuaprotocol ${Boost_LIBRARIES})
180 target_include_directories(opcuaserver PUBLIC $<INSTALL_INTERFACE:include>)
181 install(TARGETS opcuaserver EXPORT FreeOpcUa
182+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
183 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
184- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static)
185+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
186
187 generate_pkgconfig("libopcuaserver.pc")
188
189@@ -481,7 +426,7 @@ if(BUILD_SERVER)
190
191 target_include_directories(test_opcuaserver PUBLIC .)
192 if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
193- target_compile_options(test_opcuaserver PUBLIC ${D}TEST_CORE_CONFIG_PATH="${TEST_CORE_CONFIG_PATH}" ${STATIC_LIBRARY_CXX_FLAGS})
194+ target_compile_options(test_opcuaserver PUBLIC -DTEST_CORE_CONFIG_PATH="${TEST_CORE_CONFIG_PATH}")
195 endif ()
196
197 add_test(NAME opcuaserverapp COMMAND test_opcuaserver)
198@@ -510,9 +455,6 @@ if(BUILD_SERVER)
199 opcuaserver
200 ${Boost_PROGRAM_OPTIONS_LIBRARY}
201 )
202- if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
203- target_compile_options(opcuaserverapp PUBLIC ${EXECUTABLE_CXX_FLAGS})
204- endif ()
205
206 endif(BUILD_SERVER)
207
208@@ -533,9 +475,6 @@ if (BUILD_CLIENT)
209 ${SSL_SUPPORT_LINK_LIBRARIES}
210 )
211
212- if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
213- target_compile_options(example_client PUBLIC ${EXECUTABLE_CXX_FLAGS})
214- endif ()
215
216 endif (BUILD_CLIENT)
217
218@@ -555,9 +494,6 @@ if(BUILD_SERVER)
219 opcuaserver
220 )
221
222- if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
223- target_compile_options(example_server PUBLIC ${EXECUTABLE_CXX_FLAGS})
224- endif ()
225 if(MSVC)
226 set_target_properties(example_server PROPERTIES LINK_FLAGS /STACK:3000000)
227 endif(MSVC)
228@@ -572,8 +508,8 @@ if (BUILD_PYTHON)
229 add_subdirectory(python)
230 endif (BUILD_PYTHON)
231
232-install(EXPORT FreeOpcUa DESTINATION lib/cmake/FreeOpcUa FILE FreeOpcUaConfig.cmake)
233+install(EXPORT FreeOpcUa DESTINATION share/freeopcua FILE freeopcuaConfig.cmake)
234
235 SET(CPACK_GENERATOR "DEB")
236-SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "FreeOpcUa")
237+SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "freeopcua")
238 INCLUDE(CPack)