reverbrain / eblob

Eblob is an append-only low-level IO library, which saves data in blob files. Created as low-level backend for elliptics
GNU Lesser General Public License v3.0
104 stars 29 forks source link

cmake warning #173

Closed minaevmike closed 7 years ago

minaevmike commented 8 years ago

Hi! I use cmake 3.5.1(ubuntu 16.04 LTS). When i try to run cmake i have such message

CMake Warning (dev) at tests/CMakeLists.txt:21 (add_custom_target):
  Policy CMP0037 is not set: Target names should not be reserved and should
  match a validity pattern.  Run "cmake --help-policy CMP0037" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  The target name "test" is reserved or not valid for certain CMake features,
  such as generator expressions, and may result in undefined behavior.
This warning is for project developers.  Use -Wno-dev to suppress it.

It's just FYI, i think that it's not critical.

bioothod commented 8 years ago

make test runs tests, and this word had begun to be reserved. Since we do not use generators, it is unlikely to anyhow affect eblob.

minaevmike commented 8 years ago

but if i undestand correctly this

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b98526e..a43b7bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_policy (VERSION 2.6.0)

 set(CMAKE_SKIP_RPATH FALSE)
 set(CMAKE_SKIP_BUILD_RPATH  FALSE)
-
+enable_testing()
 project (eblob)
 FILE (READ "${CMAKE_CURRENT_SOURCE_DIR}/debian/changelog" DEBCHANGELOG)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 709b9d3..93dbd6b 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -18,6 +18,6 @@ target_link_libraries(${TEST_NAME} eblob -lboost_unit_test_framework)
 set(TESTS_LIST eblob_stress eblob_cpp_test eblob_crypto_test)
 set(TESTS_DEPS ${TESTS_LIST})

-add_custom_target(test
+add_test(NAME test_eblob
   COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/run_tests.sh"
   DEPENDS ${TESTS_DEPS})

run same tests

bioothod commented 7 years ago

Looks good to me. If it works with 2.6 and 2.8 cmake, please submit a format pull requuest