1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- diff --git a/CMakeLists.txt b/CMakeLists.txt
- index c8d6d900..b8134168 100644
- --- a/CMakeLists.txt
- +++ b/CMakeLists.txt
- @@ -75,7 +75,6 @@ if(MSVC)
- endif()
-
- # Need to set PIC to allow creating shared libraries from object file libraries.
- -set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-
- # Build the set of objects that do not need to be compiled with flags to enable
- # particular architecture features.
- @@ -174,19 +173,14 @@ if(LOONGARCH64)
- endif()
-
- # this creates the static library (.a)
- -add_library( ${ly_lib_static} STATIC ${ly_lib_parts})
- -
- -# this creates the shared library (.so)
- -add_library( ${ly_lib_shared} SHARED ${ly_lib_parts})
- -set_target_properties( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" )
- -set_target_properties( ${ly_lib_shared} PROPERTIES PREFIX "lib" )
- -if(WIN32)
- - set_target_properties( ${ly_lib_shared} PROPERTIES IMPORT_PREFIX "lib" )
- +ADD_LIBRARY( ${ly_lib_static} ${ly_lib_parts})
- +if (BUILD_SHARED_LIBS)
- + add_definitions("-DLIBYUV_BUILDING_SHARED_LIBRARY")
- endif()
-
- +option(BUILD_TOOLS "Build tools" OFF)
- +if (BUILD_TOOLS)
- # this creates the cpuid tool
- -add_executable ( cpuid ${ly_base_dir}/util/cpuid.c )
- -target_link_libraries ( cpuid ${ly_lib_static} )
-
- # this creates the conversion tool
- add_executable ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc )
- @@ -195,12 +189,21 @@ target_link_libraries ( yuvconvert ${ly_lib_static} )
- # this creates the yuvconstants tool
- add_executable ( yuvconstants ${ly_base_dir}/util/yuvconstants.c )
- target_link_libraries ( yuvconstants ${ly_lib_static} )
- -
- -find_package ( JPEG )
- -if (JPEG_FOUND)
- - include_directories( ${JPEG_INCLUDE_DIR} )
- - target_link_libraries( ${ly_lib_shared} ${JPEG_LIBRARY} )
- - add_definitions( -DHAVE_JPEG )
- +include(CheckFunctionExists)
- +check_function_exists(round HAVE_MATH_SYSTEM)
- +if(NOT HAVE_MATH_SYSTEM)
- + target_link_libraries(yuvconstants m)
- +endif()
- +INSTALL(TARGETS yuvconvert yuvconstants DESTINATION bin)
- +endif()
- +option(LIBYUV_WITH_JPEG "Build libyuv with jpeg" OFF)
- +if (LIBYUV_WITH_JPEG)
- + find_package(JPEG REQUIRED)
- + target_link_libraries(${ly_lib_static} JPEG::JPEG )
- + target_compile_definitions(${ly_lib_static} PRIVATE HAVE_JPEG)
- + if (BUILD_TOOLS)
- + target_compile_definitions(yuvconvert PRIVATE HAVE_JPEG)
- + endif()
- endif()
-
- if(UNIT_TEST)
- @@ -246,9 +249,7 @@ endif()
-
-
- # install the conversion tool, .so, .a, and all the header files
- -install ( TARGETS yuvconvert DESTINATION bin )
- -install ( TARGETS ${ly_lib_static} DESTINATION lib )
- -install ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib )
- +install ( TARGETS ${ly_lib_static} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib )
- install ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include )
-
- # create the .deb and .rpm packages using cpack
-
|