diff --git a/CMake/Modules/CMakeVS10FindMake.cmake b/CMake/Modules/CMakeVS10FindMake.cmake new file mode 100644 index 000000000..460de25e5 --- /dev/null +++ b/CMake/Modules/CMakeVS10FindMake.cmake @@ -0,0 +1,28 @@ + +#============================================================================= +# Copyright 2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distributed this file outside of CMake, substitute the full +# License text for the above reference.) + +# We use MSBuild as the build tool for VS 10 +FIND_PROGRAM(CMAKE_MAKE_PROGRAM + NAMES MSBuild + HINTS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir] + "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/" + "c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/" + "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0;CLR Version]/" + ) + +MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) +SET(MSVC10 1) +SET(MSVC_VERSION 1600) + diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b314b94b..a03f7d6cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,8 @@ -INCLUDE(CPack) # main project file. use it from a build sub-folder, see COMPILE for details PROJECT (dfhack) cmake_minimum_required(VERSION 2.6) SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules) -SET ( DFHACK_VERSION "0.4.0.3-dev" ) +SET ( DFHACK_VERSION "0.4.1.0-dev" ) # disable warning, autosearch if(COMMAND cmake_policy) @@ -20,10 +19,13 @@ ENDIF(NOT DEFINED CMAKE_BUILD_TYPE) SET( LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output CACHE PATH "Output directory for the dfhack library" ) SET( EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output CACHE PATH "Output directory for the dfhack tools" ) +SET( DATA_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output CACHE PATH "Output directory for the dfhack data (offset files)" ) OPTION(BUILD_DFHACK_DOCUMENTATION "Create doxygen documentation for developers" OFF) OPTION(BUILD_DFHACK_EXAMPLES "Build example tools" OFF) OPTION(BUILD_DFHACK_PLAYGROUND "Build tools from the playground folder" OFF) +OPTION(BUILD_DFHACK_C_BINDIGS "Build the C portion of the library" ON) +OPTION(BUILD_OFFSET_EDITOR "Build the Offset GUI editor (not ready for use)." OFF) include_directories (${CMAKE_SOURCE_DIR}/library/include/) include_directories (${CMAKE_SOURCE_DIR}/library/shm/) @@ -32,8 +34,12 @@ include_directories (${CMAKE_SOURCE_DIR}/library/depends/tinyxml/) include_directories (${CMAKE_SOURCE_DIR}/library/depends/argstream/) add_subdirectory (library) + +IF(BUILD_OFFSET_EDITOR) + add_subdirectory (offsetedit) +ENDIF(BUILD_OFFSET_EDITOR) + add_subdirectory (library/shm) -#add_subdirectory (dfhack/python) add_subdirectory (tools/examples) add_subdirectory (tools/playground) add_subdirectory (tools/supported) diff --git a/COMPILE.rst b/COMPILE.rst index 82544b9d4..dc07456f0 100644 --- a/COMPILE.rst +++ b/COMPILE.rst @@ -87,13 +87,9 @@ This will generate MSVC solution and project files. .. note:: You are working in the ``/build`` folder. Files added to - projects will end up there! (and that's wrong). Any changes to the - build system should be done by changing cmake configs and running - ``cmake`` on them! - -Also, you'll have to copy the ``Memory.xml`` file to the build output -folders MSVC generates. For example from ``output/`` to -``output/Release/`` + projects from within MSVC will end up there! (and that's + wrong). Any changes to the build system should be done + by changing cmake configs and running ``cmake`` on them! ------------------------- Using some other compiler @@ -111,6 +107,17 @@ dfhack has a few build targets: * ``make`` will build everything. * ``make expbench`` will build the expbench testing program and the library. +* Some of the utilities and the doxygen documentation won't be + normally built. You can enable them by specifying some extra + CMake variables:: + + BUILD_DFHACK_DOCUMENTATION - generate the documentation (really bad) + BUILD_DFHACK_EXAMPLES - build tools from tools/examples + BUILD_DFHACK_PLAYGROUND - build tools from tools/playground + + Example:: + + cmake .. -DBUILD_DFHACK_EXAMPLES=ON Build types =========== @@ -136,59 +143,5 @@ comes to compilation. Because it shares the memory space with DF itself, it has to be built with the same tools as DF and use the same C and C++/STL libraries. -For DF 31.01 - 31.10 on Windows, use MSVC 2008. You can get the Express +For DF 31.01 - 31.12 on Windows, use MSVC 2008. You can get the Express edition for free from Microsoft. - -Windows dependencies can be determined by a tool like ``depends.exe`` -(`google it`_). Both the fake ``SDL.dll`` and DF have to use the same -version of the C runtime (MSVCRT). The SHM can only be debugged using a -RelWithDebInfo build! - -Linux dependencies can be determined by setting the LD_DEBUG variable -and running ./df:: - - export LD_DEBUG=versions - ./df - -Example of (a part of a) relevant output from a working SHM -installation:: - - 24472: checking for version `GLIBC_2.0' in file /opt/lib32/lib/libpthread.so.0 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GCC_3.0' in file ./libs/libgcc_s.so.1 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBC_2.0' in file ./libs/libgcc_s.so.1 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBC_2.1' in file /opt/lib32/lib/libm.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBC_2.0' in file /opt/lib32/lib/libm.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBC_2.1.3' in file /opt/lib32/lib/libc.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBC_2.3.4' in file /opt/lib32/lib/libc.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBC_2.4' in file /opt/lib32/lib/libc.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBC_2.0' in file /opt/lib32/lib/libc.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBCXX_3.4.9' in file ./libs/libstdc++.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `CXXABI_1.3' in file ./libs/libstdc++.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBCXX_3.4' in file ./libs/libstdc++.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `CXXABI_1.3' in file ./libs/libstdc++.so.6 [0] required by file ./libs/libdfconnect.so [0] - 24472: checking for version `GLIBCXX_3.4' in file ./libs/libstdc++.so.6 [0] required by file ./libs/libdfconnect.so [0] - 24472: checking for version `GLIBC_2.1.3' in file /opt/lib32/lib/libc.so.6 [0] required by file ./libs/libdfconnect.so [0] - 24472: checking for version `GLIBC_2.2' in file /opt/lib32/lib/libc.so.6 [0] required by file ./libs/libdfconnect.so [0] - 24472: checking for version `GLIBC_2.3.4' in file /opt/lib32/lib/libc.so.6 [0] required by file ./libs/libdfconnect.so [0] - 24472: checking for version `GLIBC_2.0' in file /opt/lib32/lib/libc.so.6 [0] required by file ./libs/libdfconnect.so [0] - -libdfconnect is the SHM. Both are compiled against the same C++ library -and share the same CXXABI version. - -Precompiled SHM libraries are provided in binary releases. - -.. _google it: http://www.google.com/search?q=depends.exe - -Checking strings support -======================== -Strings are one of the important C++ types and a great indicator that -the SHM works. Tools like Dwarf Therapist depend on string support. -Reading of strings can be checked by running any of the tools that deal -with materials. - -String writing is best tested with a fresh throw-away fort and -``dfrenamer``. - -Embark, give one dwarf a very long name using dfrenamer and save/exit. -If DF crashes during the save sequence, your SHM is not compatible with -DF and the throw-away fort is most probably lost. diff --git a/Compile.html b/Compile.html index 1e4180548..d7bb44ce7 100644 --- a/Compile.html +++ b/Compile.html @@ -331,7 +331,6 @@ ul.auto-toc {
Note
You are working in the /build folder. Files added to -projects will end up there! (and that's wrong). Any changes to the -build system should be done by changing cmake configs and running -cmake on them!
+projects from within MSVC will end up there! (and that's +wrong). Any changes to the build system should be done +by changing cmake configs and running cmake on them!Also, you'll have to copy the Memory.xml file to the build output -folders MSVC generates. For example from output/ to -output/Release/
dfhack has a few build targets:
-If you're only after the library run make dfhack.
+make will build everything.
+make expbench will build the expbench testing program and the +library.
+Some of the utilities and the doxygen documentation won't be +normally built. You can enable them by specifying some extra +CMake variables:
++BUILD_DFHACK_DOCUMENTATION - generate the documentation (really bad) +BUILD_DFHACK_EXAMPLES - build tools from tools/examples +BUILD_DFHACK_PLAYGROUND - build tools from tools/playground ++
Example:
++cmake .. -DBUILD_DFHACK_EXAMPLES=ON ++
For DF 31.01 - 31.10 on Windows, use MSVC 2008. You can get the Express +
For DF 31.01 - 31.12 on Windows, use MSVC 2008. You can get the Express edition for free from Microsoft.
-Windows dependencies can be determined by a tool like depends.exe -(google it). Both the fake SDL.dll and DF have to use the same -version of the C runtime (MSVCRT). The SHM can only be debugged using a -RelWithDebInfo build!
-Linux dependencies can be determined by setting the LD_DEBUG variable -and running ./df:
--export LD_DEBUG=versions -./df --
Example of (a part of a) relevant output from a working SHM -installation:
--24472: checking for version `GLIBC_2.0' in file /opt/lib32/lib/libpthread.so.0 [0] required by file ./dwarfort.exe [0] -24472: checking for version `GCC_3.0' in file ./libs/libgcc_s.so.1 [0] required by file ./dwarfort.exe [0] -24472: checking for version `GLIBC_2.0' in file ./libs/libgcc_s.so.1 [0] required by file ./dwarfort.exe [0] -24472: checking for version `GLIBC_2.1' in file /opt/lib32/lib/libm.so.6 [0] required by file ./dwarfort.exe [0] -24472: checking for version `GLIBC_2.0' in file /opt/lib32/lib/libm.so.6 [0] required by file ./dwarfort.exe [0] -24472: checking for version `GLIBC_2.1.3' in file /opt/lib32/lib/libc.so.6 [0] required by file ./dwarfort.exe [0] -24472: checking for version `GLIBC_2.3.4' in file /opt/lib32/lib/libc.so.6 [0] required by file ./dwarfort.exe [0] -24472: checking for version `GLIBC_2.4' in file /opt/lib32/lib/libc.so.6 [0] required by file ./dwarfort.exe [0] -24472: checking for version `GLIBC_2.0' in file /opt/lib32/lib/libc.so.6 [0] required by file ./dwarfort.exe [0] -24472: checking for version `GLIBCXX_3.4.9' in file ./libs/libstdc++.so.6 [0] required by file ./dwarfort.exe [0] -24472: checking for version `CXXABI_1.3' in file ./libs/libstdc++.so.6 [0] required by file ./dwarfort.exe [0] -24472: checking for version `GLIBCXX_3.4' in file ./libs/libstdc++.so.6 [0] required by file ./dwarfort.exe [0] -24472: checking for version `CXXABI_1.3' in file ./libs/libstdc++.so.6 [0] required by file ./libs/libdfconnect.so [0] -24472: checking for version `GLIBCXX_3.4' in file ./libs/libstdc++.so.6 [0] required by file ./libs/libdfconnect.so [0] -24472: checking for version `GLIBC_2.1.3' in file /opt/lib32/lib/libc.so.6 [0] required by file ./libs/libdfconnect.so [0] -24472: checking for version `GLIBC_2.2' in file /opt/lib32/lib/libc.so.6 [0] required by file ./libs/libdfconnect.so [0] -24472: checking for version `GLIBC_2.3.4' in file /opt/lib32/lib/libc.so.6 [0] required by file ./libs/libdfconnect.so [0] -24472: checking for version `GLIBC_2.0' in file /opt/lib32/lib/libc.so.6 [0] required by file ./libs/libdfconnect.so [0] --
libdfconnect is the SHM. Both are compiled against the same C++ library -and share the same CXXABI version.
-Precompiled SHM libraries are provided in binary releases.
-Strings are one of the important C++ types and a great indicator that -the SHM works. Tools like Dwarf Therapist depend on string support. -Reading of strings can be checked by running any of the tools that deal -with materials.
-String writing is best tested with a fresh throw-away fort and -dfrenamer.
-Embark, give one dwarf a very long name using dfrenamer and save/exit. -If DF crashes during the save sequence, your SHM is not compatible with -DF and the throw-away fort is most probably lost.