# The RC version must always be four comma-separated numbers
set(RCVERSION 1,0,90,0)
+# Compatibility variables for the migration from autotools
+add_definitions(-DPACKAGE_NAME="${CMAKE_PROJECT_NAME}")
+add_definitions(-DPACKAGE_VERSION="${VERSION}")
+add_definitions(-DLOCALEDIR="${CMAKE_INSTALL_PREFIX}/share/locale")
+
# Try to encode today's date into the build id. We assume that MSVC
# means we need to use a native Windows method, otherwise we assume
# some kind of Unix system. The id will be empty if things fail.
"<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> --output-format=coff <SOURCE>")
endif()
+# X11 stuff. It's in a if() so that we can say REQUIRED
+if(UNIX)
+ find_package(X11 REQUIRED)
+endif()
+
# Check for zlib
find_package(ZLIB)
option(USE_INCLUDED_ZLIB "Force use of the bundled zlib")
include_directories(${CMAKE_BINARY_DIR})
add_subdirectory(common)
-add_subdirectory(win)
+
+if(WIN32)
+ add_subdirectory(win)
+else()
+ add_subdirectory(unix)
+endif()
--- /dev/null
+add_subdirectory(tx)
+
+add_subdirectory(vncconfig)
+add_subdirectory(vncpasswd)
+add_subdirectory(vncviewer)
--- /dev/null
+include_directories(${X11_INCLUDE_DIR})
+
+include_directories(${CMAKE_SOURCE_DIR}/common)
+include_directories(${CMAKE_SOURCE_DIR}/common/rfb)
+
+add_library(tx STATIC
+ TXWindow.cxx
+ TXScrollbar.cxx
+ TXViewport.cxx
+ TXImage.cxx
+ TXMenu.cxx)
+
+target_link_libraries(tx ${X11_LIBRARIES})
--- /dev/null
+include_directories(${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_link_libraries(vncconfig tx rfb network rdr ${X11_LIBRARIES})
--- /dev/null
+include_directories(${CMAKE_SOURCE_DIR}/common)
+
+add_executable(vncpasswd
+ vncpasswd.cxx)
+
+target_link_libraries(vncpasswd tx rfb rdr os)
--- /dev/null
+include_directories(${X11_INCLUDE_DIR})
+
+include_directories(${CMAKE_SOURCE_DIR}/common)
+include_directories(${CMAKE_SOURCE_DIR}/unix/tx)
+include_directories(${CMAKE_SOURCE_DIR}/intl)
+
+add_executable(vncviewer
+ buildtime.c
+ CConn.cxx
+ DesktopWindow.cxx
+ vncviewer.cxx)
+
+target_link_libraries(vncviewer tx rfb network rdr os ${X11_LIBRARIES})