From 3ff166d832f4a240cf0e6daf0d9ce9ec94f9d84e Mon Sep 17 00:00:00 2001
From: Carsten Patzke <carsten.patzke@desy.de>
Date: Fri, 9 Mar 2018 14:55:03 +0100
Subject: [PATCH] Changed location of common's GLOBAL PROPERTY

---
 CMakeLists.txt                                        | 8 ++++++++
 CMakeModules/testing_cpp.cmake                        | 2 +-
 common/cpp/CMakeLists.txt                             | 9 ---------
 common/cpp/unittests/json_parser/test_json_parser.cpp | 1 -
 4 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a61464cb9..18b03a47e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,6 +8,14 @@ ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -Wall")
 ENDIF(WIN32)
 
+#TODO: Better way then GLOBAL PROPERTY
+IF(WIN32)
+    find_package(Threads REQUIRED)
+    SET_PROPERTY(GLOBAL PROPERTY HIDRA2_COMMON_IO_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} wsock32 ws2_32)
+ELSEIF(UNIX)
+    SET_PROPERTY(GLOBAL PROPERTY HIDRA2_COMMON_IO_LIBRARIES Threads::Threads)
+ENDIF(WIN32)
+
 option(BUILD_TESTS "Uses googletest to build tests" OFF)
 option(BUILD_INTEGRATION_TESTS "Include integration tests (CMAKE >3.7 is needed)" OFF)
 option(BUILD_DOCS "Uses doxygen to build the documentaion" OFF)
diff --git a/CMakeModules/testing_cpp.cmake b/CMakeModules/testing_cpp.cmake
index d5d6bbf68..f30d6cf85 100644
--- a/CMakeModules/testing_cpp.cmake
+++ b/CMakeModules/testing_cpp.cmake
@@ -49,7 +49,7 @@ function(gtest target test_source_files linktarget)
         target_link_libraries(test-${target} ${GTEST_LIBS} ${CMAKE_THREAD_LIBS_INIT})
 
         GET_PROPERTY(HIDRA2_COMMON_IO_LIBRARIES GLOBAL PROPERTY HIDRA2_COMMON_IO_LIBRARIES)
-        message(STATUS "SEARCHPATTERME HIDRA2_COMMON_IO_LIBRARIES: '${HIDRA2_COMMON_IO_LIBRARIES}'")
+        message(STATUS "HIDRA2_COMMON_IO_LIBRARIES: '${HIDRA2_COMMON_IO_LIBRARIES}'")
         target_link_libraries(test-${target} ${HIDRA2_COMMON_IO_LIBRARIES})
 
         if (NOT ${test_libraries} STREQUAL "")
diff --git a/common/cpp/CMakeLists.txt b/common/cpp/CMakeLists.txt
index abe71d604..8558a4592 100644
--- a/common/cpp/CMakeLists.txt
+++ b/common/cpp/CMakeLists.txt
@@ -11,12 +11,3 @@ endif()
 install(DIRECTORY ${HIDRA2_CXX_COMMON_INCLUDE_DIR}/common
         DESTINATION ${CMAKE_INSTALL_PREFIX}/include )
 
-################################
-# Library
-################################
-IF(WIN32)
-    find_package(Threads REQUIRED)
-    SET_PROPERTY(GLOBAL PROPERTY HIDRA2_COMMON_IO_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} wsock32 ws2_32)
-ELSEIF(UNIX)
-    SET_PROPERTY(GLOBAL PROPERTY HIDRA2_COMMON_IO_LIBRARIES Threads::Threads)
-ENDIF(WIN32)
diff --git a/common/cpp/unittests/json_parser/test_json_parser.cpp b/common/cpp/unittests/json_parser/test_json_parser.cpp
index f71389047..84d2a04ad 100644
--- a/common/cpp/unittests/json_parser/test_json_parser.cpp
+++ b/common/cpp/unittests/json_parser/test_json_parser.cpp
@@ -204,7 +204,6 @@ TEST_F(ParseFileTests, CannotReadFile) {
 
     uint64_t id;
     auto err = parser.GetUInt64("_id", &id);
-    //TODO: @Sergey why not just checking error code?
     ASSERT_THAT(err->Explain(), HasSubstr(hidra2::IOErrorTemplate::kFileNotFound.Copy()->Explain()));
 
 
-- 
GitLab