Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/generic/omemoplugin/cmake/omemo_c.cmake b/generic/omemoplugin/cmake/omemo_c.cmake
- index 19654d1..0aa9f32 100644
- --- a/generic/omemoplugin/cmake/omemo_c.cmake
- +++ b/generic/omemoplugin/cmake/omemo_c.cmake
- @@ -1,13 +1,18 @@
- cmake_minimum_required(VERSION 3.10.0)
- set(OmemoCGitRepo "https://github.com/psi-im/libomemo-c.git")
- +set(ProtobufCGitRepo "https://github.com/protobuf-c/protobuf-c.git")
- message(STATUS "OMEMO_C: using bundled")
- set(OMEMO_C_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/omemo-c)
- +set(PROTOBUF_C_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/protobuf-c)
- set(OMEMO_C_BUILD_DIR ${OMEMO_C_PREFIX}/build)
- +set(Protobuf_C_BUILD_DIR ${PROTOBUF_C_PREFIX}/build)
- set(OMEMO_C_INCLUDE_DIR ${OMEMO_C_PREFIX}/src/OmemoCProject/src)
- -set(OMEMO_C_LIBRARY ${OMEMO_C_BUILD_DIR}/src/${CMAKE_STATIC_LIBRARY_PREFIX}omemo-c${D}${CMAKE_STATIC_LIBRARY_SUFFIX})
- -set(Protobuf_C_LIBRARY ${OMEMO_C_BUILD_DIR}/src/protobuf-c/build/${CMAKE_STATIC_LIBRARY_PREFIX}protobuf-c${CMAKE_STATIC_LIBRARY_SUFFIX})
- +set(OMEMO_C_LIBRARY ${OMEMO_C_BUILD_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}omemo-c${D}${CMAKE_STATIC_LIBRARY_SUFFIX})
- +set(Protobuf_C_LIBRARY ${Protobuf_C_BUILD_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}protobuf-c${CMAKE_STATIC_LIBRARY_SUFFIX})
- +set(Protobuf_C_INCLUDE_DIR ${PROTOBUF_C_PREFIX}/src/ProtobufCProject)
- +set(PROTOBUF_C_SOURCE_DIR ${PROTOBUF_C_PREFIX}/src/ProtobufCProject/build-cmake)
- if(APPLE)
- set(COREFOUNDATION_LIBRARY "-framework CoreFoundation")
- set(COREFOUNDATION_LIBRARY_SECURITY "-framework Security")
- @@ -17,7 +22,38 @@ endif()
- include(FindGit)
- find_package(Git REQUIRED)
- +if(WIN32)
- + set(HIDE_FLAGS
- + -DCMAKE_IGNORE_PATH="/usr/include/protobuf-c"
- + -DCMAKE_SYSTEM_IGNORE_PATH="/usr/include/protobuf-c"
- + )
- +endif()
- +
- +set(PROTOBUF_C_BUILD_OPTIONS
- + ${HIDE_FLAGS}
- + -DBUILD_SHARED_LIBS=OFF
- + -DCMAKE_POSITION_INDEPENDENT_CODE=ON
- + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
- + -DCMAKE_INSTALL_PREFIX=${OMEMO_C_BUILD_DIR}
- + -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
- + -DBUILD_PROTOC=OFF
- + -DGIT_EXECUTABLE=${GIT_EXECUTABLE}
- + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
- + -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
- + -DOSX_FRAMEWORK=OFF
- +)
- include(ExternalProject)
- +ExternalProject_Add(ProtobufCProject
- + PREFIX ${PROTOBUF_C_PREFIX}
- + BINARY_DIR ${Protobuf_C_BUILD_DIR}
- + GIT_REPOSITORY "${ProtobufCGitRepo}"
- + CONFIGURE_COMMAND ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} ${PROTOBUF_C_BUILD_OPTIONS} ${PROTOBUF_C_SOURCE_DIR}
- + #CMAKE_ARGS ${PROTOBUF_C_BUILD_OPTIONS}
- + BUILD_BYPRODUCTS ${Protobuf_C_LIBRARY}
- + INSTALL_COMMAND ""
- + UPDATE_COMMAND ""
- +)
- +
- #set CMake options and transfer the environment to an external project
- set(OMEMO_C_BUILD_OPTIONS
- -DBUILD_SHARED_LIBS=OFF
- @@ -25,8 +61,11 @@ set(OMEMO_C_BUILD_OPTIONS
- -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
- -DCMAKE_INSTALL_PREFIX=${OMEMO_C_PREFIX}/build
- -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
- - -DBUNDLED_PROTOBUF_C=ON
- - -DGIT_EXEXUTABLE=${GIT_EXECUTABLE}
- + -DBUILD_WITH_PROTOBUF=static
- + -DProtobuf_C_LIBRARY:CACHE=${Protobuf_C_LIBRARY}
- + -DProtobuf_C_INCLUDE_DIR:CACHE=${Protobuf_C_INCLUDE_DIR}
- + -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=${OMEMO_C_BUILD_DIR}
- + -DGIT_EXECUTABLE=${GIT_EXECUTABLE}
- -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
- -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
- -DOSX_FRAMEWORK=OFF
- @@ -38,8 +77,8 @@ ExternalProject_Add(OmemoCProject
- GIT_REPOSITORY "${OmemoCGitRepo}"
- GIT_TAG omemo
- CMAKE_ARGS ${OMEMO_C_BUILD_OPTIONS}
- - BUILD_BYPRODUCTS ${OMEMO_C_LIBRARY} ${Protobuf_C_LIBRARY}
- + BUILD_BYPRODUCTS ${OMEMO_C_LIBRARY}
- INSTALL_COMMAND ""
- UPDATE_COMMAND ""
- - DEPENDS ${DEPENDS}
- + DEPENDS ProtobufCProject
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement