]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
win: Made config, modules, data, and log paths configurable.
authorAdam <Adam@anope.org>
Sun, 24 Mar 2013 03:47:25 +0000 (22:47 -0500)
committerAdam <Adam@anope.org>
Sun, 24 Mar 2013 03:47:25 +0000 (22:47 -0500)
Update win/README with instructions on how to use cmake-gui.
Always build m_regex_stdlib, since all VS versions we support
support it.

win/.gitignore
win/CMakeLists.txt
win/README.txt
win/inspircd_config.h [deleted file]
win/inspircd_config.h.cmake [new file with mode: 0644]
win/inspircd_version.h.cmake [new file with mode: 0644]
win/modules/CMakeLists.txt

index a49a10efab636929afb9fa0ff48fe612302407f3..f53ca0701fdc963b535f866175d9cceeea720fd6 100644 (file)
@@ -1,2 +1,3 @@
 inspircd_version.h\r
+inspircd_config.h\r
 inspircd.rc\r
index 83d6dddb5686a98aaf0b783788c7329c1defa64e..f26b9a6c7cbfd9f90fc8f411a0599e139e2e0fb9 100644 (file)
@@ -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)
index 24f4fd7e683d00a193f26e3b3b63a5506f55a000..908cd39202595be1a6b7aa29b1672ef1fd9bde98 100644 (file)
@@ -8,9 +8,12 @@ Prerequisites:
 Configuring:\r
        First copy any extra modules from extras (such as m_mysql) to the modules directory that you want to build.\r
 \r
-       Run CMake to generate build files. The CMake scripts are set up to do an out of source build from the\r
-       "win\build" directory, so navigate there before running CMake, eg:\r
-\r
+       Run CMake to generate build files. This can be done using the CMake GUI by setting the source code path to "win",\r
+       and the binary path to "win/build", followed by pressing "Configure". Modify any variables you need, such as install\r
+       prefix, and then press "Generate".\r
+       \r
+       Alternatively CMake can be run from Command Prompt from the "win\build" directory, eg:\r
+       \r
        c:\Users\Adam\Desktop\inspircd\win\build>cmake -G "Visual Studio 11" ..\r
        -- Check for working CXX compiler using: Visual Studio 11\r
        -- Check for working CXX compiler using: Visual Studio 11 -- works\r
@@ -29,6 +32,8 @@ Configuring:
        \r
        cmake -DEXTRA_INCLUDES:STRING="C:\inspircd-includes" -DEXTRA_LIBS:STRING="C:\inspircd-libs" -G "Visual Studio 11" ..\r
        \r
+       See the CMake GUI for a full list of variables that can be set.\r
+       \r
        Additionally, place any DLL files required by any extra modules in to the win directory for the installer to pick up.\r
 \r
 Building:\r
diff --git a/win/inspircd_config.h b/win/inspircd_config.h
deleted file mode 100644 (file)
index 168eeb7..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef INSPIRCD_CONFIG_H\r
-#define INSPIRCD_CONFIG_H\r
-\r
-#define CONFIG_PATH "conf"\r
-#define MOD_PATH "modules"\r
-#define DATA_PATH "data"\r
-#define LOG_PATH "logs"\r
-#define MAXBUF 514\r
-\r
-#include "inspircd_win32wrapper.h"\r
-#include "threadengines/threadengine_win32.h"\r
-\r
-#endif
\ No newline at end of file
diff --git a/win/inspircd_config.h.cmake b/win/inspircd_config.h.cmake
new file mode 100644 (file)
index 0000000..f98cd39
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef INSPIRCD_CONFIG_H\r
+#define INSPIRCD_CONFIG_H\r
+\r
+#define CONFIG_PATH "@CONF_PATH@"\r
+#define MOD_PATH "@MODULE_PATH@"\r
+#define DATA_PATH "@DATA_PATH@"\r
+#define LOG_PATH "@LOG_PATH@"\r
+#define MAXBUF 514\r
+\r
+#include "inspircd_win32wrapper.h"\r
+#include "threadengines/threadengine_win32.h"\r
+\r
+#endif
\ No newline at end of file
diff --git a/win/inspircd_version.h.cmake b/win/inspircd_version.h.cmake
new file mode 100644 (file)
index 0000000..1aec12b
--- /dev/null
@@ -0,0 +1,4 @@
+#define BRANCH "@MAJOR_VERSION@.@MINOR_VERSION@"\r
+#define VERSION "@FULL_VERSION@"\r
+#define REVISION "0"\r
+#define SYSTEM "@CMAKE_SYSTEM@"
\ No newline at end of file
index 70ab6d1068d63d2cb2d3afbc19595ab2b6b16b3d..5778d944adda691fd572bf0c8cb4c0d28b648f50 100644 (file)
@@ -1,3 +1,7 @@
+# m_regex_stdlib is supported by every version of Visual Studio we support,\r
+# so copy the file out of extra/\r
+file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_regex_stdlib.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/")\r
+\r
 file(GLOB INSPIRCD_MODULES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${INSPIRCD_BASE}/src/commands/*.cpp" "${INSPIRCD_BASE}/src/modules/*.cpp")\r
 list(SORT INSPIRCD_MODULES)\r
 \r