From d8237238b4ae229484689ce0ea3ca9955c6d6a71 Mon Sep 17 00:00:00 2001 From: walker0643 <> Date: Wed, 31 Jan 2018 10:04:07 -0500 Subject: [PATCH] rearrange CMakeLists.txt in gui --- src/gui/CMakeLists.txt | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 70daa566..fdc29ec5 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -21,24 +21,22 @@ add_executable (barrier WIN32 ) include_directories (./src) -target_link_libraries (barrier) - -if (WIN32) - include_directories ($ENV{BONJOUR_SDK_HOME}/Include) - find_library (DNSSD_LIB dnssd.lib - HINTS ENV BONJOUR_SDK_HOME - PATH_SUFFIXES "Lib/x64") -elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") - target_link_libraries (barrier dns_sd) -endif() qt5_use_modules (barrier Core Widgets Network) target_compile_definitions (barrier PRIVATE -DBARRIER_VERSION_STAGE="${BARRIER_VERSION_STAGE}") target_compile_definitions (barrier PRIVATE -DBARRIER_REVISION="${BARRIER_REVISION}") if (WIN32) - target_link_libraries (barrier ${DNSSD_LIB}) + include_directories ($ENV{BONJOUR_SDK_HOME}/Include) + find_library (DNSSD_LIB dnssd.lib + HINTS ENV BONJOUR_SDK_HOME + PATH_SUFFIXES "Lib/x64") set_target_properties (barrier PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT") + target_link_libraries (barrier ${DNSSD_LIB}) +elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + target_link_libraries (barrier dns_sd) +else() + target_link_libraries (barrier) endif() if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")