mariadb/CMakeLists.txt
Leif Walsh 63b1969fbb [t:4814] merging cmake work to mainline
git-svn-id: file:///svn/toku/tokudb@43179 c7de825b-a66e-492c-adef-691d508d4ae1
2013-04-17 00:00:25 -04:00

99 lines
2.4 KiB
CMake

cmake_minimum_required(VERSION 2.8.8)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
include(TokuSetupIntelCompiler)
project(TOKUDB)
include(TokuFeatureDetection)
include(TokuSetupCompiler)
include(TokuSetupCTest)
## lzma
include(ExternalProject)
set(xz_configure_opts --with-pic)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
list(APPEND xz_configure_opts --disable-assembler)
endif()
if(${CMAKE_BUILD_TYPE} MATCHES "Release")
if(CMAKE_C_COMPILER_ID MATCHES "Intel")
list(APPEND xz_configure_opts CC=icc "CFLAGS=-O2 -g -ip -ipo1" AR=xiar)
endif()
else()
list(APPEND xz_configure_opts --enable-debug)
endif()
ExternalProject_Add(build_lzma
PREFIX xz
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xz-4.999.9beta
CONFIGURE_COMMAND
${CMAKE_CURRENT_SOURCE_DIR}/xz-4.999.9beta/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
)
add_library(lzma STATIC IMPORTED)
set_target_properties(lzma PROPERTIES IMPORTED_LOCATION
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/lib/liblzma.a")
set(LIBTOKUPORTABILITY "tokuportability" CACHE STRING "Name of libtokuportability.so")
set(LIBTOKUDB "tokudb" CACHE STRING "Name of libtokudb.so")
## default includes and libraries
include_directories(SYSTEM
/usr/local/include
${ZLIB_INCLUDE_DIRS}
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/toku_include
${CMAKE_CURRENT_SOURCE_DIR}/portability
${CMAKE_CURRENT_SOURCE_DIR}
)
## include where config.h will be
include_directories(
${CMAKE_CURRENT_BINARY_DIR}/toku_include
)
link_libraries(dl pthread z)
## build db.h and include that directory
add_subdirectory(buildheader)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/buildheader)
## add subdirectories
add_subdirectory(portability)
add_subdirectory(newbrt)
add_subdirectory(src)
add_subdirectory(utils)
add_subdirectory(db-benchmark-test)
## subdirectories that just install things
add_subdirectory(include)
add_subdirectory(toku_include)
file(GLOB_RECURSE all_srcs
include/*.c
toku_include/*.c
buildheader/*.c
portability/*.c
newbrt/*.c
src/*.c
utils/*.c
db-benchmark-test/*.c
)
file(GLOB_RECURSE all_hdrs
include/*.h
toku_include/*.h
buildheader/*.h
portability/*.h
newbrt/*.h
src/*.h
utils/*.h
db-benchmark-test/*.h
)
include(TokuBuildTagDatabases)