hadoop-yetus commented on a change in pull request #485: HDFS-14244. Refactor 
the libhdfspp cmake build files.
URL: https://github.com/apache/hadoop/pull/485#discussion_r260474350
 
 

 ##########
 File path: 
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/CMakeLists.txt
 ##########
 @@ -16,10 +16,127 @@
 # limitations under the License.
 #
 
+cmake_minimum_required(VERSION 2.8.12)
+if (POLICY CMP0042)
+  cmake_policy(SET CMP0042 NEW) # suppress warning about mac rpath
+endif ()
+
+project(libhdfspp)
+
+enable_testing()
+include (CTest)
+
+find_package(ASIO REQUIRED)
+find_package(Doxygen)
+find_package(OpenSSL REQUIRED)
+find_package(Protobuf REQUIRED)
+find_package(RapidXML REQUIRED)
+find_package(Threads REQUIRED)
+find_package(URIparser REQUIRED)
+
+include(DecideSasl)
+include(CheckCXXSourceCompiles)
+
+include(HdfsppCompilerOptions)
+
+# Check if thread_local is supported
+unset (THREAD_LOCAL_SUPPORTED CACHE)
+set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+check_cxx_source_compiles(
+    "#include <thread>
+    int main(void) {
+      thread_local int s;
+      return 0;
+    }"
+    THREAD_LOCAL_SUPPORTED)
+if (NOT THREAD_LOCAL_SUPPORTED)
+  message(FATAL_ERROR "FATAL ERROR: The required feature thread_local storage 
is not supported by your compiler. Known compilers that support this feature: 
GCC 4.8+, Visual Studio 2015+, Clang (community version 3.3+), Clang (version 
for Xcode 8+ and iOS 9+).")
+endif (NOT THREAD_LOCAL_SUPPORTED)
+
+# Check if PROTOC library was compiled with the compatible compiler by trying
+# to compile some dummy code
+unset (PROTOC_IS_COMPATIBLE CACHE)
+set (CMAKE_REQUIRED_LIBRARIES protobuf protoc)
+check_cxx_source_compiles(
+    "#include <google/protobuf/io/printer.h>
+    #include <string>
+    int main(void) {
+      ::google::protobuf::io::ZeroCopyOutputStream *out = NULL;
+      ::google::protobuf::io::Printer printer(out, '$');
+      printer.PrintRaw(std::string(\"test\"));
+      return 0;
+    }"
+    PROTOC_IS_COMPATIBLE)
+if (NOT PROTOC_IS_COMPATIBLE)
+  message(WARNING "WARNING: the Protocol Buffers Library and the hdfs++ 
Library must both be compiled with the same (or compatible) compiler. Normally 
only the same major versions of the same compiler are compatible with each 
other.")
+endif (NOT PROTOC_IS_COMPATIBLE)
+
+if(DOXYGEN_FOUND)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in 
${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile @ONLY)
+add_custom_target(doc ${DOXYGEN_EXECUTABLE} 
${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile
+                  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+                  COMMENT "Generating API documentation with Doxygen" VERBATIM)
+endif(DOXYGEN_FOUND)
+
+include_directories(
+  ${CMAKE_CURRENT_SOURCE_DIR}/../include
+  ${CMAKE_CURRENT_SOURCE_DIR}
+  ${CMAKE_CURRENT_BINARY_DIR}/proto
+  )
+
+# Put the protobuf stuff first, since the version has to match between
+# the library, generated code, and the include files.
+include_directories(BEFORE ${PROTOBUF_INCLUDE_DIR})
+
+include_directories(SYSTEM
+  ${ASIO_INCLUDE_DIR}
+  ${RAPIDXML_INCLUDE_DIR}
+  ${OPENSSL_INCLUDE_DIR}
 
 Review comment:
   whitespace:end of line
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to