From 07bb0408c18503b969933d38b51f00f78fe3a972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Thu, 26 May 2011 12:33:38 +0200 Subject: [PATCH] Fix memory.xml and pdcurses.dll copy problems for good. --- CMakeLists.txt | 1 + library/CMakeLists.txt | 6 ++++-- tools/examples/CMakeLists.txt | 8 -------- tools/playground/CMakeLists.txt | 9 --------- tools/supported/CMakeLists.txt | 7 ------- 5 files changed, 5 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d676741d2..398d8dfb8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -165,6 +165,7 @@ ELSE() set_property(TARGET curses PROPERTY IMPORTED_IMPLIB ${dfhack_SOURCE_DIR}/pdcurses/pdcurses.lib) include_directories (${dfhack_SOURCE_DIR}/pdcurses) add_custom_target( curses-copy + COMMAND "${CMAKE_COMMAND}" -E make_directory ${dfhack_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/ COMMAND "${CMAKE_COMMAND}" -E copy "${dfhack_SOURCE_DIR}/pdcurses/pdcurses.dll" ${dfhack_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/ DEPENDS "${dfhack_SOURCE_DIR}/pdcurses/pdcurses.dll") SET(Curses_FOUND TRUE) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index befc59f4d..83198f305 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -191,9 +191,11 @@ SET_TARGET_PROPERTIES(dfhack PROPERTIES DEBUG_POSTFIX "-debug" ) TARGET_LINK_LIBRARIES(dfhack ${PROJECT_LIBS}) -#ADD_CUSTOM_COMMAND( TARGET dfhack POST_BUILD -ADD_CUSTOM_TARGET( memxmlcopy ALL +ADD_CUSTOM_TARGET( memxmlcopy +DEPENDS ${dfhack_SOURCE_DIR}/Memory.xml +COMMAND ${CMAKE_COMMAND} -E make_directory ${dfhack_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/ COMMAND ${CMAKE_COMMAND} -E copy ${dfhack_SOURCE_DIR}/Memory.xml ${dfhack_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/) +ADD_DEPENDENCIES(dfhack memxmlcopy) install(TARGETS dfhack LIBRARY DESTINATION ${DFHACK_LIBRARY_DESTINATION} diff --git a/tools/examples/CMakeLists.txt b/tools/examples/CMakeLists.txt index b126a493c..43979af44 100644 --- a/tools/examples/CMakeLists.txt +++ b/tools/examples/CMakeLists.txt @@ -7,14 +7,6 @@ IF(UNIX) add_definitions(-DLINUX_BUILD) ENDIF(UNIX) -IF(MSVC) - ADD_CUSTOM_TARGET( memxml-for-examples - COMMAND ${CMAKE_COMMAND} -E copy ${dfhack_SOURCE_DIR}/Memory.xml ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Copying Memory.xml to ${CMAKE_CURRENT_BINARY_DIR}" - ) - set(LOCAL_DEPNAME memxml-for-examples) -ENDIF() - # buildingsdump - dump buildings and their raw data filtered by type DFHACK_TOOL(dfbuildingsdump buildingsdump.cpp) diff --git a/tools/playground/CMakeLists.txt b/tools/playground/CMakeLists.txt index 06006bc96..e8c92fe4b 100644 --- a/tools/playground/CMakeLists.txt +++ b/tools/playground/CMakeLists.txt @@ -7,15 +7,6 @@ IF(UNIX) add_definitions(-DLINUX_BUILD) ENDIF(UNIX) -# deep magic. make sure it runs to be able to do debug runs for MSVC projects out of the box -IF(MSVC) - ADD_CUSTOM_TARGET( memxml-for-playground - COMMAND ${CMAKE_COMMAND} -E copy ${dfhack_SOURCE_DIR}/Memory.xml ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Copying Memory.xml to ${CMAKE_CURRENT_BINARY_DIR}" - ) - set(LOCAL_DEPNAME memxml-for-playground) -ENDIF() - # a creature mood dump hack. has hardcoded offsets DFHACK_TOOL(dfmoodump moodump.cpp) diff --git a/tools/supported/CMakeLists.txt b/tools/supported/CMakeLists.txt index 259879b6f..27397aeb9 100644 --- a/tools/supported/CMakeLists.txt +++ b/tools/supported/CMakeLists.txt @@ -7,13 +7,6 @@ IF(UNIX) add_definitions(-DLINUX_BUILD) ENDIF() -IF(MSVC) - ADD_CUSTOM_TARGET( memxml-for-supported - COMMAND ${CMAKE_COMMAND} -E copy ${dfhack_SOURCE_DIR}/Memory.xml ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Copying Memory.xml to ${CMAKE_CURRENT_BINARY_DIR}") - set(LOCAL_DEPNAME memxml-for-supported) -ENDIF() - # burn trees and shrubs to ashes DFHACK_TOOL(dfimmolate immolate.cpp)