]> source.dussan.org Git - tigervnc.git/commitdiff
Get the Unix stuff to build using CMake. Based on a patch by Henrik Andersson.
authorPierre Ossman <ossman@cendio.se>
Tue, 8 Mar 2011 16:32:49 +0000 (16:32 +0000)
committerPierre Ossman <ossman@cendio.se>
Tue, 8 Mar 2011 16:32:49 +0000 (16:32 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4336 3789f03b-4d11-0410-bbf8-ca57d06f2519

CMakeLists.txt
unix/CMakeLists.txt [new file with mode: 0644]
unix/tx/CMakeLists.txt [new file with mode: 0644]
unix/vncconfig/CMakeLists.txt [new file with mode: 0644]
unix/vncpasswd/CMakeLists.txt [new file with mode: 0644]
unix/vncviewer/CMakeLists.txt [new file with mode: 0644]

index 58bb224cdcf81c775365071213d27135ffa8bb25..83926e7a16936f0e874b71059a480adb4677f17c 100644 (file)
@@ -15,6 +15,11 @@ set(VERSION 1.0.90)
 # 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.
@@ -101,6 +106,11 @@ if(MINGW)
     "<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")
@@ -163,4 +173,9 @@ add_definitions(-DHAVE_CONFIG_H)
 include_directories(${CMAKE_BINARY_DIR})
 
 add_subdirectory(common)
-add_subdirectory(win)
+
+if(WIN32)
+  add_subdirectory(win)
+else()
+  add_subdirectory(unix)
+endif()
diff --git a/unix/CMakeLists.txt b/unix/CMakeLists.txt
new file mode 100644 (file)
index 0000000..176fad3
--- /dev/null
@@ -0,0 +1,5 @@
+add_subdirectory(tx)
+
+add_subdirectory(vncconfig)
+add_subdirectory(vncpasswd)
+add_subdirectory(vncviewer)
diff --git a/unix/tx/CMakeLists.txt b/unix/tx/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ab46f03
--- /dev/null
@@ -0,0 +1,13 @@
+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})
diff --git a/unix/vncconfig/CMakeLists.txt b/unix/vncconfig/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5570413
--- /dev/null
@@ -0,0 +1,12 @@
+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})
diff --git a/unix/vncpasswd/CMakeLists.txt b/unix/vncpasswd/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1125df2
--- /dev/null
@@ -0,0 +1,6 @@
+include_directories(${CMAKE_SOURCE_DIR}/common)
+
+add_executable(vncpasswd 
+  vncpasswd.cxx)
+
+target_link_libraries(vncpasswd tx rfb rdr os)
diff --git a/unix/vncviewer/CMakeLists.txt b/unix/vncviewer/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0a29268
--- /dev/null
@@ -0,0 +1,13 @@
+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})