Skip to content

Commit

Permalink
MX-1310 Added support for enterprise exports
Browse files Browse the repository at this point in the history
Builds a tarball of just the enterprise binary blobs and some CMake to incorporate them with a
normal build.
  • Loading branch information
leifwalsh committed Nov 20, 2014
1 parent a25777d commit 3703026
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 13 deletions.
45 changes: 39 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,40 @@ function (git_version name dir)
set(${name}_GIT_SHORTVER ${_git_shortver} CACHE STRING "git shortver for ${name}" FORCE)
endfunction ()

git_version(TOKUMX "${CMAKE_SOURCE_DIR}")
git_version(TOKUKV "${CMAKE_SOURCE_DIR}/src/third_party/ft-index")
if (TOKUMX_ENTERPRISE_USE_EXPORTS)
include(exports/tokumx_enterprise_exports.cmake)
include(exported_git_versions.cmake)
file(GLOB _installer_scripts "exports/tokumx_exports_install-*.cmake")
foreach (f ${_installer_scripts})
include(${f})
endforeach ()
unset(_installer_scripts)
else ()

if (TOKUMX_ENTERPRISE)
git_version(TOKUBACKUP "${CMAKE_SOURCE_DIR}/src/third_party/backup/")
git_version(TOKUMX_BACKUP_PLUGIN "${CMAKE_SOURCE_DIR}/src/mongo/plugins/tokumx-backup-plugin")
git_version(TOKUMX_PITR_PLUGIN "${CMAKE_SOURCE_DIR}/src/mongo/plugins/tokumx-pitr-plugin")
git_version(TOKUMX "${CMAKE_SOURCE_DIR}")
git_version(TOKUKV "${CMAKE_SOURCE_DIR}/src/third_party/ft-index")

if (TOKUMX_ENTERPRISE)
git_version(TOKUBACKUP "${CMAKE_SOURCE_DIR}/src/third_party/backup/")
git_version(TOKUMX_BACKUP_PLUGIN "${CMAKE_SOURCE_DIR}/src/mongo/plugins/tokumx-backup-plugin")
git_version(TOKUMX_PITR_PLUGIN "${CMAKE_SOURCE_DIR}/src/mongo/plugins/tokumx-pitr-plugin")
endif ()
endif ()

if (TOKUMX_ENTERPRISE_CREATE_EXPORTS)
configure_file(exported_git_versions.cmake.in exported_git_versions.cmake)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/exported_git_versions.cmake" DESTINATION . COMPONENT tokumx_enterprise_exports)

macro(exports_install _target _destination _component)
set(_exports_install_target ${_target})
set(_exports_install_destination ${_destination})
set(_exports_install_component ${_component})
configure_file("${CMAKE_SOURCE_DIR}/tokumx_exports_install.cmake.in" "${CMAKE_BINARY_DIR}/tokumx_exports_install-${_target}.cmake" @ONLY)
unset(_exports_install_target)
unset(_exports_install_destination)
unset(_exports_install_component)
install(FILES "${CMAKE_BINARY_DIR}/tokumx_exports_install-${_target}.cmake" DESTINATION exports COMPONENT tokumx_enterprise_exports)
endmacro(exports_install)
endif ()

add_subdirectory(src/third_party)
Expand Down Expand Up @@ -458,6 +485,12 @@ set(CPACK_COMPONENTS_ALL
tokumx_debuginfo
)

if (TOKUMX_ENTERPRISE_CREATE_EXPORTS)
install(EXPORT tokumx_enterprise_exports DESTINATION exports/ COMPONENT tokumx_enterprise_exports)
set(CPACK_COMPONENT_TOKUMX_ENTERPRISE_EXPORTS_GROUP enterprise-exports)
list(APPEND CPACK_COMPONENTS_ALL tokumx_enterprise_exports)
endif ()

if (TOKUMX_ENTERPRISE)
message(STATUS "Building TokuMX Enterprise ${CPACK_PACKAGE_VERSION}")
else ()
Expand Down
14 changes: 8 additions & 6 deletions src/mongo/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ target_link_libraries(plugins LINK_PUBLIC
dl
)

file(GLOB dentries RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" *)
foreach (dentry ${dentries})
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dentry}/")
add_subdirectory("${dentry}")
endif ()
endforeach ()
if (NOT TOKUMX_ENTERPRISE_USE_EXPORTS)
file(GLOB dentries RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" *)
foreach (dentry ${dentries})
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dentry}/")
add_subdirectory("${dentry}")
endif ()
endforeach ()
endif ()
4 changes: 3 additions & 1 deletion src/third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ else ()
endif ()

set(HOT_BACKUP_LIBNAME HotBackup CACHE STRING "TokuBackup library name")
add_subdirectory(backup)
if (NOT TOKUMX_ENTERPRISE_USE_EXPORTS)
add_subdirectory(backup)
endif ()
set(TokuBackup_FOUND TRUE CACHE BOOL "TokuBackup found" FORCE)
set(TokuBackup_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/backup" CACHE STRING "TokuBackup include dirs" FORCE)
set(TokuBackup_LIBRARIES ${HOT_BACKUP_LIBNAME} CACHE STRING "TokuBackup libraries" FORCE)
Expand Down

0 comments on commit 3703026

Please sign in to comment.