summaryrefslogtreecommitdiffstats
path: root/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/libyuv/fix_cmakelists.patch
blob: 00cc50599a32ce9664763c2f546f8562fa6d76a2 (plain)
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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed4948f..5b4e112 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,10 +2,14 @@
 # Originally created for "roxlu build system" to compile libyuv on windows
 # Run with -DTEST=ON to build unit tests
 
-PROJECT ( YUV C CXX )	# "C" is required even for C++ projects
 CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
+CMAKE_POLICY( SET CMP0022 NEW )
+
+PROJECT ( YUV C CXX )	# "C" is required even for C++ projects
 OPTION( TEST "Built unit tests" OFF )
 
+SET( CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON )
+
 SET ( ly_base_dir	${PROJECT_SOURCE_DIR} )
 SET ( ly_src_dir	${ly_base_dir}/source )
 SET ( ly_inc_dir	${ly_base_dir}/include )
@@ -14,6 +18,7 @@ SET ( ly_lib_name	yuv )
 SET ( ly_lib_static	${ly_lib_name} )
 SET ( ly_lib_shared	${ly_lib_name}_shared )
 
+FILE ( GLOB_RECURSE ly_include_files ${ly_inc_dir}/libyuv/*.h )
 FILE ( GLOB_RECURSE	ly_source_files ${ly_src_dir}/*.cc )
 LIST ( SORT			ly_source_files )
 
@@ -24,6 +29,7 @@ INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} )
 
 # this creates the static library (.a)
 ADD_LIBRARY				( ${ly_lib_static} STATIC ${ly_source_files} )
+SET_TARGET_PROPERTIES( ${ly_lib_static} PROPERTIES PUBLIC_HEADER include/libyuv.h )
 
 # this creates the shared library (.so)
 ADD_LIBRARY				( ${ly_lib_shared} SHARED ${ly_source_files} )
@@ -38,6 +44,7 @@ TARGET_LINK_LIBRARIES	( yuvconvert ${ly_lib_static} )
 INCLUDE ( FindJPEG )
 if (JPEG_FOUND)
   include_directories( ${JPEG_INCLUDE_DIR} )
+  target_link_libraries( ${ly_lib_shared} PUBLIC ${JPEG_LIBRARY} )
   target_link_libraries( yuvconvert ${JPEG_LIBRARY} )
   add_definitions( -DHAVE_JPEG )
 endif()
@@ -81,10 +88,12 @@ endif()
 
 
 # install the conversion tool, .so, .a, and all the header files
-INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert			DESTINATION bin )
-INSTALL ( TARGETS ${ly_lib_static}						DESTINATION lib )
-INSTALL ( TARGETS ${ly_lib_shared} LIBRARY				DESTINATION lib RUNTIME DESTINATION bin )
-INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/		DESTINATION include )
+INSTALL ( TARGETS yuvconvert DESTINATION bin )
+INSTALL ( FILES ${ly_include_files} DESTINATION include/libyuv )
+INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-targets DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include )
+INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-targets LIBRARY DESTINATION lib RUNTIME DESTINATION bin )
+
+INSTALL( EXPORT libyuv-targets DESTINATION share/cmake/libyuv/ EXPORT_LINK_INTERFACE_LIBRARIES )
 
 # create the .deb and .rpm packages using cpack
 INCLUDE ( CM_linux_packages.cmake )