mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
Make Ninja generator happy with BUILD_BYPRODUCTS.
This commit is contained in:
parent
7228b9985f
commit
f344d7ec61
1 changed files with 13 additions and 4 deletions
|
@ -56,6 +56,7 @@ IF((NOT WITH_LIBARCHIVE STREQUAL "OFF") AND (NOT LibArchive_FOUND))
|
||||||
ELSE()
|
ELSE()
|
||||||
# Build a local version
|
# Build a local version
|
||||||
INCLUDE(ExternalProject)
|
INCLUDE(ExternalProject)
|
||||||
|
SET(LIBARCHIVE_DIR ${CMAKE_CURRENT_BINARY_DIR}/libarchive)
|
||||||
SET(libarchive_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libarchive)
|
SET(libarchive_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libarchive)
|
||||||
SET(libarchive_CMAKE_ARGS
|
SET(libarchive_CMAKE_ARGS
|
||||||
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
||||||
|
@ -71,27 +72,35 @@ IF((NOT WITH_LIBARCHIVE STREQUAL "OFF") AND (NOT LibArchive_FOUND))
|
||||||
)
|
)
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
SET(libarchive_CMAKE_ARGS ${libarchive_CMAKE_ARGS} -DWINDOWS_VERSION=WIN7 -DCMAKE_DEBUG_POSTFIX=d)
|
SET(libarchive_CMAKE_ARGS ${libarchive_CMAKE_ARGS} -DWINDOWS_VERSION=WIN7 -DCMAKE_DEBUG_POSTFIX=d)
|
||||||
|
SET(LIBARCHIVE_RELEASE_LIB ${LIBARCHIVE_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}archive_static${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||||
|
SET(LIBARCHIVE_DEBUG_LIB ${LIBARCHIVE_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}archive_staticd${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||||
|
SET(byproducts ${LIBARCHIVE_RELEASE_LIB} ${LIBARCHIVE_DEBUG_LIB})
|
||||||
|
ELSE()
|
||||||
|
SET(LIBARCHIVE_LIB ${LIBARCHIVE_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}archive${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||||
|
SET(byproducts ${LIBARCHIVE_LIB})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(CMAKE_VERSION VERSION_GREATER "3.1")
|
||||||
|
SET(byproducts BUILD_BYPRODUCTS ${byproducts})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(LIBARCHIVE_DIR ${CMAKE_CURRENT_BINARY_DIR}/libarchive)
|
|
||||||
ExternalProject_Add(libarchive
|
ExternalProject_Add(libarchive
|
||||||
PREFIX ${libarchive_PREFIX}
|
PREFIX ${libarchive_PREFIX}
|
||||||
DOWNLOAD_DIR ${LIBARCHIVE_DIR}
|
DOWNLOAD_DIR ${LIBARCHIVE_DIR}
|
||||||
URL http://www.libarchive.org/downloads/libarchive-3.2.2.tar.gz
|
URL http://www.libarchive.org/downloads/libarchive-3.2.2.tar.gz
|
||||||
INSTALL_DIR ${LIBARCHIVE_DIR}
|
INSTALL_DIR ${LIBARCHIVE_DIR}
|
||||||
CMAKE_ARGS ${libarchive_CMAKE_ARGS}
|
CMAKE_ARGS ${libarchive_CMAKE_ARGS}
|
||||||
|
${byproducts}
|
||||||
)
|
)
|
||||||
ADD_LIBRARY(archive_static STATIC IMPORTED)
|
ADD_LIBRARY(archive_static STATIC IMPORTED)
|
||||||
ADD_DEPENDENCIES(archive_static libarchive)
|
ADD_DEPENDENCIES(archive_static libarchive)
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
SET(LIBARCHIVE_RELEASE_LIB ${LIBARCHIVE_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}archive_static${CMAKE_STATIC_LIBRARY_SUFFIX})
|
|
||||||
SET(LIBARCHIVE_DEBUG_LIB ${LIBARCHIVE_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}archive_staticd${CMAKE_STATIC_LIBRARY_SUFFIX})
|
|
||||||
SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION_RELWITHDEBINFO ${LIBARCHIVE_RELEASE_LIB})
|
SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION_RELWITHDEBINFO ${LIBARCHIVE_RELEASE_LIB})
|
||||||
SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION_RELEASE ${LIBARCHIVE_RELEASE_LIB})
|
SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION_RELEASE ${LIBARCHIVE_RELEASE_LIB})
|
||||||
SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION_DEBUG ${LIBARCHIVE_DEBUG_LIB})
|
SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION_DEBUG ${LIBARCHIVE_DEBUG_LIB})
|
||||||
SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION_MINSIZEREL ${LIBARCHIVE_RELEASE_LIB})
|
SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION_MINSIZEREL ${LIBARCHIVE_RELEASE_LIB})
|
||||||
ELSE()
|
ELSE()
|
||||||
SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION ${LIBARCHIVE_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}archive${CMAKE_STATIC_LIBRARY_SUFFIX})
|
SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION ${LIBARCHIVE_LIB})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(LibArchive_FOUND ON )
|
SET(LibArchive_FOUND ON )
|
||||||
|
|
Loading…
Reference in a new issue