CMake: Improve webkit plugin name

This commit is contained in:
Maarten Bent 2021-06-06 23:18:54 +02:00
parent 979a4b5237
commit 6f34937993

View File

@ -43,14 +43,6 @@ endif()
wx_add_library(wxwebview ${WEBVIEW_FILES})
if(WXGTK AND wxUSE_WEBVIEW_WEBKIT2)
if(wxVERSION_IS_DEV)
set(WX_WEB_EXTENSIONS_DIRECTORY "lib/wx/${wxMAJOR_VERSION}.${wxMINOR_VERSION}.${wxRELEASE_NUMBER}/web-extensions")
else()
set(WX_WEB_EXTENSIONS_DIRECTORY "lib/wx/${wxMAJOR_VERSION}.${wxMINOR_VERSION}/web-extensions")
endif()
endif()
if(APPLE)
wx_lib_link_libraries(wxwebview PUBLIC "-framework WebKit")
elseif(WXMSW)
@ -120,16 +112,31 @@ if(WXGTK AND wxUSE_WEBVIEW_WEBKIT2)
wx_append_sources(WEBKIT2_EXT_FILES WEBVIEW_WEBKIT2_EXTENSION)
add_library(wxwebkit2_ext SHARED ${WEBKIT2_EXT_FILES})
wx_set_target_properties(wxwebkit2_ext false)
set_target_properties(wxwebkit2_ext PROPERTIES NO_SONAME 1)
# Change output name to match expected name in webview_webkit2.cpp: webkit2_ext*
set(lib_unicode)
if(wxUSE_UNICODE)
set(lib_unicode u)
set(lib_unicode "u")
endif()
set_target_properties(wxwebkit2_ext PROPERTIES PREFIX "")
set(lib_rls)
set(lib_dbg)
if(WIN32_MSVC_NAMING)
set(lib_dbg "d")
endif()
if(wxVERSION_IS_DEV)
set(WX_WEB_EXT_VERSION "${wxMAJOR_VERSION}.${wxMINOR_VERSION}.${wxRELEASE_NUMBER}")
else()
set(WX_WEB_EXT_VERSION "${wxMAJOR_VERSION}.${wxMINOR_VERSION}")
endif()
set_target_properties(wxwebkit2_ext PROPERTIES
OUTPUT_NAME "webkit2_ext${lib_unicode}-${wxMAJOR_VERSION}.${wxMINOR_VERSION}"
OUTPUT_NAME_DEBUG "webkit2_ext${lib_unicode}d-${wxMAJOR_VERSION}.${wxMINOR_VERSION}"
)
OUTPUT_NAME "webkit2_ext${lib_unicode}${lib_rls}-${WX_WEB_EXT_VERSION}"
OUTPUT_NAME_DEBUG "webkit2_ext${lib_unicode}${lib_dbg}-${WX_WEB_EXT_VERSION}"
PREFIX ""
)
target_include_directories(wxwebkit2_ext PUBLIC
${LIBSOUP_INCLUDE_DIRS}
@ -140,7 +147,7 @@ if(WXGTK AND wxUSE_WEBVIEW_WEBKIT2)
${WEBKIT2_LIBRARIES}
)
wx_install(TARGETS wxwebkit2_ext LIBRARY DESTINATION ${WX_WEB_EXTENSIONS_DIRECTORY})
wx_install(TARGETS wxwebkit2_ext LIBRARY DESTINATION "lib/wx/${WX_WEB_EXT_VERSION}/web-extensions")
add_dependencies(wxwebview wxwebkit2_ext)
endif()