1 diff --git a/CMakeLists.txt b/CMakeLists.txt
2 index 50442cd..fdc82f2 100644
5 @@ -28,24 +28,32 @@ LIST ( SORT ly_unittest_sources )
6 INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} )
8 # this creates the static library (.a)
9 +if (NOT BUILD_SHARED_LIBS)
10 ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} )
11 SET_TARGET_PROPERTIES( ${ly_lib_static} PROPERTIES PUBLIC_HEADER include/libyuv.h )
14 # this creates the shared library (.so)
15 ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} )
16 SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" )
17 SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" )
20 # this creates the conversion tool
21 ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc )
22 -TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} )
24 +if (BUILD_SHARED_LIBS)
25 + TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_shared} )
27 + TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} )
32 - include_directories( ${JPEG_INCLUDE_DIR} )
33 - target_link_libraries( ${ly_lib_shared} PUBLIC ${JPEG_LIBRARY} )
34 - target_link_libraries( yuvconvert ${JPEG_LIBRARY} )
35 + include_directories( ${JPEG_INCLUDE_DIR})
36 + if( BUILD_SHARED_LIBS)
37 + target_link_libraries(${ly_lib_shared} PUBLIC ${JPEG_LIBRARY})
39 + target_link_libraries(${ly_lib_static} PUBLIC ${JPEG_LIBRARY})
41 + target_link_libraries(yuvconvert ${JPEG_LIBRARY})
42 add_definitions( -DHAVE_JPEG )
45 @@ -88,11 +96,13 @@ endif()
48 # install the conversion tool, .so, .a, and all the header files
49 -INSTALL ( TARGETS yuvconvert DESTINATION bin )
50 +INSTALL ( TARGETS yuvconvert DESTINATION tools )
51 INSTALL ( FILES ${ly_include_files} DESTINATION include/libyuv )
52 -INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-targets DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include )
53 -INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-targets LIBRARY DESTINATION lib RUNTIME DESTINATION bin )
55 +if (NOT BUILD_SHARED_LIBS)
56 + INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-targets DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include )
58 + INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-targets LIBRARY DESTINATION lib RUNTIME DESTINATION bin )
60 INSTALL( EXPORT libyuv-targets DESTINATION share/cmake/libyuv/ EXPORT_LINK_INTERFACE_LIBRARIES )
62 # create the .deb and .rpm packages using cpack