Commit 18f81ac2 authored by Ghislain MARY's avatar Ghislain MARY

Link against winmm when building for Windows desktop.

parent a1134df5
......@@ -28,6 +28,11 @@ add_library(matroska2-objects OBJECT
set_target_properties(matroska2-objects PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
target_include_directories(matroska2-objects PRIVATE ../libebml2 .)
set(LIBS )
if(WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
list(APPEND LIBS Winmm)
endif()
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
if(ENABLE_STATIC)
add_library(matroska2-static STATIC $<TARGET_OBJECTS:corec-objects> $<TARGET_OBJECTS:ebml2-objects> $<TARGET_OBJECTS:matroska2-objects>)
......@@ -35,6 +40,9 @@ if(ENABLE_STATIC)
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(matroska2-static PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
if(LIBS)
target_link_libraries(matroska2-static ${LIBS})
endif()
install(TARGETS matroska2-static EXPORT Matroska2Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
......@@ -46,6 +54,9 @@ if(ENABLE_SHARED)
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(matroska2 PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
if(LIBS)
target_link_libraries(matroska2 ${LIBS})
endif()
if(MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/matroska2.pdb
......
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