diff options
author | Gerald Combs <gerald@wireshark.org> | 2021-02-16 18:04:59 -0800 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-02-18 06:34:46 +0000 |
commit | 4fd5224ecf5f5b51d3e4e5036948571649898313 (patch) | |
tree | 6fb457e3ee5d3e0295fe56712adf4b92763d228f /CMakeLists.txt | |
parent | 6bffbc9896f7772adc94660564b5cbafead73fc6 (diff) |
CMake: Use target_include_directores more.
The include_directories documentation at
https://cmake.org/cmake/help/latest/command/include_directories.html
says:
"Note: Prefer the target_include_directories() command to add include
directories to individual targets and optionally propagate/export them
to dependents."
Switch from include_directories to target_include_directories in a bunch
of places.
Add "SYSTEM" to the remaining external include_directories calls in
order to minimize our compiler warning blast radius.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 71eddc4dc9..a397c49081 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -994,7 +994,7 @@ message(STATUS "Linker flags: ${WS_LINK_FLAGS}") if(APPLE AND EXISTS /usr/local/opt/gettext) # GLib on macOS requires libintl. Homebrew installs gettext (and # libintl) in /usr/local/opt/gettext - include_directories(/usr/local/opt/gettext/include) + include_directories(SYSTEM /usr/local/opt/gettext/include) link_directories(/usr/local/opt/gettext/lib) endif() @@ -1208,9 +1208,7 @@ endif() # Include minizip include directories if(MINIZIP_FOUND) - include_directories( - ${MINIZIP_INCLUDE_DIRS} - ) + include_directories(SYSTEM ${MINIZIP_INCLUDE_DIRS}) else() set(MINIZIP_LIBRARY "") endif() @@ -2577,10 +2575,7 @@ if(BUILD_sharkd) add_executable(sharkd ${sharkd_FILES}) set_extra_executable_properties(sharkd "Executables") target_link_libraries(sharkd ${sharkd_LIBS}) - target_include_directories(sharkd SYSTEM - PUBLIC - ${SPEEXDSP_INCLUDE_DIRS} - ) + target_include_directories(sharkd SYSTEM PUBLIC ${SPEEXDSP_INCLUDE_DIRS}) install(TARGETS sharkd RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() |