From 17a7b2addbebc2ac8d19b897e195014830b87431 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Sun, 26 Apr 2015 20:08:27 +0300 Subject: [PATCH] Updated more variables. --- CMakeLists.txt | 39 ++++++++++--------- client/CMakeLists.txt | 2 +- cmake/install_layout.cmake | 31 ++++++--------- log_manager/CMakeLists.txt | 2 +- plugins/CMakeLists.txt | 10 ++--- query_classifier/CMakeLists.txt | 2 +- server/core/CMakeLists.txt | 6 +-- server/core/gateway.c | 30 +++++++------- server/core/load_utils.c | 4 +- server/core/service.c | 2 +- server/include/gw.h | 4 +- server/modules/filter/CMakeLists.txt | 20 +++++----- server/modules/filter/hint/CMakeLists.txt | 4 +- server/modules/monitor/CMakeLists.txt | 8 ++-- server/modules/protocol/CMakeLists.txt | 12 +++--- server/modules/routing/CMakeLists.txt | 12 +++--- server/modules/routing/binlog/CMakeLists.txt | 4 +- server/modules/routing/maxinfo/CMakeLists.txt | 4 +- .../routing/readwritesplit/CMakeLists.txt | 2 +- 19 files changed, 95 insertions(+), 103 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 78d205936..ba669131c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,23 +6,24 @@ endif() message(STATUS "CMake version: ${CMAKE_VERSION}") + include(${CMAKE_SOURCE_DIR}/cmake/macros.cmake) + +# Set the installation layout +set(INSTALL_LAYOUT "STANDALONE" CACHE STRING "Install layout, options are: STANDALONE, RPM, DEB") include(${CMAKE_SOURCE_DIR}/cmake/install_layout.cmake) + enable_testing() set_variables() set_maxscale_version() - -set(INSTALL_LAYOUT "STANDALONE" CACHE STRING "Install layout, options are: STANDALONE, RPM, DEB") -set_install_layout(${INSTALL_LAYOUT}) - set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") project(MaxScale) -#Disabled for now pending evaluation +#Do the platform check include(cmake/CheckPlatform.cmake) check_deps() @@ -40,7 +41,7 @@ if(NOT CURL_FOUND) message(FATAL_ERROR "Failed to locate dependency: libcurl") endif() -set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_MODULE_DIR}:${MAXSCALE_LIBRARY_DIR}) +set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${CMAKE_INSTALL_PREFIX}/${MAXSCALE_LIBDIR}) # Make sure the release notes for this release are present if it is a stable one if(${MAXSCALE_VERSION} MATCHES "-stable") @@ -143,15 +144,15 @@ ${CMAKE_SOURCE_DIR}/Documentation/Upgrading-To-MaxScale-1.1.0.md ${CMAKE_BINARY_DIR}/UpgradingToMaxScale110.txt) -install(FILES ${CMAKE_BINARY_DIR}/Changelog.txt DESTINATION ${MAXSCALE_SHARE_DIR}) -install(FILES ${CMAKE_BINARY_DIR}/ReleaseNotes.txt DESTINATION ${MAXSCALE_SHARE_DIR}) -install(FILES ${CMAKE_BINARY_DIR}/UpgradingToMaxScale110.txt DESTINATION ${MAXSCALE_SHARE_DIR}) -install(FILES server/MaxScale_template.cnf DESTINATION ${MAXSCALE_CONFIG_DIR}) -install(FILES server/MaxScale_BinlogServer_template.cnf DESTINATION ${MAXSCALE_CONFIG_DIR}) -install(FILES ${ERRMSG} DESTINATION ${MAXSCALE_SHARE_DIR}) -install(FILES ${CMAKE_SOURCE_DIR}/COPYRIGHT DESTINATION ${MAXSCALE_SHARE_DIR}) -install(FILES ${CMAKE_SOURCE_DIR}/README DESTINATION ${MAXSCALE_SHARE_DIR}) -install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION ${MAXSCALE_SHARE_DIR}) +install(FILES ${CMAKE_BINARY_DIR}/Changelog.txt DESTINATION ${MAXSCALE_SHAREDIR}) +install(FILES ${CMAKE_BINARY_DIR}/ReleaseNotes.txt DESTINATION ${MAXSCALE_SHAREDIR}) +install(FILES ${CMAKE_BINARY_DIR}/UpgradingToMaxScale110.txt DESTINATION ${MAXSCALE_SHAREDIR}) +install(FILES server/MaxScale_template.cnf DESTINATION ${MAXSCALE_SHAREDIR}) +install(FILES server/MaxScale_BinlogServer_template.cnf DESTINATION ${MAXSCALE_SHAREDIR}) +install(FILES ${ERRMSG} DESTINATION ${MAXSCALE_SHAREDIR}) +install(FILES ${CMAKE_SOURCE_DIR}/COPYRIGHT DESTINATION ${MAXSCALE_SHAREDIR}) +install(FILES ${CMAKE_SOURCE_DIR}/README DESTINATION ${MAXSCALE_SHAREDIR}) +install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION ${MAXSCALE_SHAREDIR}) # Install startup scripts and ldconfig files if(WITH_SCRIPTS) @@ -176,13 +177,13 @@ endif() if(PACKAGE) # Install the files copied by the postinst script into the share folder - install(FILES ${CMAKE_BINARY_DIR}/maxscale DESTINATION ${MAXSCALE_SHARE_DIR} + install(FILES ${CMAKE_BINARY_DIR}/maxscale DESTINATION ${MAXSCALE_SHAREDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - install(FILES ${CMAKE_BINARY_DIR}/maxscale.conf DESTINATION ${MAXSCALE_SHARE_DIR} + install(FILES ${CMAKE_BINARY_DIR}/maxscale.conf DESTINATION ${MAXSCALE_SHAREDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - install(FILES ${CMAKE_BINARY_DIR}/postinst DESTINATION ${MAXSCALE_SHARE_DIR} + install(FILES ${CMAKE_BINARY_DIR}/postinst DESTINATION ${MAXSCALE_SHAREDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - install(FILES ${CMAKE_BINARY_DIR}/postrm DESTINATION ${MAXSCALE_SHARE_DIR} + install(FILES ${CMAKE_BINARY_DIR}/postrm DESTINATION ${MAXSCALE_SHAREDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) if(${CMAKE_VERSION} VERSION_LESS 2.8.12) message(WARNING "CMake version is ${CMAKE_VERSION}. Building of packages requires version 2.8.12 or greater.") diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 9b679aae0..32ab702ea 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -7,4 +7,4 @@ if(HIST) else() message(STATUS "Could not find editline library. MaxAdmin will be built without it.") endif() -install(TARGETS maxadmin DESTINATION ${MAXSCALE_EXECUTABLE_INSTALL}) +install(TARGETS maxadmin DESTINATION ${MAXSCALE_BINDIR}) diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake index 0d594188f..821b2c474 100644 --- a/cmake/install_layout.cmake +++ b/cmake/install_layout.cmake @@ -3,27 +3,18 @@ # STANDALONE - Installs to /usr/local/mariadb-maxscale # RPM - Installs to /usr # DEB - Installs to /usr -function(set_install_layout TYPE) +if(${TYPE} MATCHES "STANDALONE") - if(${TYPE} MATCHES "STANDALONE") + set(CMAKE_INSTALL_PREFIX "/usr/local/mariadb-maxscale" CACHE PATH "Prefix prepended to install directories.") - set(CMAKE_INSTALL_PREFIX "/usr/local/mariadb-maxscale" CACHE PATH "Prefix prepended to install directories.") + # RPM and DEB are the same until differences are found +else() + set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Prefix prepended to install directories.") +endif() -# RPM and DEB are the same until differences are found - elseif(${TYPE} MATCHES "RPM") +set(MAXSCALE_LIBDIR lib64/maxscale CACHE PATH "Library installation path") +set(MAXSCALE_BINDIR bin CACHE PATH "Executable installation path") +set(MAXSCALE_SHAREDIR share/maxscale CACHE PATH "Share file installation path, includes licence and readme files") +set(MAXSCALE_DOCDIR share/doc/maxscale CACHE PATH "Documentation installation path, text versions only") +set(MAXSCALE_CONFDIR etc CACHE PATH "Configuration file installation path, this is not usually needed") - set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Prefix prepended to install directories.") - - elseif(${TYPE} MATCHES "DEB") - - set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Prefix prepended to install directories.") - - endif() - - set(MAXSCALE_MODULE_INSTALL lib64/maxscale CACHE PATH "Module installation path") - set(MAXSCALE_LIBRARY_INSTALL lib64/maxscale CACHE PATH "Library installation path") - set(MAXSCALE_EXECUTABLE_INSTALL bin CACHE PATH "Executable installation path") - set(MAXSCALE_SHARE_DIR share/maxscale CACHE PATH "Share file installation path, includes licence and readme files") - set(MAXSCALE_DOC_DIR ${MAXSCALE_SHARE_DIR}/doc CACHE PATH "Documentation installation path, text versions only") - set(MAXSCALE_CONFIG_DIR ${MAXSCALE_SHARE_DIR}/etc CACHE PATH "Configuration file installation path, example configurations will be placed here") -endfunction() diff --git a/log_manager/CMakeLists.txt b/log_manager/CMakeLists.txt index 607341d9a..3dfd883de 100644 --- a/log_manager/CMakeLists.txt +++ b/log_manager/CMakeLists.txt @@ -3,7 +3,7 @@ if(LOG_DEBUG) endif() add_library(log_manager SHARED log_manager.cc) target_link_libraries(log_manager pthread aio stdc++) -install(TARGETS log_manager DESTINATION ${MAXSCALE_LIBRARY_INSTALL}) +install(TARGETS log_manager DESTINATION ${MAXSCALE_LIBDIR}) if(BUILD_TESTS) add_subdirectory(test) endif() diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 1936ebe84..fc18cc602 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -1,5 +1,5 @@ -install(FILES nagios/check_maxscale_monitors.pl DESTINATION ${MAXSCALE_SHARE_DIR}/plugins/nagios) -install(FILES nagios/check_maxscale_resources.pl DESTINATION ${MAXSCALE_SHARE_DIR}/plugins/nagios) -install(FILES nagios/check_maxscale_threads.pl DESTINATION ${MAXSCALE_SHARE_DIR}/plugins/nagios) -install(FILES nagios/maxscale_commands.cfg DESTINATION ${MAXSCALE_SHARE_DIR}/plugins/nagios) -install(FILES nagios/server1.cfg DESTINATION ${MAXSCALE_SHARE_DIR}/plugins/nagios) +install(FILES nagios/check_maxscale_monitors.pl DESTINATION ${MAXSCALE_SHAREDIR}/plugins/nagios) +install(FILES nagios/check_maxscale_resources.pl DESTINATION ${MAXSCALE_SHAREDIR}/plugins/nagios) +install(FILES nagios/check_maxscale_threads.pl DESTINATION ${MAXSCALE_SHAREDIR}/plugins/nagios) +install(FILES nagios/maxscale_commands.cfg DESTINATION ${MAXSCALE_SHAREDIR}/plugins/nagios) +install(FILES nagios/server1.cfg DESTINATION ${MAXSCALE_SHAREDIR}/plugins/nagios) diff --git a/query_classifier/CMakeLists.txt b/query_classifier/CMakeLists.txt index 7fb36d6c6..19820ccdd 100644 --- a/query_classifier/CMakeLists.txt +++ b/query_classifier/CMakeLists.txt @@ -1,5 +1,5 @@ add_library(query_classifier SHARED query_classifier.cc) -install(TARGETS query_classifier COMPONENT lib DESTINATION ${MAXSCALE_LIBRARY_INSTALL}) +install(TARGETS query_classifier COMPONENT lib DESTINATION ${MAXSCALE_LIBDIR}) if(BUILD_TESTS) add_subdirectory(test) endif() diff --git a/server/core/CMakeLists.txt b/server/core/CMakeLists.txt index ee01396d8..ead8560d3 100644 --- a/server/core/CMakeLists.txt +++ b/server/core/CMakeLists.txt @@ -18,15 +18,15 @@ if(WITH_TCMALLOC) endif() target_link_libraries(maxscale ${EMBEDDED_LIB} ${PCRE_LINK_FLAGS} ${CURL_LIBRARIES} log_manager utils ssl aio pthread crypt dl crypto inih z rt m stdc++) -install(TARGETS maxscale DESTINATION ${MAXSCALE_EXECUTABLE_INSTALL}) +install(TARGETS maxscale DESTINATION ${MAXSCALE_BINDIR}) add_executable(maxkeys maxkeys.c secrets.c utils.c) target_link_libraries(maxkeys log_manager utils pthread crypt crypto) -install(TARGETS maxkeys DESTINATION ${MAXSCALE_EXECUTABLE_INSTALL}) +install(TARGETS maxkeys DESTINATION ${MAXSCALE_BINDIR}) add_executable(maxpasswd maxpasswd.c secrets.c utils.c) target_link_libraries(maxpasswd log_manager utils pthread crypt crypto) -install(TARGETS maxpasswd DESTINATION ${MAXSCALE_EXECUTABLE_INSTALL}) +install(TARGETS maxpasswd DESTINATION ${MAXSCALE_BINDIR}) if(BUILD_TESTS) add_subdirectory(test) diff --git a/server/core/gateway.c b/server/core/gateway.c index 6b55b2661..a4901ec23 100644 --- a/server/core/gateway.c +++ b/server/core/gateway.c @@ -131,7 +131,7 @@ static char pidfile[PATH_MAX+1] = ""; static char* configdir = NULL; static char* logdir = NULL; -static char* moduledir = NULL; +static char* libdir = NULL; static char* cachedir = NULL; static char* langdir = NULL; /** @@ -158,7 +158,7 @@ static struct option long_options[] = { {"logdir", required_argument, 0, 'L'}, {"datadir", required_argument, 0, 'D'}, {"configdir",required_argument, 0, 'C'}, - {"moduledir",required_argument, 0, 'B'}, + {"libdir",required_argument, 0, 'B'}, {"cachedir",required_argument, 0, 'A'}, {"language",required_argument, 0, 'N'}, {"syslog", required_argument, 0, 's'}, @@ -204,9 +204,9 @@ static char* check_dir_access(char* dirname,bool,bool); * Get the directory with all the modules. * @return The module directory */ -char* get_moduledir() +char* get_libdir() { - return moduledir; + return libdir; } /** * Handler for SIGHUP signal. Reload the configuration for the @@ -1029,7 +1029,7 @@ static void usage(void) " (default: /var/lib/maxscale)\n" " -C|--configdir=... path to configuration file directory\n" " (default: /etc/)\n" - " -B|--moduledir=... path to module directory\n" + " -B|--libdir=... path to module directory\n" " (default: /var/lib/maxscale)\n" " -A|--cachedir=... path to cache directory\n" " (default: /var/cache/maxscale)\n" @@ -1274,7 +1274,7 @@ int main(int argc, char **argv) case 'B': if(handle_path_arg(&tmp_path,optarg,NULL,true,false)) { - moduledir = tmp_path; + libdir = tmp_path; } break; case 'A': @@ -1742,8 +1742,8 @@ int main(int argc, char **argv) cachedir = strdup(default_cachedir); if(langdir == NULL) langdir = strdup(default_langdir); - if(moduledir == NULL) - moduledir = strdup(default_moduledir); + if(libdir == NULL) + libdir = strdup(default_libdir); /** * Set a data directory for the mysqld library, we use * a unique directory name to avoid clauses if multiple @@ -1785,7 +1785,7 @@ int main(int argc, char **argv) cnf_file_path, logdir, datadir, - moduledir, + libdir, cachedir); } @@ -1807,7 +1807,7 @@ int main(int argc, char **argv) LOGIF(LM, (skygw_log_write_flush(LOGFILE_MESSAGE, "Module directory: %s", - moduledir))); + libdir))); LOGIF(LM, (skygw_log_write_flush(LOGFILE_MESSAGE, "Service cache: %s", @@ -1882,8 +1882,8 @@ int main(int argc, char **argv) } libmysqld_started = TRUE; - if(moduledir == NULL) - moduledir = strdup(default_moduledir); + if(libdir == NULL) + libdir = strdup(default_libdir); if (!config_load(cnf_file_path)) { @@ -2179,10 +2179,10 @@ static int cnf_preparser(void* data, const char* section, const char* name, cons if(logdir == NULL) handle_path_arg(&logdir,(char*)value,NULL,true,true); } - else if(strcmp(name, "moduledir") == 0) + else if(strcmp(name, "libdir") == 0) { - if(moduledir == NULL) - handle_path_arg(&moduledir,(char*)value,NULL,true,false); + if(libdir == NULL) + handle_path_arg(&libdir,(char*)value,NULL,true,false); } else if(strcmp(name, "datadir") == 0) { diff --git a/server/core/load_utils.c b/server/core/load_utils.c index c1ae57a3e..9451f6838 100644 --- a/server/core/load_utils.c +++ b/server/core/load_utils.c @@ -147,7 +147,7 @@ MODULE_INFO *mod_info = NULL; if (access(fname, F_OK) == -1) { - snprintf(fname, MAXPATHLEN+1,"%s/lib%s.so", get_moduledir(), module); + snprintf(fname, MAXPATHLEN+1,"%s/lib%s.so", get_libdir(), module); if (access(fname, F_OK) == -1) { @@ -155,7 +155,7 @@ MODULE_INFO *mod_info = NULL; LOGFILE_ERROR, "Error : Unable to find library for " "module: %s. Module dir: %s", - module, get_moduledir()))); + module, get_libdir()))); return NULL; } } diff --git a/server/core/service.c b/server/core/service.c index 9455921b7..bd22117ec 100644 --- a/server/core/service.c +++ b/server/core/service.c @@ -113,7 +113,7 @@ SERVICE *service; return NULL; if ((service->router = load_module(router, MODULE_ROUTER)) == NULL) { - char* home = get_moduledir(); + char* home = get_libdir(); char* ldpath = getenv("LD_LIBRARY_PATH"); LOGIF(LE, (skygw_log_write_flush( diff --git a/server/include/gw.h b/server/include/gw.h index 64db00204..e210fcfa2 100644 --- a/server/include/gw.h +++ b/server/include/gw.h @@ -25,7 +25,7 @@ static const char* default_cnf_fname = "MaxScale.cnf"; static const char* default_configdir = "/etc/"; static const char* default_logdir = "/var/log/maxscale/"; static const char* default_datadir = "/var/cache/maxscale/"; -static const char* default_moduledir = "/lib64/maxscale/"; +static const char* default_libdir = "/lib64/maxscale/"; static const char* default_cachedir = "/var/cache/maxscale/"; static const char* default_langdir = "/usr/share/mysql/english/"; /*< This is where the MariaDB * server installs errmsg.sys */ @@ -77,5 +77,5 @@ int gw_write(DCB *dcb, const void *buf, size_t nbytes); int gw_getsockerrno(int fd); int parse_bindconfig(char *, unsigned short, struct sockaddr_in *); int setipaddress(struct in_addr *, char *); -char* get_moduledir(); +char* get_libdir(); #endif diff --git a/server/modules/filter/CMakeLists.txt b/server/modules/filter/CMakeLists.txt index 77ebc7d0c..6bf6a5daa 100644 --- a/server/modules/filter/CMakeLists.txt +++ b/server/modules/filter/CMakeLists.txt @@ -3,48 +3,48 @@ if(BUILD_RABBITMQ) include_directories(${RABBITMQ_HEADERS}) add_library(mqfilter SHARED mqfilter.c) target_link_libraries(mqfilter query_classifier log_manager utils ${RABBITMQ_LIBRARIES}) - install(TARGETS mqfilter DESTINATION ${MAXSCALE_MODULE_INSTALL}) + install(TARGETS mqfilter DESTINATION ${MAXSCALE_LIBDIR}) endif() add_library(regexfilter SHARED regexfilter.c) target_link_libraries(regexfilter log_manager utils) -install(TARGETS regexfilter DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS regexfilter DESTINATION ${MAXSCALE_LIBDIR}) add_library(testfilter SHARED testfilter.c) target_link_libraries(testfilter log_manager utils) -install(TARGETS testfilter DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS testfilter DESTINATION ${MAXSCALE_LIBDIR}) add_library(qlafilter SHARED qlafilter.c) target_link_libraries(qlafilter log_manager utils) -install(TARGETS qlafilter DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS qlafilter DESTINATION ${MAXSCALE_LIBDIR}) add_library(tee SHARED tee.c) target_link_libraries(tee log_manager utils) -install(TARGETS tee DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS tee DESTINATION ${MAXSCALE_LIBDIR}) add_library(topfilter SHARED topfilter.c) target_link_libraries(topfilter log_manager utils) -install(TARGETS topfilter DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS topfilter DESTINATION ${MAXSCALE_LIBDIR}) add_library(dbfwfilter SHARED dbfwfilter.c) target_link_libraries(dbfwfilter log_manager utils query_classifier) -install(TARGETS dbfwfilter DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS dbfwfilter DESTINATION ${MAXSCALE_LIBDIR}) add_library(namedserverfilter SHARED namedserverfilter.c) target_link_libraries(namedserverfilter log_manager utils) -install(TARGETS namedserverfilter DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS namedserverfilter DESTINATION ${MAXSCALE_LIBDIR}) if(BUILD_SLAVELAG) add_library(slavelag SHARED slavelag.c) target_link_libraries(slavelag log_manager utils query_classifier) - install(TARGETS slavelag DESTINATION ${MAXSCALE_MODULE_INSTALL}) + install(TARGETS slavelag DESTINATION ${MAXSCALE_LIBDIR}) endif() if(BUILD_TOOLS) add_executable(ruleparser dbfwfilter.c) target_compile_definitions(ruleparser PUBLIC "BUILD_RULE_PARSER") target_link_libraries(ruleparser ${EMBEDDED_LIB} log_manager utils query_classifier fullcore) - install(TARGETS ruleparser DESTINATION tools) + install(TARGETS ruleparser DESTINATION ${MAXSCALE_BINDIR}) endif() add_subdirectory(hint) diff --git a/server/modules/filter/hint/CMakeLists.txt b/server/modules/filter/hint/CMakeLists.txt index ecc3cbb85..c2d5e9ea1 100644 --- a/server/modules/filter/hint/CMakeLists.txt +++ b/server/modules/filter/hint/CMakeLists.txt @@ -1,4 +1,4 @@ add_library(hintfilter SHARED hintfilter.c hintparser.c) -set_target_properties(hintfilter PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${CMAKE_INSTALL_PREFIX}/lib) +set_target_properties(hintfilter PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_LIBDIR}) target_link_libraries(hintfilter ssl log_manager utils) -install(TARGETS hintfilter DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS hintfilter DESTINATION ${MAXSCALE_LIBDIR}) diff --git a/server/modules/monitor/CMakeLists.txt b/server/modules/monitor/CMakeLists.txt index 74a6f2870..b4d641934 100644 --- a/server/modules/monitor/CMakeLists.txt +++ b/server/modules/monitor/CMakeLists.txt @@ -1,16 +1,16 @@ add_library(mysqlmon SHARED mysql_mon.c) target_link_libraries(mysqlmon log_manager utils) -install(TARGETS mysqlmon DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS mysqlmon DESTINATION ${MAXSCALE_LIBDIR}) add_library(galeramon SHARED galera_mon.c) target_link_libraries(galeramon log_manager utils) -install(TARGETS galeramon DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS galeramon DESTINATION ${MAXSCALE_LIBDIR}) add_library(ndbclustermon SHARED ndbcluster_mon.c) target_link_libraries(ndbclustermon log_manager utils) -install(TARGETS ndbclustermon DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS ndbclustermon DESTINATION ${MAXSCALE_LIBDIR}) if(BUILD_MMMON) add_library(mmmon SHARED mm_mon.c) target_link_libraries(mmmon log_manager utils) - install(TARGETS mmmon DESTINATION ${MAXSCALE_MODULE_INSTALL}) + install(TARGETS mmmon DESTINATION ${MAXSCALE_LIBDIR}) endif() diff --git a/server/modules/protocol/CMakeLists.txt b/server/modules/protocol/CMakeLists.txt index 488f2e4b6..4ae3b8f2c 100644 --- a/server/modules/protocol/CMakeLists.txt +++ b/server/modules/protocol/CMakeLists.txt @@ -1,27 +1,27 @@ add_library(MySQLClient SHARED mysql_client.c mysql_common.c) target_link_libraries(MySQLClient log_manager utils) -install(TARGETS MySQLClient DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS MySQLClient DESTINATION ${MAXSCALE_LIBDIR}) add_library(MySQLBackend SHARED mysql_backend.c mysql_common.c) target_link_libraries(MySQLBackend log_manager utils) -install(TARGETS MySQLBackend DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS MySQLBackend DESTINATION ${MAXSCALE_LIBDIR}) add_library(telnetd SHARED telnetd.c) target_link_libraries(telnetd log_manager utils) -install(TARGETS telnetd DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS telnetd DESTINATION ${MAXSCALE_LIBDIR}) add_library(HTTPD SHARED httpd.c) target_link_libraries(HTTPD log_manager utils) -install(TARGETS HTTPD DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS HTTPD DESTINATION ${MAXSCALE_LIBDIR}) if(BUILD_TESTS) add_library(testprotocol SHARED testprotocol.c) - install(TARGETS testprotocol DESTINATION ${MAXSCALE_MODULE_INSTALL}) + install(TARGETS testprotocol DESTINATION ${MAXSCALE_LIBDIR}) endif() add_library(maxscaled SHARED maxscaled.c) target_link_libraries(maxscaled log_manager utils) -install(TARGETS maxscaled DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS maxscaled DESTINATION ${MAXSCALE_LIBDIR}) diff --git a/server/modules/routing/CMakeLists.txt b/server/modules/routing/CMakeLists.txt index b73edfa8c..2933e5ec8 100644 --- a/server/modules/routing/CMakeLists.txt +++ b/server/modules/routing/CMakeLists.txt @@ -2,28 +2,28 @@ if(BUILD_TESTS) add_subdirectory(test) add_library(testroute SHARED testroute.c) target_link_libraries(testroute log_manager utils) - install(TARGETS testroute DESTINATION ${MAXSCALE_MODULE_INSTALL}) + install(TARGETS testroute DESTINATION ${MAXSCALE_LIBDIR}) endif() add_library(schemarouter SHARED schemarouter/schemarouter.c) target_link_libraries(schemarouter log_manager utils query_classifier) -install(TARGETS schemarouter DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS schemarouter DESTINATION ${MAXSCALE_LIBDIR}) add_library(shardrouter SHARED schemarouter/shardrouter.c) target_link_libraries(shardrouter log_manager utils query_classifier) -install(TARGETS shardrouter DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS shardrouter DESTINATION ${MAXSCALE_LIBDIR}) add_library(readconnroute SHARED readconnroute.c) target_link_libraries(readconnroute log_manager utils) -install(TARGETS readconnroute DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS readconnroute DESTINATION ${MAXSCALE_LIBDIR}) add_library(debugcli SHARED debugcli.c debugcmd.c) target_link_libraries(debugcli log_manager utils) -install(TARGETS debugcli DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS debugcli DESTINATION ${MAXSCALE_LIBDIR}) add_library(cli SHARED cli.c debugcmd.c) target_link_libraries(cli log_manager utils) -install(TARGETS cli DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS cli DESTINATION ${MAXSCALE_LIBDIR}) add_subdirectory(readwritesplit) add_subdirectory(schemarouter/test) diff --git a/server/modules/routing/binlog/CMakeLists.txt b/server/modules/routing/binlog/CMakeLists.txt index 9fcd8536e..9a0c245de 100644 --- a/server/modules/routing/binlog/CMakeLists.txt +++ b/server/modules/routing/binlog/CMakeLists.txt @@ -1,4 +1,4 @@ add_library(binlogrouter SHARED blr.c blr_master.c blr_cache.c blr_slave.c blr_file.c) -set_target_properties(binlogrouter PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_MODULE_INSTALL}:${MAXSCALE_LIBRARY_INSTALL}) +set_target_properties(binlogrouter PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_LIBDIR}) target_link_libraries(binlogrouter ssl pthread log_manager) -install(TARGETS binlogrouter DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS binlogrouter DESTINATION ${MAXSCALE_LIBDIR}) diff --git a/server/modules/routing/maxinfo/CMakeLists.txt b/server/modules/routing/maxinfo/CMakeLists.txt index 2585f2a2a..8e07a34a7 100644 --- a/server/modules/routing/maxinfo/CMakeLists.txt +++ b/server/modules/routing/maxinfo/CMakeLists.txt @@ -1,4 +1,4 @@ add_library(maxinfo SHARED maxinfo.c maxinfo_parse.c maxinfo_error.c maxinfo_exec.c) -set_target_properties(maxinfo PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_MODULE_INSTALL}:MAXSCALE_LIBRARY_INSTALL) +set_target_properties(maxinfo PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_LIBDIR}) target_link_libraries(maxinfo pthread log_manager) -install(TARGETS maxinfo DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS maxinfo DESTINATION ${MAXSCALE_LIBDIR}) diff --git a/server/modules/routing/readwritesplit/CMakeLists.txt b/server/modules/routing/readwritesplit/CMakeLists.txt index fe56582dc..c7e387290 100644 --- a/server/modules/routing/readwritesplit/CMakeLists.txt +++ b/server/modules/routing/readwritesplit/CMakeLists.txt @@ -1,6 +1,6 @@ add_library(readwritesplit SHARED readwritesplit.c) target_link_libraries(readwritesplit ssl pthread log_manager utils query_classifier) -install(TARGETS readwritesplit DESTINATION ${MAXSCALE_MODULE_INSTALL}) +install(TARGETS readwritesplit DESTINATION ${MAXSCALE_LIBDIR}) if(BUILD_TESTS) add_subdirectory(test) endif()