diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f007dbcc..552a6997a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -305,7 +305,7 @@ if(DPKG_PROGRAM) Data files from the original game is required to run it.") SET(CPACK_DEBIAN_PACKAGE_NAME "openmw") SET(CPACK_DEBIAN_PACKAGE_VERSION "${VERSION_STRING}") - SET(CPACK_PACKAGE_EXECUTABLES "openmw;OpenMW esmtool;Esmtool omwlauncher;OMWLauncher") + SET(CPACK_PACKAGE_EXECUTABLES "openmw;OpenMW esmtool;Esmtool omwlauncher;OMWLauncher mwiniimporter;MWiniImporter") SET(CPACK_DEBIAN_PACKAGE_DEPENDS "nvidia-cg-toolkit (>= 2.1), libboost-filesystem1.46.1 (>= 1.46.1), libboost-program-options1.46.1 (>= 1.46.1), libboost-system1.46.1 (>= 1.46.1), libboost-thread1.46.1 (>= 1.46.1), libc6 (>= 2.11.2), libfreetype6 (>= 2.2.1), libgcc1 (>= 1:4.1.1), libmpg123-0 (>= 1.12.1), libois-1.3.0 (>= 1.3.0), libopenal1 (>= 1:1.12.854), libsndfile1 (>= 1.0.23), libstdc++6 (>= 4.4.5), libuuid1 (>= 2.17.2), libqtgui4 (>= 4.7.0)") SET(CPACK_DEBIAN_PACKAGE_SECTION "Games") @@ -391,6 +391,11 @@ if (BUILD_LAUNCHER) add_subdirectory( apps/launcher ) endif() +option(BUILD_MWINIIMPORTER "build MWiniImporter inspector" ON) +if (BUILD_MWINIIMPORTER) + add_subdirectory( apps/mwiniimporter ) +endif() + if (WIN32) if (MSVC) if (USE_DEBUG_CONSOLE) diff --git a/apps/mwiniimporter/CMakeLists.txt b/apps/mwiniimporter/CMakeLists.txt new file mode 100644 index 000000000..1d7b7b624 --- /dev/null +++ b/apps/mwiniimporter/CMakeLists.txt @@ -0,0 +1,21 @@ +set(MWINIIMPORT + main.cpp + importer.cpp +) + +set(MWINIIMPORT_HEADER + main.hpp + importer.hpp +) + +source_group(launcher FILES ${MWINIIMPORT} ${MWINIIMPORT_HEADER}) + +add_executable(mwiniimport + ${MWINIIMPORT} +) + +target_link_libraries(mwiniimport + ${Boost_LIBRARIES} + components +) + diff --git a/apps/mwiniimporter/importer.cpp b/apps/mwiniimporter/importer.cpp new file mode 100644 index 000000000..225b1667c --- /dev/null +++ b/apps/mwiniimporter/importer.cpp @@ -0,0 +1,6 @@ +#include "importer.hpp" + +void MwIniImporter::test() { + +} + diff --git a/apps/mwiniimporter/importer.hpp b/apps/mwiniimporter/importer.hpp new file mode 100644 index 000000000..026ed55bf --- /dev/null +++ b/apps/mwiniimporter/importer.hpp @@ -0,0 +1,17 @@ +#ifndef MWINIIMPORTER_IMPORTER +#define MWINIIMPORTER_IMPORTER 1 + +#include + +class MwIniImporter { + + public: + void test(); + + private: + + +}; + + +#endif diff --git a/apps/mwiniimporter/main.cpp b/apps/mwiniimporter/main.cpp new file mode 100644 index 000000000..46cb37e7f --- /dev/null +++ b/apps/mwiniimporter/main.cpp @@ -0,0 +1,39 @@ +#include "main.hpp" +#include "importer.hpp" + +int main(int argc, char *argv[]) { + + bpo::options_description desc("Syntax: mwiniimporter \nAllowed options"); + desc.add_options() + ("help,h", "produce help message") + ("in,i", bpo::value()->required(), "morrowind.ini input file") + ("out,o", bpo::value()->required(), "openmw.cfg output file") + ; + + bpo::variables_map vm; + try { + bpo::store(boost::program_options::parse_command_line(argc, argv, desc), vm); + bpo::notify(vm); + + } + catch(std::exception& e) { + std::cout << "Error:" << e.what() << std::endl; + return -1; + } + catch(...) { + std::cout << "Error" << std::endl; + return -1; + } + + if(vm.count("help")) { + std::cout << desc; + return 0; + } + + std::cout << "in:" << vm["in"].as() << std::endl; + + MwIniImporter importer; + importer.test(); + + return 0; +} diff --git a/apps/mwiniimporter/main.hpp b/apps/mwiniimporter/main.hpp new file mode 100644 index 000000000..f93de7b07 --- /dev/null +++ b/apps/mwiniimporter/main.hpp @@ -0,0 +1,11 @@ +#ifndef MWINIIMPORTER_MAIN +#define MWINIIMPORTER_MAIN 1 + +#include +#include +#include + +namespace bpo = boost::program_options; + + +#endif