diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2019-01-10 01:45:00 +0000 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2019-01-20 11:50:10 +0000 |
commit | a3991874eb3d470a4adfcdef7903ab8d6dd8f881 (patch) | |
tree | 22a42523aae8ff158780e7504b072c1383aa4e91 /extcap | |
parent | be103a4286a55361d93f1aa2c25d8a180357a7b4 (diff) |
CMake: Replace PACKAGELIST magic
This is more explicit and easier to read with slightly better locality
while using less code.
Also less awkward when the package doesn't fit the narrow package list
expectations.
The ws_find_package() macro doesn't include all the status messages. The
choice was to rely on standard find_package() and feature_summary() output
and be less verbose.
Avoid polluting the CLI build interface. Per target include paths and
macro definitions are preferred.
Because this patch intentionally removes the global CMAKE_*_FLAGS
and include_directories() usage in favor of target properties, some
untested build configurations may inadvertently break because of
missing ${PACKAGE}_INCLUDE_DIRS or ${PACKAGE}_DEFINITIONS. This
required a manual review of dependencies that might have been
incomplete.
${PACKAGE_VAR}_LINK_FLAGS seems to be unused.
Changing the CMake Qt code to use more modern CMake component syntax
is left as future work.
Change-Id: I3ed75252189a6e05a23ed6e619088f519cd7ed78
Reviewed-on: https://code.wireshark.org/review/31496
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'extcap')
-rw-r--r-- | extcap/CMakeLists.txt | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/extcap/CMakeLists.txt b/extcap/CMakeLists.txt index f85ec5f22e..384e62cb2d 100644 --- a/extcap/CMakeLists.txt +++ b/extcap/CMakeLists.txt @@ -78,6 +78,10 @@ add_custom_target(extcaps) add_library(extcap-base OBJECT extcap-base.c) if(LIBSSH_FOUND) add_library(ssh-base OBJECT ssh-base.c) + target_include_directories(ssh-base SYSTEM + PRIVATE + ${LIBSSH_INCLUDE_DIRS} + ) endif() if(BUILD_androiddump) @@ -132,7 +136,7 @@ if(BUILD_sshdump AND LIBSSH_FOUND) add_executable(sshdump ${sshdump_FILES}) set_extcap_executable_properties(sshdump) target_link_libraries(sshdump ${sshdump_LIBS}) - target_include_directories(sshdump PUBLIC ${LIBSSH_INCLUDE_DIR}) + target_include_directories(sshdump SYSTEM PRIVATE ${LIBSSH_INCLUDE_DIRS}) install(TARGETS sshdump RUNTIME DESTINATION ${EXTCAP_INSTALL_LIBDIR}) add_dependencies(extcaps sshdump) elseif (BUILD_sshdump) @@ -158,7 +162,7 @@ if(BUILD_ciscodump AND LIBSSH_FOUND) add_executable(ciscodump ${ciscodump_FILES}) set_extcap_executable_properties(ciscodump) target_link_libraries(ciscodump ${ciscodump_LIBS}) - target_include_directories(ciscodump PUBLIC ${LIBSSH_INCLUDE_DIR}) + target_include_directories(ciscodump SYSTEM PRIVATE ${LIBSSH_INCLUDE_DIRS}) install(TARGETS ciscodump RUNTIME DESTINATION ${EXTCAP_INSTALL_LIBDIR}) add_dependencies(extcaps ciscodump) elseif (BUILD_ciscodump) @@ -182,7 +186,7 @@ if(BUILD_dpauxmon AND HAVE_LIBNL3) add_executable(dpauxmon ${dpauxmon_FILES}) set_extcap_executable_properties(dpauxmon) target_link_libraries(dpauxmon ${dpauxmon_LIBS}) - target_include_directories(dpauxmon PUBLIC ${NL_INCLUDE_DIR}) + target_include_directories(dpauxmon SYSTEM PRIVATE ${NL_INCLUDE_DIRS}) install(TARGETS dpauxmon RUNTIME DESTINATION ${EXTCAP_INSTALL_LIBDIR}) add_dependencies(extcaps dpauxmon) elseif (BUILD_dpauxmon) @@ -253,6 +257,8 @@ if(BUILD_sdjournal AND SYSTEMD_FOUND) add_executable(sdjournal ${sdjournal_FILES}) set_extcap_executable_properties(sdjournal) target_link_libraries(sdjournal ${sdjournal_LIBS}) + target_include_directories(sdjournal SYSTEM PRIVATE ${SYSTEMD_INCLUDE_DIRS}) + target_compile_definitions(sdjournal PRIVATE ${SYSTEMD_DEFINITIONS}) install(TARGETS sdjournal RUNTIME DESTINATION ${EXTCAP_INSTALL_LIBDIR}) add_dependencies(extcaps sdjournal) elseif (BUILD_sdjournal) |