-include_directories(${CMAKE_SOURCE_DIR}/common)
-
add_library(network STATIC
Socket.cxx
TcpSocket.cxx)
target_sources(network PRIVATE UnixSocket.cxx)
endif()
+target_include_directories(network PUBLIC ${CMAKE_SOURCE_DIR}/common)
target_link_libraries(network os rdr rfb)
if(WIN32)
-include_directories(${CMAKE_SOURCE_DIR}/common)
-
add_library(os STATIC
Mutex.cxx
Thread.cxx
os.cxx)
+target_include_directories(os PUBLIC ${CMAKE_SOURCE_DIR}/common)
target_link_libraries(os rdr)
if(UNIX)
-include_directories(${CMAKE_SOURCE_DIR}/common)
-include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS})
-
add_library(rdr STATIC
AESInStream.cxx
AESOutStream.cxx
ZlibInStream.cxx
ZlibOutStream.cxx)
+target_include_directories(rdr PUBLIC ${CMAKE_SOURCE_DIR}/common)
+target_include_directories(rdr SYSTEM PUBLIC ${ZLIB_INCLUDE_DIRS})
target_link_libraries(rdr ${ZLIB_LIBRARIES} os rfb)
if(GNUTLS_FOUND)
- include_directories(SYSTEM ${GNUTLS_INCLUDE_DIR})
+ target_include_directories(rdr SYSTEM PUBLIC ${GNUTLS_INCLUDE_DIR})
target_link_libraries(rdr ${GNUTLS_LIBRARIES})
endif()
if (NETTLE_FOUND)
- include_directories(SYSTEM ${NETTLE_INCLUDE_DIRS})
+ target_include_directories(rdr SYSTEM PUBLIC ${NETTLE_INCLUDE_DIRS})
target_link_libraries(rdr ${NETTLE_LIBRARIES})
target_link_directories(rdr PUBLIC ${NETTLE_LIBRARY_DIRS})
endif()
-include_directories(${CMAKE_SOURCE_DIR}/common)
-include_directories(SYSTEM ${JPEG_INCLUDE_DIR})
-include_directories(SYSTEM ${PIXMAN_INCLUDE_DIRS})
-
add_library(rfb STATIC
Blacklist.cxx
Congestion.cxx
obfuscate.cxx
util.cxx)
+target_include_directories(rfb PUBLIC ${CMAKE_SOURCE_DIR}/common)
+target_include_directories(rfb SYSTEM PUBLIC ${JPEG_INCLUDE_DIR})
+target_include_directories(rfb SYSTEM PUBLIC ${PIXMAN_INCLUDE_DIRS})
target_link_libraries(rfb os rdr network)
target_link_libraries(rfb ${JPEG_LIBRARIES} ${PIXMAN_LIBRARIES})
target_link_directories(rfb PUBLIC ${PIXMAN_LIBRARY_DIRS})
elseif(H264_LIBS STREQUAL "WIN")
target_sources(rfb PRIVATE H264WinDecoderContext.cxx)
endif()
- include_directories(SYSTEM ${H264_INCLUDE_DIRS})
+ target_include_directories(rfb SYSTEM PUBLIC ${H264_INCLUDE_DIRS})
target_link_libraries(rfb ${H264_LIBRARIES})
target_link_directories(rfb PUBLIC ${H264_LIBRARY_DIRS})
endif()
endif()
if(WIN32)
- include_directories(${CMAKE_SOURCE_DIR}/win)
+ target_include_directories(rfb PUBLIC ${CMAKE_SOURCE_DIR}/win)
target_sources(rfb PRIVATE WinPasswdValidator.cxx)
endif(WIN32)
if(GNUTLS_FOUND)
target_sources(rfb PRIVATE CSecurityTLS.cxx SSecurityTLS.cxx)
- include_directories(SYSTEM ${GNUTLS_INCLUDE_DIR})
+ target_include_directories(rfb SYSTEM PUBLIC ${GNUTLS_INCLUDE_DIR})
target_link_libraries(rfb ${GNUTLS_LIBRARIES})
endif()
if (NETTLE_FOUND)
target_sources(rfb PRIVATE CSecurityDH.cxx CSecurityMSLogonII.cxx
CSecurityRSAAES.cxx SSecurityRSAAES.cxx)
- include_directories(SYSTEM ${NETTLE_INCLUDE_DIRS} ${GMP_INCLUDE_DIRS})
+ target_include_directories(rfb SYSTEM PUBLIC ${NETTLE_INCLUDE_DIRS}
+ ${GMP_INCLUDE_DIRS})
target_link_libraries(rfb ${HOGWEED_LIBRARIES}
${NETTLE_LIBRARIES} ${GMP_LIBRARIES})
target_link_directories(rfb PUBLIC ${HOGWEED_LIBRARY_DIRS}
include_directories(${CMAKE_SOURCE_DIR}/common)
-include_directories(SYSTEM ${GETTEXT_INCLUDE_DIR})
add_library(test_util STATIC util.cxx)
target_link_libraries(encperf test_util rfb)
if (BUILD_VIEWER)
- include_directories(SYSTEM ${FLTK_INCLUDE_DIR})
add_executable(fbperf
fbperf.cxx
${CMAKE_SOURCE_DIR}/vncviewer/PlatformPixelBuffer.cxx
else()
target_sources(fbperf PRIVATE ${CMAKE_SOURCE_DIR}/vncviewer/Surface_X11.cxx)
endif()
+ target_include_directories(fbperf SYSTEM PUBLIC ${FLTK_INCLUDE_DIR})
+ target_include_directories(fbperf SYSTEM PUBLIC ${GETTEXT_INCLUDE_DIR})
target_link_libraries(fbperf test_util rfb ${FLTK_LIBRARIES} ${GETTEXT_LIBRARIES})
if(WIN32)
target_link_libraries(fbperf msimg32)
include_directories(${CMAKE_SOURCE_DIR}/common)
include_directories(${CMAKE_SOURCE_DIR}/vncviewer)
-include_directories(SYSTEM ${GETTEXT_INCLUDE_DIR})
add_executable(conv conv.cxx)
target_link_libraries(conv rfb)
target_link_libraries(unicode rfb)
add_executable(emulatemb emulatemb.cxx ../../vncviewer/EmulateMB.cxx)
+target_include_directories(emulatemb SYSTEM PUBLIC ${GETTEXT_INCLUDE_DIR})
target_link_libraries(emulatemb rfb ${GETTEXT_LIBRARIES})
-include_directories(${CMAKE_SOURCE_DIR}/common)
-include_directories(${CMAKE_SOURCE_DIR}/unix/common)
-
add_library(unixcommon STATIC
randr.cxx)
+target_include_directories(unixcommon PUBLIC ${CMAKE_SOURCE_DIR}/common)
+target_include_directories(unixcommon PUBLIC ${CMAKE_SOURCE_DIR}/unix/common)
+
if(UNIX)
libtool_create_control_file(unixcommon)
endif()
-include_directories(SYSTEM ${X11_INCLUDE_DIR})
-
-include_directories(${CMAKE_SOURCE_DIR}/common)
-include_directories(${CMAKE_SOURCE_DIR}/common/rfb)
-
add_library(tx STATIC
TXWindow.cxx)
+target_include_directories(tx SYSTEM PUBLIC ${X11_INCLUDE_DIR})
+
+target_include_directories(tx PUBLIC ${CMAKE_SOURCE_DIR}/common)
+target_include_directories(tx PUBLIC ${CMAKE_SOURCE_DIR}/common/rfb)
+
target_link_libraries(tx ${X11_LIBRARIES})
-include_directories(SYSTEM ${X11_INCLUDE_DIR})
-
-include_directories(${CMAKE_SOURCE_DIR}/common)
-include_directories(${CMAKE_SOURCE_DIR}/unix/tx)
-
add_executable(vncconfig
buildtime.c
vncExt.c
vncconfig.cxx
QueryConnectDialog.cxx)
+target_include_directories(vncconfig SYSTEM PUBLIC ${X11_INCLUDE_DIR})
+
+target_include_directories(vncconfig PUBLIC ${CMAKE_SOURCE_DIR}/common)
+target_include_directories(vncconfig PUBLIC ${CMAKE_SOURCE_DIR}/unix/tx)
+
target_link_libraries(vncconfig tx rfb network rdr ${X11_LIBRARIES})
install(TARGETS vncconfig DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
-include_directories(${CMAKE_SOURCE_DIR}/common)
-
add_executable(vncpasswd
vncpasswd.cxx)
+target_include_directories(vncpasswd PUBLIC ${CMAKE_SOURCE_DIR}/common)
target_link_libraries(vncpasswd tx rfb os)
install(TARGETS vncpasswd DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
-include_directories(SYSTEM ${X11_INCLUDE_DIR})
-include_directories(${CMAKE_SOURCE_DIR}/unix/common)
-include_directories(${CMAKE_SOURCE_DIR}/unix/tx)
-include_directories(${CMAKE_SOURCE_DIR}/unix)
-include_directories(${CMAKE_SOURCE_DIR}/common)
-
add_executable(x0vncserver
buildtime.c
Geometry.cxx
../vncconfig/QueryConnectDialog.cxx
)
+target_include_directories(x0vncserver SYSTEM PUBLIC ${X11_INCLUDE_DIR})
+target_include_directories(x0vncserver PUBLIC ${CMAKE_SOURCE_DIR}/unix/common)
+target_include_directories(x0vncserver PUBLIC ${CMAKE_SOURCE_DIR}/unix/tx)
+target_include_directories(x0vncserver PUBLIC ${CMAKE_SOURCE_DIR}/unix)
+target_include_directories(x0vncserver PUBLIC ${CMAKE_SOURCE_DIR}/common)
target_link_libraries(x0vncserver tx rfb network rdr unixcommon)
if(X11_FOUND AND X11_XTest_LIB)
-include_directories(SYSTEM ${FLTK_INCLUDE_DIR})
-include_directories(SYSTEM ${GETTEXT_INCLUDE_DIR})
-
-include_directories(${CMAKE_SOURCE_DIR}/common)
-
add_executable(vncviewer
fltk/Fl_Monitor_Arrangement.cxx
fltk/Fl_Navigation.cxx
if(WIN32)
# Since vncviewer.rc is generated, local includes will be looking
# in the wrong directory. We need to help it out.
- include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+ target_include_directories(vncviewer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
configure_file(vncviewer.rc.in vncviewer.rc)
target_sources(vncviewer PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/vncviewer.rc)
endif()
target_sources(vncviewer PRIVATE Surface_X11.cxx)
endif()
+target_include_directories(vncviewer SYSTEM PUBLIC ${FLTK_INCLUDE_DIR})
+target_include_directories(vncviewer SYSTEM PUBLIC ${GETTEXT_INCLUDE_DIR})
+target_include_directories(vncviewer PUBLIC ${CMAKE_SOURCE_DIR}/common)
target_link_libraries(vncviewer rfb network rdr os ${FLTK_LIBRARIES} ${GETTEXT_LIBRARIES})
if(WIN32)
-include_directories(${CMAKE_BINARY_DIR}/win)
-
add_executable(vncconfig WIN32
Legacy.cxx
PasswordDialog.cxx
vncconfig.cxx
vncconfig.rc)
+target_include_directories(vncconfig PUBLIC ${CMAKE_BINARY_DIR}/win)
target_link_libraries(vncconfig rfb_win32 rfb network rdr ws2_32.lib)
install(TARGETS vncconfig
-include_directories(${CMAKE_BINARY_DIR}/win ${CMAKE_CURRENT_SOURCE_DIR})
-
add_executable(winvnc4 WIN32
buildTime.cxx
ControlPanel.cxx
winvnc.cxx
winvnc.rc)
+target_include_directories(winvnc4 PUBLIC ${CMAKE_BINARY_DIR}/win)
+target_include_directories(winvnc4 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(winvnc4 rfb rfb_win32 network rdr ws2_32.lib)
install(TARGETS winvnc4
-include_directories(${CMAKE_BINARY_DIR}/win ${CMAKE_CURRENT_SOURCE_DIR})
-
add_library(wm_hooks SHARED
../wm_hooks/wm_hooks.cxx
../wm_hooks/wm_hooks.rc)
# We want the DLL to be named wm_hooks.dll rather than libwm_hooks.dll
set_target_properties(wm_hooks PROPERTIES PREFIX "")
+target_include_directories(wm_hooks PUBLIC ${CMAKE_BINARY_DIR}/win)
+target_include_directories(wm_hooks PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+
install(TARGETS wm_hooks
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
)