2016-12-19 17:41:01 +00:00
|
|
|
cmake_minimum_required (VERSION 3.4)
|
|
|
|
|
2017-01-23 23:49:40 +00:00
|
|
|
find_package (Qt5 COMPONENTS Core Widgets Network)
|
2016-12-19 17:41:01 +00:00
|
|
|
set (CMAKE_AUTOMOC ON)
|
|
|
|
set (CMAKE_AUTORCC ON)
|
|
|
|
set (CMAKE_AUTOUIC ON)
|
|
|
|
set (CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
2018-03-11 16:48:59 +00:00
|
|
|
file (GLOB GUI_SOURCE_FILES src/*.cpp src/*.h)
|
|
|
|
file (GLOB GUI_UI_FILES src/*.ui)
|
2016-12-19 17:41:01 +00:00
|
|
|
|
2017-02-09 20:05:36 +00:00
|
|
|
if (WIN32)
|
2018-03-11 16:48:59 +00:00
|
|
|
set (GUI_RC_FILES res/win/Barrier.rc)
|
2017-02-09 20:05:36 +00:00
|
|
|
endif()
|
|
|
|
|
2018-01-27 21:48:17 +00:00
|
|
|
add_executable (barrier WIN32
|
2018-03-11 16:48:59 +00:00
|
|
|
${GUI_SOURCE_FILES}
|
|
|
|
${GUI_UI_FILES}
|
|
|
|
${GUI_RC_FILES}
|
2018-01-27 21:48:17 +00:00
|
|
|
res/Barrier.qrc
|
2016-12-19 17:41:01 +00:00
|
|
|
)
|
|
|
|
|
2017-03-09 14:32:41 +00:00
|
|
|
include_directories (./src)
|
2018-01-31 15:04:07 +00:00
|
|
|
|
2018-06-30 17:44:34 +00:00
|
|
|
target_link_libraries (barrier Qt5::Core Qt5::Widgets Qt5::Network)
|
2018-01-31 15:04:07 +00:00
|
|
|
target_compile_definitions (barrier PRIVATE -DBARRIER_VERSION_STAGE="${BARRIER_VERSION_STAGE}")
|
|
|
|
target_compile_definitions (barrier PRIVATE -DBARRIER_REVISION="${BARRIER_REVISION}")
|
2016-12-19 17:41:01 +00:00
|
|
|
|
|
|
|
if (WIN32)
|
2016-12-28 11:50:32 +00:00
|
|
|
include_directories ($ENV{BONJOUR_SDK_HOME}/Include)
|
|
|
|
find_library (DNSSD_LIB dnssd.lib
|
|
|
|
HINTS ENV BONJOUR_SDK_HOME
|
|
|
|
PATH_SUFFIXES "Lib/x64")
|
2018-01-31 15:04:07 +00:00
|
|
|
set_target_properties (barrier PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT")
|
|
|
|
target_link_libraries (barrier ${DNSSD_LIB})
|
2018-02-13 19:49:39 +00:00
|
|
|
elseif (APPLE)
|
|
|
|
find_library(APPSERVICES_LIB ApplicationServices)
|
|
|
|
target_link_libraries(barrier ${APPSERVICES_LIB})
|
2018-03-02 23:36:31 +00:00
|
|
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR
|
|
|
|
${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
2018-01-27 21:48:17 +00:00
|
|
|
target_link_libraries (barrier dns_sd)
|
2018-03-04 19:48:15 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (HAVE_X11)
|
|
|
|
target_link_libraries (barrier X11)
|
2017-02-07 01:35:07 +00:00
|
|
|
endif()
|
2017-03-07 14:10:24 +00:00
|
|
|
|
2018-03-29 18:01:07 +00:00
|
|
|
target_link_libraries (barrier common)
|
|
|
|
|
2017-03-07 14:10:24 +00:00
|
|
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
2018-01-27 21:48:17 +00:00
|
|
|
install (TARGETS barrier DESTINATION ${BARRIER_BUNDLE_BINARY_DIR})
|
2017-04-25 13:15:15 +00:00
|
|
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
2018-01-27 21:48:17 +00:00
|
|
|
install (TARGETS barrier DESTINATION bin)
|
2017-03-07 14:10:24 +00:00
|
|
|
endif()
|