Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Use modern CMake and use FetchContent for msgpack"
This reverts commit a17e3fd.
- Loading branch information
Showing
6 changed files
with
59 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
include(CheckLibraryExists) | ||
|
||
find_path(MSGPACK_INCLUDE_DIR | ||
NAMES msgpack.h | ||
) | ||
|
||
find_library(MSGPACK_LIBRARY | ||
NAMES msgpack msgpackc libmsgpack.a libmsgpackc.a | ||
) | ||
|
||
mark_as_advanced(MSGPACK_INCLUDE_DIR MSGPACK_LIBRARY) | ||
set(MSGPACK_LIBRARIES ${MSGPACK_LIBRARY}) | ||
set(MSGPACK_INCLUDE_DIRS ${MSGPACK_INCLUDE_DIR}) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Msgpack DEFAULT_MSG | ||
MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,34 @@ | ||
# This is a minimal CMake project to fetch and build third party | ||
# dependencies | ||
cmake_minimum_required(VERSION 3.16) | ||
cmake_minimum_required(VERSION 2.8.12) | ||
if (POLICY CMP0048) | ||
cmake_policy(SET CMP0048 NEW) | ||
endif (POLICY CMP0048) | ||
project(neovim-qt-deps) | ||
|
||
cmake_policy(SET CMP0048 NEW) | ||
if (POLICY CMP0135) | ||
cmake_policy(SET CMP0135 NEW) | ||
endif() | ||
# | ||
# Get Msgpack | ||
# | ||
set(MSGPACK_VERSION 3.2.0) | ||
set(MSGPACK_URL https://github.com/msgpack/msgpack-c/archive/cpp-${MSGPACK_VERSION}.tar.gz) | ||
set(MSGPACK_SHA256 ff865a36bad5c72b8e7ebc4b7cf5f27a820fce4faff9c571c1791e3728355a39) | ||
|
||
project(neovim-qt-deps) | ||
message(STATUS "Downloading Msgpack...") | ||
set(MSGPACK_TARBALL msgpack-${MSGPACK_VERSION}.tar.gz) | ||
file(DOWNLOAD ${MSGPACK_URL} ${CMAKE_CURRENT_SOURCE_DIR}/${MSGPACK_TARBALL} | ||
INACTIVITY_TIMEOUT 30 | ||
EXPECTED_HASH SHA256=${MSGPACK_SHA256}) | ||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xfz ${MSGPACK_TARBALL} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
RESULT_VARIABLE rv) | ||
if(NOT rv EQUAL 0) | ||
message(FATAL_ERROR "Failed to extract ${MSGPACK_TARBALL}") | ||
endif() | ||
|
||
include(FetchContent) | ||
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}) | ||
set(MSGPACK_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/msgpack-c-cpp-${MSGPACK_VERSION}/) | ||
add_subdirectory(${MSGPACK_SOURCE_DIR} EXCLUDE_FROM_ALL) | ||
|
||
set(MSGPACK_VERSION 3.2.0) | ||
FetchContent_Declare( | ||
msgpackc | ||
URL "https://github.com/msgpack/msgpack-c/archive/cpp-${MSGPACK_VERSION}.tar.gz" | ||
URL_HASH SHA256=ff865a36bad5c72b8e7ebc4b7cf5f27a820fce4faff9c571c1791e3728355a39 | ||
) | ||
FetchContent_MakeAvailable(msgpackc) | ||
# Similar enough to FindMsgpack | ||
set(MSGPACK_INCLUDE_DIRS ${MSGPACK_SOURCE_DIR}/include PARENT_SCOPE) | ||
set(MSGPACK_LIBRARIES msgpackc-static PARENT_SCOPE) |