Commit de484795 authored by Yoni Fogel's avatar Yoni Fogel

refs #6566 Cleanup xz subproject in cmake.

xz now copies sources into the cmake build directory to prevent unnecessary churn (configure is run directly on sources)
parent 67ed76a8
...@@ -46,39 +46,39 @@ if (NOT CMAKE_BUILD_TYPE MATCHES Release) ...@@ -46,39 +46,39 @@ if (NOT CMAKE_BUILD_TYPE MATCHES Release)
list(APPEND xz_configure_opts --enable-debug) list(APPEND xz_configure_opts --enable-debug)
endif () endif ()
set(XZ_SOURCE_DIR "${TOKU_SVNROOT}/xz-4.999.9beta" CACHE FILEPATH "Where to find sources for xz (lzma).") set(XZ_SOURCE_DIR "${TokuDB_SOURCE_DIR}/third_party/xz-4.999.9beta" CACHE FILEPATH "Where to find sources for xz (lzma).")
if (NOT EXISTS "${XZ_SOURCE_DIR}/configure") if (NOT EXISTS "${XZ_SOURCE_DIR}/configure")
message(FATAL_ERROR "Can't find the xz sources. Please check them out to ${XZ_SOURCE_DIR} or modify TOKU_SVNROOT (${TOKU_SVNROOT}) or XZ_SOURCE_DIR.") message(FATAL_ERROR "Can't find the xz sources. Please check them out to ${XZ_SOURCE_DIR} or modify XZ_SOURCE_DIR.")
endif () endif ()
if (CMAKE_GENERATOR STREQUAL Ninja) if (CMAKE_GENERATOR STREQUAL Ninja)
## ninja doesn't understand "$(MAKE)" ## ninja doesn't understand "$(MAKE)"
ExternalProject_Add(build_lzma set(SUBMAKE_COMMAND make)
PREFIX xz
SOURCE_DIR "${XZ_SOURCE_DIR}"
CONFIGURE_COMMAND
"${XZ_SOURCE_DIR}/configure" ${xz_configure_opts}
"--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz"
BUILD_COMMAND
make -C src/liblzma
INSTALL_COMMAND
make -C src/liblzma install
)
else () else ()
## use "$(MAKE)" for submakes so they can use the jobserver, doesn't ## use "$(MAKE)" for submakes so they can use the jobserver, doesn't
## seem to break Xcode... ## seem to break Xcode...
ExternalProject_Add(build_lzma set(SUBMAKE_COMMAND $(MAKE))
endif ()
FILE(GLOB XZ_ALL_FILES ${XZ_SOURCE_DIR}/*)
ExternalProject_Add(build_lzma
PREFIX xz PREFIX xz
SOURCE_DIR "${XZ_SOURCE_DIR}" DOWNLOAD_COMMAND
cp -au "${XZ_ALL_FILES}" "<SOURCE_DIR>/"
CONFIGURE_COMMAND CONFIGURE_COMMAND
"${XZ_SOURCE_DIR}/configure" ${xz_configure_opts} "<SOURCE_DIR>/configure" ${xz_configure_opts}
"--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz" "--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz"
BUILD_COMMAND BUILD_COMMAND
$(MAKE) -C src/liblzma ${SUBMAKE_COMMAND} -C src/liblzma
INSTALL_COMMAND INSTALL_COMMAND
$(MAKE) -C src/liblzma install ${SUBMAKE_COMMAND} -C src/liblzma install
) )
endif () FILE(GLOB_RECURSE XZ_ALL_FILES_RECURSIVE ${XZ_SOURCE_DIR}/*)
ExternalProject_Add_Step(build_lzma reclone_src # Names of project and custom step
COMMENT "(re)cloning xz source..." # Text printed when step executes
DEPENDERS download configure # Steps that depend on this step
DEPENDS ${XZ_ALL_FILES_RECURSIVE} # Files on which this step depends
)
set_source_files_properties( set_source_files_properties(
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma.h" "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment