diff --git a/CMakeLists.txt b/CMakeLists.txt index 053ea5b..d4241cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,9 +12,11 @@ cmake_minimum_required(VERSION 2.8) project(stationapi CXX) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin") include(GroupSourceByFilesystem) include(ModernCpp) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) if (EXISTS "${PROJECT_SOURCE_DIR}/externals/udplibrary/CMakeLists.txt") @@ -39,5 +41,6 @@ add_subdirectory(externals) add_subdirectory(src) add_subdirectory(tests) -configure_file(extras/logger.cfg.dist src/stationchat/logger.cfg COPYONLY) -configure_file(extras/swgchat.cfg.dist src/stationchat/swgchat.cfg COPYONLY) +configure_file(extras/logger.cfg.dist bin/logger.cfg COPYONLY) +configure_file(extras/swgchat.cfg.dist bin/swgchat.cfg COPYONLY) +configure_file(extras/chat.db.dist bin/chat.db COPYONLY) diff --git a/README.md b/README.md index b3c8afc..0c69a1e 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,29 @@ Copy the udplibrary directory from the Star Wars Galaxies offical source to the ## Database Initialization ## -Create the database with the following commands: +By default, a clean database instance is provided and placed with the default configuration files in the **build/bin** directory; therefore, nothing needs to be done for new installations, the db is already created and placed in the appropriate location. + +To create a new, clean database instance, use the following commands: sqlite3 chat.db - sqlite> .read /path/to/init_database.sql + sqlite> .read /path/to/extras/init_database.sql Then update the **database_path** config option with the full path to the database. + +## Running ## + +A default configuration and database is created when building the project. Configure the listen address/ports in **build/bin/stationchat.cfg**. Then run the following commands from the project root: + +### Windows ### + + cd build/bin + .\Debug\stationchat.exe + +### Linux ### + + cd build/bin + ./stationchat + +## Final Notes ## + +It is recommended to copy the **build/bin** directory to another location after building to ensure the configuration files are not overwritten by future changes to the default versions of these files. diff --git a/extras/chat.db.dist b/extras/chat.db.dist new file mode 100644 index 0000000..28dd84c Binary files /dev/null and b/extras/chat.db.dist differ