Commit a1134df5 authored by Ghislain MARY's avatar Ghislain MARY

Link with the Foundation framework on Mac OS X and iOS.

parent 0629df2d
......@@ -50,6 +50,15 @@ include_directories(
corec
)
set(LINK_FLAGS )
if(APPLE)
list(APPEND LINK_FLAGS "-framework Foundation")
if(IOS)
list(APPEND LINK_FLAGS "-framework CoreFoundation")
endif()
endif()
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
add_compile_options(-w)
add_subdirectory(corec/corec)
......
......@@ -28,9 +28,13 @@ add_library(matroska2-objects OBJECT
set_target_properties(matroska2-objects PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
target_include_directories(matroska2-objects PRIVATE ../libebml2 .)
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>)
set_target_properties(matroska2-static PROPERTIES OUTPUT_NAME matroska2)
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(matroska2-static PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
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
......@@ -39,6 +43,9 @@ endif()
if(ENABLE_SHARED)
add_library(matroska2 SHARED $<TARGET_OBJECTS:corec-objects> $<TARGET_OBJECTS:ebml2-objects> $<TARGET_OBJECTS:matroska2-objects>)
set_target_properties(matroska2 PROPERTIES VERSION 0.0.0 SOVERSION 0)
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(matroska2 PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
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