Update win/README with instructions on how to use cmake-gui.
Always build m_regex_stdlib, since all VS versions we support
support it.
inspircd_version.h\r
+inspircd_config.h\r
inspircd.rc\r
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
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")
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)
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
\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
+++ /dev/null
-#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
--- /dev/null
+#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
--- /dev/null
+#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
+# 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