mariadb/utils/CMakeLists.txt
Leif Walsh bd63072bdf closes #5485 #5368 clean up cmake and get darwin portability:
for 5485:
 - remove icc handling stuff from cmake
 - clean up remaining cmake files
 - create libtokudb_static.a in a cleaner way using cmake OBJECT libs (requires cmake 2.8.9)
 - use POSITION_INDEPENDENT_CODE property instead of manually setting -fPIC
for 5368:
 - fix compilation failures due to small differences between gcc and clang, mostly in tests
 - use toku_fileids_are_equal instead of memcmp to compare fileids (closes #5505)
 - create dummy implementation of partitioned_counter for osx (quick fix for, and closes #5506)
 - add mutex->valid bit under TOKU_PTHREAD_DEBUG
 - initialize mutex of DB_TXN created during recovery for 2PC (closes #5507)


git-svn-id: file:///svn/toku/tokudb@48024 c7de825b-a66e-492c-adef-691d508d4ae1
2013-04-17 00:01:07 -04:00

26 lines
1.3 KiB
CMake

set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE DONT_DEPRECATE_ERRNO)
set(utils tokudb_gen tokudb_load tokudb_dump)
foreach(util ${utils})
add_executable(${util} ${util})
set_target_properties(${util} PROPERTIES
COMPILE_DEFINITIONS "IS_TDB=1;USE_TDB=1;TDB_IS_STATIC=0")
target_link_libraries(${util} ${LIBTOKUDB} ${LIBTOKUPORTABILITY})
add_executable(${util}_static ${util})
set_target_properties(${util}_static PROPERTIES
COMPILE_DEFINITIONS "IS_TDB=1;USE_TDB=1;TDB_IS_STATIC=1")
target_link_libraries(${util}_static ${LIBTOKUDB}_static z lzma ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} dl)
add_common_options_to_binary_targets(${util} ${util}_static)
if(BDB_FOUND)
add_executable(${util}.bdb ${util})
set_property(TARGET ${util}.bdb APPEND PROPERTY
COMPILE_DEFINITIONS "IS_TDB=0;USE_BDB=1;TOKU_ALLOW_DEPRECATED")
set_target_properties(${util}.bdb PROPERTIES
INCLUDE_DIRECTORIES "${BDB_INCLUDE_DIR};${CMAKE_CURRENT_BINARY_DIR}/../toku_include;${CMAKE_CURRENT_SOURCE_DIR}/../toku_include;${CMAKE_CURRENT_SOURCE_DIR}/../portability;${CMAKE_CURRENT_SOURCE_DIR}/..")
target_link_libraries(${util}.bdb ${LIBTOKUPORTABILITY} ${BDB_LIBRARIES})
add_common_options_to_binary_targets(${util}.bdb)
endif()
endforeach(util)