diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-08-07 17:35:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-07 17:35:10 -0400 |
commit | f1eb3031871b380162cf6407405367d707e7d9cc (patch) | |
tree | 9a32d109dcfd6dbeff18ed38a80dbd079909c2bf /cmake | |
parent | 6050d3f15dea67759afa4bcc68a3cd9feeaabe98 (diff) | |
parent | 6bcaea7c41e82a3435d903c6f99fd791cc343059 (diff) | |
download | rneovim-f1eb3031871b380162cf6407405367d707e7d9cc.tar.gz rneovim-f1eb3031871b380162cf6407405367d707e7d9cc.tar.bz2 rneovim-f1eb3031871b380162cf6407405367d707e7d9cc.zip |
Merge #5130 from equalsraf/tb-appveyor
Enable MSYS/MinGW builds in Appveyor
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/FindMsgpack.cmake | 7 | ||||
-rw-r--r-- | cmake/WindowsDllCopy.cmake | 30 |
2 files changed, 36 insertions, 1 deletions
diff --git a/cmake/FindMsgpack.cmake b/cmake/FindMsgpack.cmake index 015737d658..8881a34332 100644 --- a/cmake/FindMsgpack.cmake +++ b/cmake/FindMsgpack.cmake @@ -42,7 +42,12 @@ if(MSGPACK_USE_STATIC) "${CMAKE_STATIC_LIBRARY_PREFIX}msgpack${CMAKE_STATIC_LIBRARY_SUFFIX}") endif() -list(APPEND MSGPACK_NAMES msgpackc msgpack) +if(MSVC) + # The import library for the msgpack DLL has a different name + list(APPEND MSGPACK_NAMES msgpack_import) +else() + list(APPEND MSGPACK_NAMES msgpackc msgpack) +endif() find_library(MSGPACK_LIBRARY NAMES ${MSGPACK_NAMES} # Check each directory for all names to avoid using headers/libraries from diff --git a/cmake/WindowsDllCopy.cmake b/cmake/WindowsDllCopy.cmake new file mode 100644 index 0000000000..fbbabf3a0c --- /dev/null +++ b/cmake/WindowsDllCopy.cmake @@ -0,0 +1,30 @@ +# In Windows we need to find dependency DLLs and install them along with our +# binaries. This script uses the following variables: +# +# - BINARY: The binary file whose dependencies need to be installed +# - DST: The destination path +# - CMAKE_PREFIX_PATH: A list of directories to search for dependencies + +if(NOT DEFINED BINARY) + message(FATAL_ERROR "Missing required argument -DBINARY=") +endif() +if(NOT DEFINED DST) + message(FATAL_ERROR "Missing required arguments -DDST=") +endif() +if(NOT DEFINED CMAKE_PREFIX_PATH) + message(FATAL_ERROR "Missing required arguments -DCMAKE_PREFIX_PATH=") +endif() + +include(GetPrerequisites) +get_prerequisites(${BINARY} DLLS 1 1 "" "${CMAKE_PREFIX_PATH}") +foreach(DLL_NAME ${DLLS}) + find_program(DLL_PATH ${DLL_NAME}) + if(NOT DLL_PATH) + message(FATAL_ERROR "Unable to find dependency ${DLL_NAME}") + endif() + + message("Copying ${DLL_NAME} to ${DST}") + execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${DLL_PATH} ${DST}) + unset(DLL_PATH CACHE) +endforeach() + |