Commit 16e0b4b0 authored by DanmeiChen's avatar DanmeiChen

fix build ios

parent 3cb615ee
......@@ -31,10 +31,12 @@
include("${CMAKE_CURRENT_LIST_DIR}/BcMatroska2Targets.cmake")
set(BCMATROSKA2_TARGETNAME "bcmatroska2")
if(@ENABLE_SHARED@)
set(BCMATROSKA2_LIBRARIES bcmatroska2)
set(BCMATROSKA2_LIBRARIES "${BCMATROSKA2_TARGETNAME}")
else()
get_target_property(BCMATROSKA2_LIBRARIES bcmatroska2-static LOCATION)
get_target_property(BCMATROSKA2_LIBRARIES ${BCMATROSKA2_TARGETNAME} LOCATION)
endif()
set(BCMATROSKA2_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
......
......@@ -33,17 +33,17 @@ endif()
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
if(ENABLE_STATIC)
add_library(bcmatroska2-static STATIC $<TARGET_OBJECTS:corec-objects> $<TARGET_OBJECTS:ebml2-objects> ${MATROSKA2_SOURCE_FILES})
set_target_properties(bcmatroska2-static PROPERTIES OUTPUT_NAME bcmatroska2)
set_target_properties(bcmatroska2-static PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
add_library(bcmatroska2 STATIC $<TARGET_OBJECTS:corec-objects> $<TARGET_OBJECTS:ebml2-objects> ${MATROSKA2_SOURCE_FILES})
set_target_properties(bcmatroska2 PROPERTIES OUTPUT_NAME bcmatroska2)
set_target_properties(bcmatroska2 PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(bcmatroska2-static PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
set_target_properties(bcmatroska2 PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
target_include_directories(bcmatroska2-static PRIVATE ../libebml2 .)
target_include_directories(bcmatroska2 PRIVATE ../libebml2 .)
if(LIBS)
target_link_libraries(bcmatroska2-static ${LIBS})
target_link_libraries(bcmatroska2 ${LIBS})
endif()
install(TARGETS bcmatroska2-static EXPORT BcMatroska2Targets
install(TARGETS bcmatroska2 EXPORT BcMatroska2Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
......
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