Commit cf913e4c authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Do not generate dummy libraries if they already exist.

parent 82f23244
......@@ -27,16 +27,18 @@ string(REPLACE " " ";" LINPHONE_BUILDER_DUMMY_LIBRARIES ${LINPHONE_BUILDER_DUMMY
foreach(LIB ${LINPHONE_BUILDER_DUMMY_LIBRARIES})
string(REPLACE "-" "_" UNDERSCORE_LIB ${LIB})
string(REGEX REPLACE "^lib" "" NOPREFIX_LIB ${LIB})
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/dummy.c.in" "${CMAKE_CURRENT_BINARY_DIR}/${LIB}.c" @ONLY)
add_library(${NOPREFIX_LIB} STATIC "${CMAKE_CURRENT_BINARY_DIR}/${LIB}.c")
set(_dest "lib")
if(${LIB} MATCHES "^libms")
set(_dest "lib/mediastreamer/plugins")
endif()
install(TARGETS ${NOPREFIX_LIB}
LIBRARY DESTINATION ${_dest}
ARCHIVE DESTINATION ${_dest}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/${_dest}/${NOPREFIX_LIB}")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/dummy.c.in" "${CMAKE_CURRENT_BINARY_DIR}/${LIB}.c" @ONLY)
add_library(${NOPREFIX_LIB} STATIC "${CMAKE_CURRENT_BINARY_DIR}/${LIB}.c")
install(TARGETS ${NOPREFIX_LIB}
LIBRARY DESTINATION ${_dest}
ARCHIVE DESTINATION ${_dest}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
endif()
unset(_dest)
endforeach()
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