fix FreeBSD build
This commit is contained in:
parent
c605cbdbcc
commit
625253a7e8
|
@ -157,9 +157,14 @@ if (UNIX)
|
||||||
)
|
)
|
||||||
|
|
||||||
else() # not-apple
|
else() # not-apple
|
||||||
|
# FreeBSD uses /usr/local for anything not part of base
|
||||||
# add include dir for bsd (posix uses /usr/include/)
|
# Also package avahi-libdns puts dns_sd.h a bit deeper
|
||||||
set (CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}:/usr/local/include")
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||||
|
set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};/usr/local/include;/usr/local/include/avahi-compat-libdns_sd")
|
||||||
|
set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L/usr/local/lib")
|
||||||
|
include_directories("/usr/local/include" "/usr/local/include/avahi-compat-libdns_sd")
|
||||||
|
link_directories("/usr/local/lib")
|
||||||
|
endif()
|
||||||
|
|
||||||
set (XKBlib "X11/Xlib.h;X11/XKBlib.h")
|
set (XKBlib "X11/Xlib.h;X11/XKBlib.h")
|
||||||
set (CMAKE_EXTRA_INCLUDE_FILES "${XKBlib};X11/extensions/Xrandr.h")
|
set (CMAKE_EXTRA_INCLUDE_FILES "${XKBlib};X11/extensions/Xrandr.h")
|
||||||
|
@ -174,6 +179,7 @@ if (UNIX)
|
||||||
check_include_files ("X11/extensions/XTest.h" HAVE_X11_EXTENSIONS_XTEST_H)
|
check_include_files ("X11/extensions/XTest.h" HAVE_X11_EXTENSIONS_XTEST_H)
|
||||||
check_include_files ("${XKBlib}" HAVE_X11_XKBLIB_H)
|
check_include_files ("${XKBlib}" HAVE_X11_XKBLIB_H)
|
||||||
check_include_files ("X11/extensions/XInput2.h" HAVE_XI2)
|
check_include_files ("X11/extensions/XInput2.h" HAVE_XI2)
|
||||||
|
check_include_files ("dns_sd.h" HAVE_DNSSD)
|
||||||
|
|
||||||
if (HAVE_X11_EXTENSIONS_DPMS_H)
|
if (HAVE_X11_EXTENSIONS_DPMS_H)
|
||||||
# Assume that function prototypes declared, when include exists.
|
# Assume that function prototypes declared, when include exists.
|
||||||
|
@ -184,6 +190,10 @@ if (UNIX)
|
||||||
message (FATAL_ERROR "Missing header: " ${XKBlib})
|
message (FATAL_ERROR "Missing header: " ${XKBlib})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (NOT HAVE_DNSSD)
|
||||||
|
message (FATAL_ERROR "Missing header: dns_sd.h")
|
||||||
|
endif()
|
||||||
|
|
||||||
check_library_exists ("SM;ICE" IceConnectionNumber "" HAVE_ICE)
|
check_library_exists ("SM;ICE" IceConnectionNumber "" HAVE_ICE)
|
||||||
check_library_exists ("Xext;X11" DPMSQueryExtension "" HAVE_Xext)
|
check_library_exists ("Xext;X11" DPMSQueryExtension "" HAVE_Xext)
|
||||||
check_library_exists ("Xtst;Xext;X11" XTestQueryExtension "" HAVE_Xtst)
|
check_library_exists ("Xtst;Xext;X11" XTestQueryExtension "" HAVE_Xtst)
|
||||||
|
@ -305,7 +315,14 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
set (OPENSSL_LIBS ssl crypto)
|
set (OPENSSL_LIBS ssl crypto)
|
||||||
else()
|
else()
|
||||||
message (FATAL_ERROR "Couldn't find OpenSSL")
|
find_library (lib_ssl ssl)
|
||||||
|
find_library (lib_crypto crypto)
|
||||||
|
if (NOT lib_ssl)
|
||||||
|
message(FATAL_ERROR "openssl library not found")
|
||||||
|
elseif (NOT lib_crypto)
|
||||||
|
message(FATAL_ERROR "crypto library not found")
|
||||||
|
endif()
|
||||||
|
set (OPENSSL_LIBS ${lib_ssl} ${lib_crypto})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -36,7 +36,8 @@ if (WIN32)
|
||||||
elseif (APPLE)
|
elseif (APPLE)
|
||||||
find_library(APPSERVICES_LIB ApplicationServices)
|
find_library(APPSERVICES_LIB ApplicationServices)
|
||||||
target_link_libraries(barrier ${APPSERVICES_LIB})
|
target_link_libraries(barrier ${APPSERVICES_LIB})
|
||||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR
|
||||||
|
${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||||
target_link_libraries (barrier dns_sd)
|
target_link_libraries (barrier dns_sd)
|
||||||
else()
|
else()
|
||||||
target_link_libraries (barrier)
|
target_link_libraries (barrier)
|
||||||
|
|
|
@ -40,5 +40,8 @@ endif()
|
||||||
add_library(arch STATIC ${sources})
|
add_library(arch STATIC ${sources})
|
||||||
|
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
target_link_libraries(arch dl ${libs})
|
target_link_libraries(arch ${libs})
|
||||||
|
if (NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||||
|
target_link_libraries(arch dl)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue