Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

win: Made config, modules, data, and log paths configurable.

Update win/README with instructions on how to use cmake-gui.
Always build m_regex_stdlib, since all VS versions we support
support it.
  • Loading branch information...
commit 6b2d45c154ddbd5ea4381156f5b763c8d0c29e07 1 parent 21f7e4a
@Adam- Adam- authored
View
1  win/.gitignore
@@ -1,2 +1,3 @@
inspircd_version.h
+inspircd_config.h
inspircd.rc
View
17 win/CMakeLists.txt
@@ -2,6 +2,14 @@ cmake_minimum_required(VERSION 2.8)
project(InspIRCd CXX)
+set(CONF_PATH "conf" CACHE PATH "Configuration file path")
+set(MODULE_PATH "modules" CACHE PATH "Module path")
+set(DATA_PATH "data" CACHE PATH "Data path")
+set(LOG_PATH "log" CACHE PATH "Log file path")
+
+set(EXTRA_INCLUDES "" CACHE PATH "Extra include paths")
+set(EXTRA_LIBS "" CACHE PATH "Extra library paths")
+
set(INSPIRCD_BASE "${CMAKE_CURRENT_SOURCE_DIR}/../")
# Use our own NSIS template
@@ -14,12 +22,6 @@ string(REGEX REPLACE ".*InspIRCd-[0-9]*\\.([0-9]*).*" "\\1" MINOR_VERSION "${VER
string(REGEX REPLACE ".*InspIRCd-[0-9]*\\.[0-9]*\\.([0-9]*).*" "\\1" PATCH_VERSION "${VERSIONSH}")
set(FULL_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
-# Write out inspircd_version.h
-file(WRITE "${INSPIRCD_BASE}/win/inspircd_version.h" "#define BRANCH \"${MAJOR_VERSION}.${MINOR_VERSION}\"\n")
-file(APPEND "${INSPIRCD_BASE}/win/inspircd_version.h" "#define VERSION \"${FULL_VERSION}\"\n")
-file(APPEND "${INSPIRCD_BASE}/win/inspircd_version.h" "#define REVISION \"0\"\n")
-file(APPEND "${INSPIRCD_BASE}/win/inspircd_version.h" "#define SYSTEM \"${CMAKE_SYSTEM}\"\n")
-
if(MSVC)
# Without /SAFESEH:NO old libraries compiled with VS 2010 or older won't link correctly to VS2012 (eg, extra module libs)
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /SAFESEH:NO")
@@ -54,6 +56,9 @@ if(MSVC)
endif(MSVC)
configure_file("${INSPIRCD_BASE}/win/inspircd.rc.cmake" "${INSPIRCD_BASE}/win/inspircd.rc")
+configure_file("${INSPIRCD_BASE}/win/inspircd_version.h.cmake" "${INSPIRCD_BASE}/win/inspircd_version.h")
+configure_file("${INSPIRCD_BASE}/win/inspircd_config.h.cmake" "${INSPIRCD_BASE}/win/inspircd_config.h")
+
add_executable(inspircd ${INSPIRCD_SOURCES} "${INSPIRCD_BASE}/win/inspircd.rc")
target_link_libraries(inspircd win32_memory)
set_target_properties(inspircd PROPERTIES ENABLE_EXPORTS ON)
View
11 win/README.txt
@@ -8,9 +8,12 @@ Prerequisites:
Configuring:
First copy any extra modules from extras (such as m_mysql) to the modules directory that you want to build.
- Run CMake to generate build files. The CMake scripts are set up to do an out of source build from the
- "win\build" directory, so navigate there before running CMake, eg:
-
+ Run CMake to generate build files. This can be done using the CMake GUI by setting the source code path to "win",
+ and the binary path to "win/build", followed by pressing "Configure". Modify any variables you need, such as install
+ prefix, and then press "Generate".
+
+ Alternatively CMake can be run from Command Prompt from the "win\build" directory, eg:
+
c:\Users\Adam\Desktop\inspircd\win\build>cmake -G "Visual Studio 11" ..
-- Check for working CXX compiler using: Visual Studio 11
-- Check for working CXX compiler using: Visual Studio 11 -- works
@@ -29,6 +32,8 @@ Configuring:
cmake -DEXTRA_INCLUDES:STRING="C:\inspircd-includes" -DEXTRA_LIBS:STRING="C:\inspircd-libs" -G "Visual Studio 11" ..
+ See the CMake GUI for a full list of variables that can be set.
+
Additionally, place any DLL files required by any extra modules in to the win directory for the installer to pick up.
Building:
View
8 win/inspircd_config.h → win/inspircd_config.h.cmake
@@ -1,10 +1,10 @@
#ifndef INSPIRCD_CONFIG_H
#define INSPIRCD_CONFIG_H
-#define CONFIG_PATH "conf"
-#define MOD_PATH "modules"
-#define DATA_PATH "data"
-#define LOG_PATH "logs"
+#define CONFIG_PATH "@CONF_PATH@"
+#define MOD_PATH "@MODULE_PATH@"
+#define DATA_PATH "@DATA_PATH@"
+#define LOG_PATH "@LOG_PATH@"
#define MAXBUF 514
#include "inspircd_win32wrapper.h"
View
4 win/inspircd_version.h.cmake
@@ -0,0 +1,4 @@
+#define BRANCH "@MAJOR_VERSION@.@MINOR_VERSION@"
+#define VERSION "@FULL_VERSION@"
+#define REVISION "0"
+#define SYSTEM "@CMAKE_SYSTEM@"
View
4 win/modules/CMakeLists.txt
@@ -1,3 +1,7 @@
+# m_regex_stdlib is supported by every version of Visual Studio we support,
+# so copy the file out of extra/
+file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_regex_stdlib.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/")
+
file(GLOB INSPIRCD_MODULES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${INSPIRCD_BASE}/src/commands/*.cpp" "${INSPIRCD_BASE}/src/modules/*.cpp")
list(SORT INSPIRCD_MODULES)
Please sign in to comment.
Something went wrong with that request. Please try again.