unify build system, start on the new offset file format

develop
Petr Mrázek 2010-08-16 00:45:02 +02:00
parent 891c454256
commit 3b29fddf7b
8 changed files with 39 additions and 31 deletions

@ -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_PLAYGROUND "Build tools from the playground folder" OFF)
OPTION(BUILD_DFHACK_C_BINDIGS "Build the C portion of the library" ON) 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_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/include/)
include_directories (${CMAKE_SOURCE_DIR}/library/shm/) include_directories (${CMAKE_SOURCE_DIR}/library/shm/)
@ -35,12 +37,26 @@ include_directories (${CMAKE_SOURCE_DIR}/library/depends/argstream/)
add_subdirectory (library) add_subdirectory (library)
IF(BUILD_DFHACK_SUPPORTED)
add_subdirectory (tools/supported)
ENDIF(BUILD_DFHACK_SUPPORTED)
IF(BUILD_OFFSET_EDITOR) IF(BUILD_OFFSET_EDITOR)
add_subdirectory (offsetedit) add_subdirectory (offsetedit)
ENDIF(BUILD_OFFSET_EDITOR) ENDIF(BUILD_OFFSET_EDITOR)
add_subdirectory (library/shm) IF(BUILD_DFHACK_SHM)
add_subdirectory (tools/examples) add_subdirectory (library/shm)
add_subdirectory (tools/playground) ENDIF(BUILD_DFHACK_SHM)
add_subdirectory (tools/supported)
add_subdirectory (doc) 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)

@ -10,8 +10,6 @@
# http://tobias.rautenkranz.ch/cmake/doxygen/ # http://tobias.rautenkranz.ch/cmake/doxygen/
# but it is hard to understand... # but it is hard to understand...
IF (BUILD_DFHACK_DOCUMENTATION)
FIND_PACKAGE(Doxygen) FIND_PACKAGE(Doxygen)
IF(DOXYGEN_FOUND) IF(DOXYGEN_FOUND)
@ -64,5 +62,3 @@ IF(DOXYGEN_FOUND)
ELSE(DOXYGEN_FOUND) ELSE(DOXYGEN_FOUND)
MESSAGE (FATAL_ERROR "doxygen binary couldn't be found") MESSAGE (FATAL_ERROR "doxygen binary couldn't be found")
ENDIF(DOXYGEN_FOUND) ENDIF(DOXYGEN_FOUND)
ENDIF (BUILD_DFHACK_DOCUMENTATION)

@ -192,11 +192,15 @@ if(MSVC)
ADD_CUSTOM_COMMAND(TARGET dfhack POST_BUILD ADD_CUSTOM_COMMAND(TARGET dfhack POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Readme.html $(TargetDir)/Readme.html 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) else(MSVC)
# Just put the file in the output directory on Linux and Mac # 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}/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}/Readme.html ${DATA_OUTPUT_PATH}/Readme.html COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/LICENSE ${DATA_OUTPUT_PATH}/LICENSE.txt COPYONLY)
endif(MSVC) endif(MSVC)
IF(UNIX) IF(UNIX)

@ -254,10 +254,10 @@ bool MemInfoManager::loadFile(string path_to_xml)
throw Error::MemoryXmlNoRoot(); throw Error::MemoryXmlNoRoot();
} }
string m_name=pElem->Value(); string m_name=pElem->Value();
if(m_name != "DFExtractor") if(m_name != "DFHack")
{ {
error = true; error = true;
throw Error::MemoryXmlNoDFExtractor(m_name.c_str()); throw Error::MemoryXmlNoRoot();
} }
// save this for later // save this for later
hRoot=TiXmlHandle(pElem); hRoot=TiXmlHandle(pElem);

@ -1,8 +1,5 @@
# don't use this file directly. use the one in the root folder of the project # 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. # this is required to ensure we use the right configuration for the system.
IF(UNIX) IF(UNIX)
add_definitions(-DLINUX_BUILD) add_definitions(-DLINUX_BUILD)
@ -62,4 +59,3 @@ dfspatterdump
dfprocessenum dfprocessenum
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
) )
ENDIF (BUILD_DFHACK_EXAMPLES)

@ -1,8 +1,5 @@
# don't use this file directly. use the one in the root folder of the project # 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. # this is required to ensure we use the right configuration for the system.
IF(UNIX) IF(UNIX)
add_definitions(-DLINUX_BUILD) add_definitions(-DLINUX_BUILD)
@ -80,4 +77,3 @@ IF(UNIX)
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
) )
ENDIF(UNIX) ENDIF(UNIX)
ENDIF (BUILD_DFHACK_PLAYGROUND)