diff --git a/CMakeLists.txt b/CMakeLists.txt index 788b3ef3d..59e0d145c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,6 @@ -cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR) +if (CMAKE_PROJECT_NAME STREQUAL TokuDB) + cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR) +endif() set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules") project(TokuDB) diff --git a/CTestCustom.cmake b/CTestCustom.cmake.in similarity index 100% rename from CTestCustom.cmake rename to CTestCustom.cmake.in diff --git a/buildheader/CMakeLists.txt b/buildheader/CMakeLists.txt index d9629f2cc..5da3c98ff 100644 --- a/buildheader/CMakeLists.txt +++ b/buildheader/CMakeLists.txt @@ -4,7 +4,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/runcat.sh" "#!/bin/bash out=$1; shift exec \"$@\" >$out") -add_executable(make_tdb make_tdb) +add_executable(make_tdb make_tdb.cc) set_property(TARGET make_tdb APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE) add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/db.h" @@ -26,4 +26,4 @@ if (NOT DEFINED MYSQL_PROJECT_NAME_DOCSTRING) DESTINATION include COMPONENT tokukv_headers ) -endif () \ No newline at end of file +endif () diff --git a/cmake_modules/FindValgrind.cmake b/cmake_modules/FindValgrind.cmake index 03335c5bb..73841723c 100644 --- a/cmake_modules/FindValgrind.cmake +++ b/cmake_modules/FindValgrind.cmake @@ -11,7 +11,7 @@ find_path(VALGRIND_INCLUDE_DIR valgrind/memcheck.h) find_program(VALGRIND_PROGRAM NAMES valgrind) -find_package_handle_standard_args(VALGRIND DEFAULT_MSG +find_package_handle_standard_args(Valgrind DEFAULT_MSG VALGRIND_INCLUDE_DIR VALGRIND_PROGRAM) diff --git a/cmake_modules/TokuMergeLibs.cmake b/cmake_modules/TokuMergeLibs.cmake index 9dc1c4935..e1da095fc 100644 --- a/cmake_modules/TokuMergeLibs.cmake +++ b/cmake_modules/TokuMergeLibs.cmake @@ -48,7 +48,8 @@ MACRO(TOKU_MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE) ENDIF() ENDFOREACH() IF(OSLIBS) - LIST(REMOVE_DUPLICATES OSLIBS) + # REMOVE_DUPLICATES destroys the order of the libs so disabled + # LIST(REMOVE_DUPLICATES OSLIBS) TARGET_LINK_LIBRARIES(${TARGET} LINK_PUBLIC ${OSLIBS}) ENDIF() diff --git a/cmake_modules/TokuSetupCTest.cmake b/cmake_modules/TokuSetupCTest.cmake index 1912dd33a..5b6882cc4 100644 --- a/cmake_modules/TokuSetupCTest.cmake +++ b/cmake_modules/TokuSetupCTest.cmake @@ -9,6 +9,7 @@ macro(real_executable_name filename_input out) execute_process( COMMAND which ${filename} RESULT_VARIABLE res + ERROR_QUIET OUTPUT_VARIABLE full_filename OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT(res)) @@ -59,7 +60,7 @@ macro(hostname out) COMMAND hostname OUTPUT_VARIABLE fullhostname OUTPUT_STRIP_TRAILING_WHITESPACE) - string(REGEX REPLACE "\\.tokutek\\.com$" "" ${out} ${fullhostname}) + string(REGEX REPLACE "\\.tokutek\\.com$" "" ${out} "${fullhostname}") endmacro(hostname) ## gather machine info @@ -150,5 +151,5 @@ if (BUILD_TESTING OR BUILD_FT_TESTS OR BUILD_SRC_TESTS) option(RUN_STRESS_TESTS "If set, run the stress tests." OFF) option(RUN_PERF_TESTS "If set, run the perf tests." OFF) - configure_file(CTestCustom.cmake . @ONLY) + configure_file(CTestCustom.cmake.in CTestCustom.cmake @ONLY) endif (BUILD_TESTING OR BUILD_FT_TESTS OR BUILD_SRC_TESTS) diff --git a/cmake_modules/TokuThirdParty.cmake b/cmake_modules/TokuThirdParty.cmake index 1e7e47f9b..db94b19f0 100644 --- a/cmake_modules/TokuThirdParty.cmake +++ b/cmake_modules/TokuThirdParty.cmake @@ -41,7 +41,7 @@ if (APPLE) list(APPEND xz_configure_opts --disable-assembler) endif () -list(APPEND xz_configure_opts CC=${CMAKE_C_COMPILER}) +list(APPEND xz_configure_opts "CC=${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}") if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL drd) list(APPEND xz_configure_opts --enable-debug) endif () @@ -68,6 +68,7 @@ ExternalProject_Add(build_lzma CONFIGURE_COMMAND "/configure" ${xz_configure_opts} "--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz" + "--libdir=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/lib" BUILD_COMMAND ${SUBMAKE_COMMAND} -C src/liblzma INSTALL_COMMAND diff --git a/ft/tests/CMakeLists.txt b/ft/tests/CMakeLists.txt index d9f0da6a1..0098b6091 100644 --- a/ft/tests/CMakeLists.txt +++ b/ft/tests/CMakeLists.txt @@ -29,7 +29,7 @@ if(BUILD_TESTING OR BUILD_FT_TESTS) add_test(ft/logcursor-bw echo "logcursor-bw must be run manually (needs logs to iterate over).") foreach(test ${tests}) - add_executable(${test} ${test}) + add_executable(${test} ${test}.cc) target_link_libraries(${test} ft ${LIBTOKUPORTABILITY}) set_target_properties(${test} PROPERTIES POSITION_INDEPENDENT_CODE ON) add_space_separated_property(TARGET ${test} COMPILE_FLAGS -fvisibility=hidden) diff --git a/locktree/tests/CMakeLists.txt b/locktree/tests/CMakeLists.txt index 47ec4d884..20ab682ae 100644 --- a/locktree/tests/CMakeLists.txt +++ b/locktree/tests/CMakeLists.txt @@ -7,7 +7,7 @@ if(BUILD_TESTING) foreach(src ${srcs}) get_filename_component(base ${src} NAME_WE) - add_executable(${base} ${base}) + add_executable(${base} ${base}.cc) add_space_separated_property(TARGET ${base} COMPILE_FLAGS -fvisibility=hidden) target_link_libraries(${base} locktree ft ${LIBTOKUPORTABILITY}) add_locktree_test(${base}) diff --git a/portability/tests/CMakeLists.txt b/portability/tests/CMakeLists.txt index 7fea21fc8..ff2333274 100644 --- a/portability/tests/CMakeLists.txt +++ b/portability/tests/CMakeLists.txt @@ -10,7 +10,7 @@ if(BUILD_TESTING) foreach(src ${srcs}) get_filename_component(test ${src} NAME_WE) - add_executable(${test} ${test}) + add_executable(${test} ${test}.cc) target_link_libraries(${test} ${LIBTOKUPORTABILITY}) set_target_properties(${test} PROPERTIES POSITION_INDEPENDENT_CODE ON) add_space_separated_property(TARGET ${test} COMPILE_FLAGS -fvisibility=hidden) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 4e85e3a41..47f6aa44a 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -49,7 +49,7 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS) ## #5138 only reproduces when using the static library. list(REMOVE_ITEM tdb_bins test-5138.tdb) - add_executable(test-5138.tdb test-5138) + add_executable(test-5138.tdb test-5138.cc) target_link_libraries(test-5138.tdb ${LIBTOKUDB}_static z ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS}) add_space_separated_property(TARGET test-5138.tdb COMPILE_FLAGS -fvisibility=hidden) add_ydb_test(test-5138.tdb) @@ -57,7 +57,7 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS) foreach(bin ${tdb_bins}) get_filename_component(base ${bin} NAME_WE) - add_executable(${base}.tdb ${base}) + add_executable(${base}.tdb ${base}.cc) # Some of the symbols in util may not be exported properly by # libtokudb.so. # We link the test with util directly so that the test code itself can use diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 6d17210ee..d3808483f 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -2,7 +2,7 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE DONT_DEPR set(tools tokudb_dump tokuftdump tokuft_logprint tdb-recover ftverify ba_replay) foreach(tool ${tools}) - add_executable(${tool} ${tool}) + add_executable(${tool} ${tool}.cc) add_dependencies(${tool} install_tdb_h) target_link_libraries(${tool} ${LIBTOKUDB}_static ft_static z lzma snappy ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS}) diff --git a/util/tests/CMakeLists.txt b/util/tests/CMakeLists.txt index f3768c419..8d53dd89a 100644 --- a/util/tests/CMakeLists.txt +++ b/util/tests/CMakeLists.txt @@ -6,7 +6,7 @@ if(BUILD_TESTING) endforeach(src) foreach(test ${tests}) - add_executable(${test} ${test}) + add_executable(${test} ${test}.cc) target_link_libraries(${test} util ${LIBTOKUPORTABILITY}) endforeach(test)