diff --git a/CMakeLists.txt b/CMakeLists.txt index a03f7d6cc..4105db70d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,8 @@ 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) +OPTION(BUILD_DFHACK_SUPPORTED "Build the supported toold." ON) +OPTION(BUILD_DFHACK_SHM "Build the SHM." OFF) include_directories (${CMAKE_SOURCE_DIR}/library/include/) include_directories (${CMAKE_SOURCE_DIR}/library/shm/) @@ -35,12 +37,26 @@ include_directories (${CMAKE_SOURCE_DIR}/library/depends/argstream/) add_subdirectory (library) +IF(BUILD_DFHACK_SUPPORTED) + add_subdirectory (tools/supported) +ENDIF(BUILD_DFHACK_SUPPORTED) + IF(BUILD_OFFSET_EDITOR) add_subdirectory (offsetedit) ENDIF(BUILD_OFFSET_EDITOR) -add_subdirectory (library/shm) -add_subdirectory (tools/examples) -add_subdirectory (tools/playground) -add_subdirectory (tools/supported) -add_subdirectory (doc) \ No newline at end of file +IF(BUILD_DFHACK_SHM) + add_subdirectory (library/shm) +ENDIF(BUILD_DFHACK_SHM) + +IF(BUILD_DFHACK_EXAMPLES) + add_subdirectory (tools/examples) +ENDIF(BUILD_DFHACK_EXAMPLES) + +IF(BUILD_DFHACK_PLAYGROUND) + add_subdirectory (tools/playground) +ENDIF(BUILD_DFHACK_PLAYGROUND) + +IF(BUILD_DFHACK_DOCUMENTATION) + add_subdirectory (doc) +ENDIF(BUILD_DFHACK_DOCUMENTATION) \ No newline at end of file diff --git a/build/build-MinGW32-release-trace.bat b/build/build-MinGW32-release-trace.bat index f75da5ff8..ca7df86d3 100644 --- a/build/build-MinGW32-release-trace.bat +++ b/build/build-MinGW32-release-trace.bat @@ -1,6 +1,6 @@ -mkdir build-real -cd build-real -cmake ..\.. -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE:string=Release --trace > trace-stdout.txt 2> trace-stderr.txt -mingw32-make 2> log.txt -pause +mkdir build-real +cd build-real +cmake ..\.. -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE:string=Release --trace > trace-stdout.txt 2> trace-stderr.txt +mingw32-make 2> log.txt +pause dir file.xxx \ No newline at end of file diff --git a/build/generate-MSVC-2010.bat b/build/generate-MSVC-2010.bat index 588051bc6..50828f7ea 100644 --- a/build/generate-MSVC-2010.bat +++ b/build/generate-MSVC-2010.bat @@ -1,4 +1,4 @@ -mkdir build-real -cd build-real -cmake ..\.. -G"Visual Studio 10" +mkdir build-real +cd build-real +cmake ..\.. -G"Visual Studio 10" pause \ No newline at end of file diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 1ced1fd7b..c1f2cdaca 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -10,8 +10,6 @@ # http://tobias.rautenkranz.ch/cmake/doxygen/ # but it is hard to understand... -IF (BUILD_DFHACK_DOCUMENTATION) - FIND_PACKAGE(Doxygen) IF(DOXYGEN_FOUND) @@ -63,6 +61,4 @@ IF(DOXYGEN_FOUND) ELSE(DOXYGEN_FOUND) MESSAGE (FATAL_ERROR "doxygen binary couldn't be found") -ENDIF(DOXYGEN_FOUND) - -ENDIF (BUILD_DFHACK_DOCUMENTATION) \ No newline at end of file +ENDIF(DOXYGEN_FOUND) \ No newline at end of file diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 8e09a2203..79e9f1099 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -192,11 +192,15 @@ if(MSVC) ADD_CUSTOM_COMMAND(TARGET dfhack POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Readme.html $(TargetDir)/Readme.html ) + ADD_CUSTOM_COMMAND(TARGET dfhack POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/LICENSE $(TargetDir)/LICENSE.txt + ) else(MSVC) # Just put the file in the output directory on Linux and Mac - configure_file(${CMAKE_SOURCE_DIR}/data/Memory.xml ${DATA_OUTPUT_PATH}/Memory.xml COPYONLY) + configure_file(${CMAKE_SOURCE_DIR}/data/Memory-ng.xml ${DATA_OUTPUT_PATH}/Memory.xml COPYONLY) configure_file(${CMAKE_SOURCE_DIR}/Compile.html ${DATA_OUTPUT_PATH}/Compile.html COPYONLY) configure_file(${CMAKE_SOURCE_DIR}/Readme.html ${DATA_OUTPUT_PATH}/Readme.html COPYONLY) + configure_file(${CMAKE_SOURCE_DIR}/LICENSE ${DATA_OUTPUT_PATH}/LICENSE.txt COPYONLY) endif(MSVC) IF(UNIX) diff --git a/library/DFMemInfoManager.cpp b/library/DFMemInfoManager.cpp index cc4c5de4a..216061c2e 100644 --- a/library/DFMemInfoManager.cpp +++ b/library/DFMemInfoManager.cpp @@ -254,10 +254,10 @@ bool MemInfoManager::loadFile(string path_to_xml) throw Error::MemoryXmlNoRoot(); } string m_name=pElem->Value(); - if(m_name != "DFExtractor") + if(m_name != "DFHack") { error = true; - throw Error::MemoryXmlNoDFExtractor(m_name.c_str()); + throw Error::MemoryXmlNoRoot(); } // save this for later hRoot=TiXmlHandle(pElem); diff --git a/tools/examples/CMakeLists.txt b/tools/examples/CMakeLists.txt index 05d03e3d8..251efe49c 100644 --- a/tools/examples/CMakeLists.txt +++ b/tools/examples/CMakeLists.txt @@ -1,8 +1,5 @@ # don't use this file directly. use the one in the root folder of the project -# only build this stuff when BUILD_DFHACK_EXAMPLES is set to ON -IF (BUILD_DFHACK_EXAMPLES) - # this is required to ensure we use the right configuration for the system. IF(UNIX) add_definitions(-DLINUX_BUILD) @@ -61,5 +58,4 @@ dftreedump dfspatterdump dfprocessenum RUNTIME DESTINATION bin -) -ENDIF (BUILD_DFHACK_EXAMPLES) \ No newline at end of file +) \ No newline at end of file diff --git a/tools/playground/CMakeLists.txt b/tools/playground/CMakeLists.txt index a28597475..26417e233 100644 --- a/tools/playground/CMakeLists.txt +++ b/tools/playground/CMakeLists.txt @@ -1,8 +1,5 @@ # don't use this file directly. use the one in the root folder of the project -# only build this stuff when BUILD_DFHACK_PLAYGROUND is set to ON -IF (BUILD_DFHACK_PLAYGROUND) - # this is required to ensure we use the right configuration for the system. IF(UNIX) add_definitions(-DLINUX_BUILD) @@ -79,5 +76,4 @@ IF(UNIX) dfincremental RUNTIME DESTINATION bin ) -ENDIF(UNIX) -ENDIF (BUILD_DFHACK_PLAYGROUND) \ No newline at end of file +ENDIF(UNIX) \ No newline at end of file