Commit 9b14c29c authored by Ghislain MARY's avatar Ghislain MARY

Allow building msopenh264 statically.

parent e58cda7e
......@@ -36,6 +36,7 @@ set(VERSION "${PACKAGE_VERSION}")
option(ENABLE_DECODER "Enable the openh264 decoder" Yes)
option(ENABLE_STATIC "Build static library (default is shared library)." NO)
set(WITH_MS2 "${CMAKE_INSTALL_PREFIX}" CACHE STRING "Set prefix where the mediastreamer libraries can be found (ex:/usr or /usr/local)")
set(WITH_OPENH264 "${CMAKE_INSTALL_PREFIX}" CACHE STRING "Set prefix where libopenh264 can be found (ex:/usr or /usr/local)")
set(WITH_ORTP "${CMAKE_INSTALL_PREFIX}" CACHE STRING "Set prefix where the oRTP library can be found (ex:/usr or /usr/local)")
......
......@@ -36,16 +36,20 @@ if(ENABLE_DECODER)
add_definitions(-DOPENH264_DECODER_ENABLED)
endif()
add_library(msopenh264 SHARED ${SOURCE_FILES})
set_target_properties(msopenh264 PROPERTIES VERSION ${PACKAGE_VERSION} SOVERSION 0)
if(MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/libmsopenh264.pdb
DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
if(ENABLE_STATIC)
add_library(msopenh264 STATIC ${SOURCE_FILES})
else()
add_library(msopenh264 MODULE ${SOURCE_FILES})
set_target_properties(msopenh264 PROPERTIES VERSION ${PACKAGE_VERSION} SOVERSION 0)
if(MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/libmsopenh264.pdb
DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
endif()
set_target_properties(msopenh264 PROPERTIES PREFIX "lib")
endif()
set_target_properties(msopenh264 PROPERTIES PREFIX "lib")
endif()
set_target_properties(msopenh264 PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LINK_FLAGS}")
target_link_libraries(msopenh264 ${LIBS})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment