Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | From b8e254a2f4ba49412e541598c72159869a7770f8 Mon Sep 17 00:00:00 2001 |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 2 | From: Cody P Schafer <dev@codyps.com> |
| 3 | Date: Mon, 16 May 2016 15:21:10 -0400 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 4 | Subject: [PATCH] THRIFT-3828 In cmake avoid use of both quoted paths and |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 5 | SYSTEM with include_directories() |
| 6 | |
| 7 | This allows us to avoid issues where there are no paths to be added to |
| 8 | the include path (include_directories() errors when given an empty |
| 9 | string). |
| 10 | |
| 11 | Specifically, gcc-6 requires that libraries stop passing paths like |
| 12 | '/usr/include' (or they will get libstdc++ build errors), so these paths |
| 13 | will be empty more often in the future. |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 14 | |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 15 | --- |
| 16 | lib/cpp/CMakeLists.txt | 8 ++++---- |
| 17 | lib/cpp/test/CMakeLists.txt | 2 +- |
| 18 | test/cpp/CMakeLists.txt | 6 +++--- |
| 19 | tutorial/cpp/CMakeLists.txt | 2 +- |
| 20 | 4 files changed, 9 insertions(+), 9 deletions(-) |
| 21 | |
| 22 | diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt |
| 23 | index 4c7caeb..a716ac3 100755 |
| 24 | --- a/lib/cpp/CMakeLists.txt |
| 25 | +++ b/lib/cpp/CMakeLists.txt |
| 26 | @@ -24,7 +24,7 @@ else() |
| 27 | find_package(Boost 1.53.0 REQUIRED) |
| 28 | endif() |
| 29 | |
| 30 | -include_directories(SYSTEM "${Boost_INCLUDE_DIRS}") |
| 31 | +include_directories(${Boost_INCLUDE_DIRS}) |
| 32 | include_directories(src) |
| 33 | |
| 34 | # SYSLIBS contains libraries that need to be linked to all lib targets |
| 35 | @@ -104,7 +104,7 @@ if(OPENSSL_FOUND AND WITH_OPENSSL) |
| 36 | src/thrift/transport/TSSLSocket.cpp |
| 37 | src/thrift/transport/TSSLServerSocket.cpp |
| 38 | ) |
| 39 | - include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") |
| 40 | + include_directories(${OPENSSL_INCLUDE_DIR}) |
| 41 | list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") |
| 42 | endif() |
| 43 | |
| 44 | @@ -162,7 +162,7 @@ TARGET_LINK_LIBRARIES_THRIFT(thrift ${SYSLIBS}) |
| 45 | |
| 46 | if(WITH_LIBEVENT) |
| 47 | find_package(Libevent REQUIRED) # Libevent comes with CMake support form upstream |
| 48 | - include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) |
| 49 | + include_directories(${LIBEVENT_INCLUDE_DIRS}) |
| 50 | |
| 51 | ADD_LIBRARY_THRIFT(thriftnb ${thriftcppnb_SOURCES}) |
| 52 | TARGET_LINK_LIBRARIES_THRIFT(thriftnb ${SYSLIBS} ${LIBEVENT_LIBRARIES}) |
| 53 | @@ -171,7 +171,7 @@ endif() |
| 54 | |
| 55 | if(WITH_ZLIB) |
| 56 | find_package(ZLIB REQUIRED) |
| 57 | - include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS}) |
| 58 | + include_directories(${ZLIB_INCLUDE_DIRS}) |
| 59 | |
| 60 | ADD_LIBRARY_THRIFT(thriftz ${thriftcppz_SOURCES}) |
| 61 | TARGET_LINK_LIBRARIES_THRIFT(thriftz ${SYSLIBS} ${ZLIB_LIBRARIES}) |
| 62 | diff --git a/lib/cpp/test/CMakeLists.txt b/lib/cpp/test/CMakeLists.txt |
| 63 | index 5de9fc4..c956c38 100644 |
| 64 | --- a/lib/cpp/test/CMakeLists.txt |
| 65 | +++ b/lib/cpp/test/CMakeLists.txt |
| 66 | @@ -20,7 +20,7 @@ |
| 67 | # Find required packages |
| 68 | set(Boost_USE_STATIC_LIBS ON) # Force the use of static boost test framework |
| 69 | find_package(Boost 1.53.0 REQUIRED COMPONENTS chrono filesystem system thread unit_test_framework) |
| 70 | -include_directories(SYSTEM "${Boost_INCLUDE_DIRS}") |
| 71 | +include_directories(${Boost_INCLUDE_DIRS}) |
| 72 | |
| 73 | #Make sure gen-cpp files can be included |
| 74 | include_directories("${CMAKE_CURRENT_BINARY_DIR}") |
| 75 | diff --git a/test/cpp/CMakeLists.txt b/test/cpp/CMakeLists.txt |
| 76 | index 2d75f2e..b1409de 100755 |
| 77 | --- a/test/cpp/CMakeLists.txt |
| 78 | +++ b/test/cpp/CMakeLists.txt |
| 79 | @@ -22,13 +22,13 @@ include(ThriftMacros) |
| 80 | |
| 81 | set(Boost_USE_STATIC_LIBS ON) |
| 82 | find_package(Boost 1.53.0 REQUIRED COMPONENTS program_options system filesystem) |
| 83 | -include_directories(SYSTEM "${Boost_INCLUDE_DIRS}") |
| 84 | +include_directories(${Boost_INCLUDE_DIRS}) |
| 85 | |
| 86 | find_package(OpenSSL REQUIRED) |
| 87 | -include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") |
| 88 | +include_directories(${OPENSSL_INCLUDE_DIR}) |
| 89 | |
| 90 | find_package(Libevent REQUIRED) # Libevent comes with CMake support from upstream |
| 91 | -include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) |
| 92 | +include_directories(${LIBEVENT_INCLUDE_DIRS}) |
| 93 | |
| 94 | #Make sure gen-cpp files can be included |
| 95 | include_directories("${CMAKE_CURRENT_BINARY_DIR}") |
| 96 | diff --git a/tutorial/cpp/CMakeLists.txt b/tutorial/cpp/CMakeLists.txt |
| 97 | index 2b0c143..5ecae17 100644 |
| 98 | --- a/tutorial/cpp/CMakeLists.txt |
| 99 | +++ b/tutorial/cpp/CMakeLists.txt |
| 100 | @@ -18,7 +18,7 @@ |
| 101 | # |
| 102 | |
| 103 | find_package(Boost 1.53.0 REQUIRED) |
| 104 | -include_directories(SYSTEM "${Boost_INCLUDE_DIRS}") |
| 105 | +include_directories(${Boost_INCLUDE_DIRS}) |
| 106 | |
| 107 | #Make sure gen-cpp files can be included |
| 108 | include_directories("${CMAKE_CURRENT_BINARY_DIR}") |