]> source.dussan.org Git - tigervnc.git/commitdiff
Generate config.h for Windows build
authorDRC <dcommander@users.sourceforge.net>
Tue, 9 Nov 2010 19:24:12 +0000 (19:24 +0000)
committerDRC <dcommander@users.sourceforge.net>
Tue, 9 Nov 2010 19:24:12 +0000 (19:24 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4185 3789f03b-4d11-0410-bbf8-ca57d06f2519

CMakeLists.txt
config.h.cmake.in [new file with mode: 0644]

index f390767d3b72a217984e09df3dad52514a1491f3..9c08e8b097d84aad9167fd2bb0a72e176ab003b4 100644 (file)
@@ -85,6 +85,22 @@ if(MINGW)
     "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> --output-format=coff <SOURCE>")
 endif()
 
+# Generate config.h
+include(CheckIncludeFiles)
+include(CheckFunctionExists)
+set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h)
+set(CMAKE_REQUIRED_LIBRARIES ws2_32)
+check_function_exists(inet_aton HAVE_INET_ATON)
+check_function_exists(inet_ntop HAVE_INET_NTOP)
+set(CMAKE_EXTRA_INCLUDE_FILES) 
+set(CMAKE_REQUIRED_LIBRARIES)
+check_function_exists(snprintf HAVE_SNPRINTF)
+check_function_exists(strcasecmp HAVE_STRCASECMP)
+check_function_exists(strncasecmp HAVE_STRNCASECMP)
+check_function_exists(vsnprintf HAVE_VSNPRINTF)
+configure_file(config.h.cmake.in config.h)
+add_definitions(-DHAVE_CONFIG_H)
+include_directories(${CMAKE_BINARY_DIR})
 
 add_subdirectory(common)
 add_subdirectory(win)
diff --git a/config.h.cmake.in b/config.h.cmake.in
new file mode 100644 (file)
index 0000000..87aa9d5
--- /dev/null
@@ -0,0 +1,6 @@
+#cmakedefine HAVE_INET_ATON
+#cmakedefine HAVE_INET_NTOP
+#cmakedefine HAVE_SNPRINTF
+#cmakedefine HAVE_STRCASECMP
+#cmakedefine HAVE_STRNCASECMP
+#cmakedefine HAVE_VSNPRINTF