From 26ced637fb7bba2ae706977b98812cf6da88fd5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jani=20V=C3=A4limaa?= Date: Mon, 1 Jan 2024 12:32:50 +0200 Subject: [PATCH] Fix build --- CMakeLists.txt | 1 + linphone-app/CMakeLists.txt | 31 ++++++++++--------- .../linphone_package/CMakeLists.txt | 16 +++++----- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d41da3c..7a52815 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,6 +237,7 @@ if(NOT APPLE OR MONO_ARCH) elseif(UNIX) set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/lib64:$ORIGIN/../lib64:$ORIGIN/lib:$ORIGIN/../lib") endif() + add_subdirectory("external/ispell") add_subdirectory("linphone-app") endfunction() add_linphone_app() diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt index d3e0e7b..648ab30 100644 --- a/linphone-app/CMakeLists.txt +++ b/linphone-app/CMakeLists.txt @@ -24,13 +24,14 @@ cmake_minimum_required(VERSION 3.22) #Linphone targets -set(LINPHONE_PACKAGES LinphoneCxx Mediastreamer2 Belcard LibLinphone) +set(LINPHONE_PACKAGES LinphoneCxx Mediastreamer2 BelCard LibLinphone) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -find_package(BCToolbox) +find_package(BCToolbox CONFIG REQUIRED) if(NOT BCToolbox_FOUND) - find_package(bctoolbox CONFIG REQUIRED) + message("BCToolbox not FOUND") + find_package(bctoolbox) endif() if(NOT LINPHONEAPP_VERSION) bc_compute_full_version(LINPHONEAPP_VERSION) @@ -105,17 +106,18 @@ set(ENABLE_DB_STORAGE ON CACHE BOOLEAN "Enable Storage") foreach(PACKAGE ${LINPHONE_PACKAGES}) message(STATUS "Trying to find ${PACKAGE}") - find_package(${PACKAGE}) + find_package(${PACKAGE} CONFIG REQUIRED) if(NOT ${PACKAGE}_FOUND) - find_package(${PACKAGE} CONFIG REQUIRED) + message("${PACKAGE] not FOUND") + find_package(${PACKAGE}) endif() endforeach() -set(PLUGIN_TARGETS ${LinphoneCxx_TARGET}) -set(APP_TARGETS ${LinphoneCxx_TARGET} +set(PLUGIN_TARGETS liblinphone++) +set(APP_TARGETS liblinphone++ ${BCToolbox_TARGET}#Logger/App ${Mediastreamer2_TARGET}#MediastreamerUtils - ${Belcard_TARGET}#VCard Model + ${BelCard_TARGET}#VCard Model ${LibLinphone_TARGET})#MediastreamerUtils #################################### @@ -728,6 +730,7 @@ include_directories("${LINPHONE_OUTPUT_DIR}/include/OpenGL") include_directories("${LINPHONE_OUTPUT_DIR}/include/") include_directories("${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/") include_directories("${QTKEYCHAIN_OUTPUT_DIR}/include/") +include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include/") if(NOT APPLE AND NOT WIN32) include_directories("${ISpell_BINARY_DIR}/include") endif () @@ -837,20 +840,20 @@ add_dependencies(${APP_LIBRARY} update_translations ${APP_PLUGIN}) set(TOOLS_DIR "${CMAKE_BINARY_DIR}/programs") set(LINPHONE_BUILDER_SIGNING_IDENTITY ${LINPHONE_BUILDER_SIGNING_IDENTITY}) -add_custom_command(TARGET ${APP_PLUGIN} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/") -add_custom_command(TARGET ${APP_PLUGIN} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/include/" "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/") -add_custom_command(TARGET ${APP_PLUGIN} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/") -add_custom_command(TARGET ${APP_PLUGIN} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/") +#add_custom_command(TARGET ${APP_PLUGIN} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/") +#add_custom_command(TARGET ${APP_PLUGIN} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/include/" "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/") +#add_custom_command(TARGET ${APP_PLUGIN} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/") +#add_custom_command(TARGET ${APP_PLUGIN} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/") #add_custom_command(TARGET ${TARGET_NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/include/LinphoneApp/*" "${CMAKE_INSTALL_PREFIX}/include/LinphoneApp/") #configure_file("${CMAKE_CURRENT_SOURCE_DIR}/include/*" "${CMAKE_INSTALL_PREFIX}/include/LinphoneApp/" COPYONLY) -install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") +install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include" DESTINATION "${CMAKE_INSTALL_PREFIX}") add_subdirectory(build) add_subdirectory(cmake_builder/linphone_package) -deployqt_hack(${TARGET_NAME} ${LINPHONE_QML_DIR}) +#deployqt_hack(${TARGET_NAME} ${LINPHONE_QML_DIR}) # ------------------------------------------------------------------------------ diff --git a/linphone-app/cmake_builder/linphone_package/CMakeLists.txt b/linphone-app/cmake_builder/linphone_package/CMakeLists.txt index b4d6590..f441fd4 100644 --- a/linphone-app/cmake_builder/linphone_package/CMakeLists.txt +++ b/linphone-app/cmake_builder/linphone_package/CMakeLists.txt @@ -274,7 +274,7 @@ else()# Not Windows and Apple endif() endforeach(item) endif() - install(FILES ${SHARED_LIBRARIES} DESTINATION "lib") + install(FILES ${SHARED_LIBRARIES} DESTINATION "${LIBDIR}/linphone") endif() if( EXISTS "${LINPHONE_OUTPUT_DIR}/lib64/") file(GLOB SHARED_LIBRARIES "${LINPHONE_OUTPUT_DIR}/lib64/*.so*") @@ -286,7 +286,7 @@ else()# Not Windows and Apple endif() endforeach(item) endif() - install(FILES ${SHARED_LIBRARIES} DESTINATION "lib64") + install(FILES ${SHARED_LIBRARIES} DESTINATION "${LIBDIR}/linphone") endif() install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}" USE_SOURCE_PERMISSIONS PATTERN "linphone" EXCLUDE @@ -324,9 +324,9 @@ else()# Not Windows and Apple install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../assets/icons/hicolor/${DIR}/apps/icon.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${DIR}/apps/" RENAME "${EXECUTABLE_NAME}.png") endforeach () install(TARGETS ${APP_PLUGIN} - ARCHIVE DESTINATION "${LIBDIR}" - LIBRARY DESTINATION "${LIBDIR}" - RUNTIME DESTINATION "${LIBDIR}" + ARCHIVE DESTINATION "${LIBDIR}/linphone" + LIBRARY DESTINATION "${LIBDIR}/linphone" + RUNTIME DESTINATION "${LIBDIR}/linphone" ) # WEBVIEW if(ENABLE_APP_WEBVIEW) @@ -370,13 +370,13 @@ if (MSVC) endif () -install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory \"${CMAKE_INSTALL_PREFIX}/include/\" \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/\")") +#install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory \"${CMAKE_INSTALL_PREFIX}/include/\" \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/\")") #install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory \"${CMAKE_INSTALL_PREFIX}/include/\")") # move share -install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory \"${CMAKE_INSTALL_PREFIX}/share/\" \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/\")") +#install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory \"${CMAKE_INSTALL_PREFIX}/share/\" \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/\")") #install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory \"${CMAKE_INSTALL_PREFIX}/share/\")") # move mkspecs -install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory \"${CMAKE_INSTALL_PREFIX}/mkspecs/\" \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/\")") +#install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory \"${CMAKE_INSTALL_PREFIX}/mkspecs/\" \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/\")") #install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory \"${CMAKE_INSTALL_PREFIX}/mkspecs/\")") # remove other folders #install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory \"${CMAKE_INSTALL_PREFIX}/cmake/\")") -- 2.43.0