From e460b091f37964906568900dcf25e31f1151f192 Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Sat, 6 Feb 2016 12:31:20 -0800 Subject: [PATCH] PARQUET-448: Add cmake options to not build tests and/or executables This patch adds `PARQUET_BUILD_TESTS` and `PARQUET_BUILD_EXECUTABLES` options. For example: ``` $ cmake -DPARQUET_BUILD_TESTS=OFF -DPARQUET_BUILD_EXECUTABLES=OFF .. ``` This will accelerate builds in 3rd-party use. When the library is more mature we can set the default for `PARQUET_BUILD_TESTS` to `OFF` Author: Wes McKinney Closes #39 from wesm/PARQUET-448 and squashes the following commits: 6bf6a54 [Wes McKinney] Add cmake options to not build tests and/or executables Change-Id: Iff0745b88eed7265b8c4905e7db1e860d21b60ca --- cpp/src/parquet/util/CMakeLists.txt | 31 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/cpp/src/parquet/util/CMakeLists.txt b/cpp/src/parquet/util/CMakeLists.txt index 90a053f94fa38..046a7c9effbb6 100644 --- a/cpp/src/parquet/util/CMakeLists.txt +++ b/cpp/src/parquet/util/CMakeLists.txt @@ -35,21 +35,22 @@ add_library(parquet_util STATIC cpu-info.cc ) -add_library(parquet_test_main - test_main.cc) - -if (APPLE) - target_link_libraries(parquet_test_main - gtest - dl) - set_target_properties(parquet_test_main - PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") -else() - target_link_libraries(parquet_test_main - dl - gtest - pthread - ) +if(PARQUET_BUILD_TESTS) + add_library(parquet_test_main + test_main.cc) + if (APPLE) + target_link_libraries(parquet_test_main + gtest + dl) + set_target_properties(parquet_test_main + PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") + else() + target_link_libraries(parquet_test_main + dl + gtest + pthread + ) + endif() endif() ADD_PARQUET_TEST(bit-util-test)