[msn-proxy-devel] SF.net SVN: msn-proxy:[180] trunk
Brought to you by:
loos-br
|
From: <lo...@us...> - 2012-06-03 19:05:20
|
Revision: 180
http://msn-proxy.svn.sourceforge.net/msn-proxy/?rev=180&view=rev
Author: loos-br
Date: 2012-06-03 19:05:14 +0000 (Sun, 03 Jun 2012)
Log Message:
-----------
adding cmake files for MySQL building (not ready yet - still missing the installation options).
Modified Paths:
--------------
trunk/CMakeLists.txt
trunk/db-modules/mysql/mysql.c
trunk/msn-proxy/CMakeLists.txt
Added Paths:
-----------
trunk/db-modules/CMakeLists.txt
trunk/db-modules/mysql/CMakeLists.txt
Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt 2012-06-03 18:51:16 UTC (rev 179)
+++ trunk/CMakeLists.txt 2012-06-03 19:05:14 UTC (rev 180)
@@ -3,5 +3,18 @@
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
+set(LIBS "")
+
+option (USE_MYSQL
+ "Compile the MySQL backend database module" ON)
+option (USE_POSTGRES
+ "Compile the postgreSQL backend database module" OFF)
+
+# libevent
+find_package(LibEvent REQUIRED)
+include_directories(${LibEvent_INCLUDE_DIR})
+set(LIBS ${LIBS} ${LibEvent_LIBS})
+
add_subdirectory (msn-proxy)
+add_subdirectory (db-modules)
Added: trunk/db-modules/CMakeLists.txt
===================================================================
--- trunk/db-modules/CMakeLists.txt (rev 0)
+++ trunk/db-modules/CMakeLists.txt 2012-06-03 19:05:14 UTC (rev 180)
@@ -0,0 +1,8 @@
+
+if (USE_MYSQL)
+ add_subdirectory (mysql)
+endif (USE_MYSQL)
+
+if (USE_POSTGRES)
+ add_subdirectory (pgsql)
+endif (USE_POSTGRES)
Added: trunk/db-modules/mysql/CMakeLists.txt
===================================================================
--- trunk/db-modules/mysql/CMakeLists.txt (rev 0)
+++ trunk/db-modules/mysql/CMakeLists.txt 2012-06-03 19:05:14 UTC (rev 180)
@@ -0,0 +1,11 @@
+
+find_package(MySQL REQUIRED)
+include_directories(${MYSQL_INCLUDE_DIR})
+set(LIBS ${LIBS} ${MYSQL_LIBS})
+
+SET(CMAKE_C_FLAGS "-g -Wall -O2 -pipe -fno-builtin-log")
+
+SET(MYSQL_SRCS mysql.c sql.c)
+
+add_library (mysql MODULE ${MYSQL_SRCS})
+target_link_libraries (mysql ${LIBS})
Modified: trunk/db-modules/mysql/mysql.c
===================================================================
--- trunk/db-modules/mysql/mysql.c 2012-06-03 18:51:16 UTC (rev 179)
+++ trunk/db-modules/mysql/mysql.c 2012-06-03 19:05:14 UTC (rev 180)
@@ -29,10 +29,9 @@
#include <string.h>
#include <unistd.h>
-#include "../../../config.h"
-
#include "sql.h"
#include "mysql.h"
+
#include "../../msn-proxy/db.h"
#include "../../msn-proxy/fmt.h"
#include "../../msn-proxy/return.h"
@@ -40,6 +39,10 @@
#define print_bar(a) (a[strlen(a) - 1] == '/') ? "" : "/"
+#ifndef MYSQLCONFDIR
+#define MYSQLCONFDIR "/usr/local/etc/msn-proxy"
+#endif
+
/* global - mysql private data */
struct mysql_ mysql;
Modified: trunk/msn-proxy/CMakeLists.txt
===================================================================
--- trunk/msn-proxy/CMakeLists.txt 2012-06-03 18:51:16 UTC (rev 179)
+++ trunk/msn-proxy/CMakeLists.txt 2012-06-03 19:05:14 UTC (rev 180)
@@ -3,10 +3,6 @@
include_directories(${DL_INCLUDE_DIR})
set(LIBS ${LIBS} ${DL_LIBS})
-find_package(LibEvent REQUIRED)
-include_directories(${LibEvent_INCLUDE_DIR})
-set(LIBS ${LIBS} ${LibEvent_LIBS})
-
SET(CMAKE_C_FLAGS "-g -Wall -O2 -pipe -fno-builtin-log")
SET(MSN-PROXY_SRCS
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|