@ -1,22 +1,15 @@
# d o n ' t u s e t h i s f i l e d i r e c t l y . u s e t h e o n e i n t h e r o o t f o l d e r o f t h e p r o j e c t
if ( NOT DEFINED DFHACK_CONSISTENCY )
MESSAGE ( FATAL_ERROR "Please build the whole thing, not parts. You can turn parts on/off using options." )
ENDIF ( )
PROJECT ( dfhack-library )
cmake_minimum_required ( VERSION 2.8 )
SET ( CMAKE_MODULE_PATH ${ CMAKE_SOURCE_DIR } /CMake/Modules )
if ( "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}" )
message ( FATAL_ERROR "In-source builds are not allowed." )
endif ( )
IF ( NOT DEFINED CMAKE_BUILD_TYPE )
SET ( CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." )
ENDIF ( )
include_directories ( ${ CMAKE_SOURCE_DIR } /library/include/ )
include_directories ( ${ CMAKE_SOURCE_DIR } /library/shm/ )
include_directories ( ${ CMAKE_SOURCE_DIR } /library/depends/md5/ )
include_directories ( ${ CMAKE_SOURCE_DIR } /library/depends/tinyxml/ )
include_directories ( ${ CMAKE_SOURCE_DIR } /library/depends/argstream/ )
include_directories ( ${ CMAKE_SOURCE_DIR } /library/private/ )
include_directories ( include )
include_directories ( depends/md5 )
include_directories ( depends/tinyxml )
include_directories ( depends/argstream )
include_directories ( private )
SET ( PROJECT_HDRS_INTERNAL
p r i v a t e / C o n t e x t S h a r e d . h
@ -167,7 +160,6 @@ IF( CMAKE_SIZEOF_VOID_P MATCHES 8 )
ADD_DEFINITIONS ( -DHAVE_64_BIT )
ENDIF ( )
# CONFIGURE_FILE ( ${ CMAKE_SOURCE_DIR } /library/config.h.cmake ${ CMAKE_SOURCE_DIR } /library/private/config.h )
ADD_DEFINITIONS ( -DMEMXML_DATA_PATH= "${MEMXML_DATA_PATH}" )
ADD_DEFINITIONS ( -DBUILD_DFHACK_LIB -DTIXML_USE_STL )
@ -180,7 +172,7 @@ IF(UNIX)
SET ( PROJECT_LIBS ${ X11_LIBRARY } rt )
ELSE ( )
IF ( MSVC )
SET ( PROJECT_LIBS psapi ${ CMAKE _SOURCE_DIR} /library/depends/ntdll/ntdll.lib )
SET ( PROJECT_LIBS psapi ${ dfhack _SOURCE_DIR} /library/depends/ntdll/ntdll.lib )
ELSE ( )
SET ( PROJECT_LIBS psapi ntdll )
ENDIF ( )
@ -193,12 +185,12 @@ SET_TARGET_PROPERTIES(dfhack PROPERTIES DEBUG_POSTFIX "-debug" )
TARGET_LINK_LIBRARIES ( dfhack ${ PROJECT_LIBS } )
ADD_CUSTOM_COMMAND ( TARGET dfhack POST_BUILD
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { CM A K E _ S O U R C E _ D I R } / M e m o r y . x m l $ { CM A K E _ B I N A R Y _ D I R } / b i n / $ { C M A K E _ C F G _ I N T D I R } / )
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { df h a c k _ S O U R C E _ D I R } / M e m o r y . x m l $ { df h a c k _ B I N A R Y _ D I R } / b i n / $ { C M A K E _ C F G _ I N T D I R } / )
install ( TARGETS dfhack
L I B R A R Y D E S T I N A T I O N $ { D F H A C K _ L I B R A R Y _ D E S T I N A T I O N }
R U N T I M E D E S T I N A T I O N $ { D F H A C K _ L I B R A R Y _ D E S T I N A T I O N } ) # l i n u x : l i b
install ( FILES ${ CMAKE _SOURCE_DIR} /Memory.xml
install ( FILES ${ dfhack _SOURCE_DIR} /Memory.xml
D E S T I N A T I O N $ { D F H A C K _ D A T A _ D E S T I N A T I O N } ) # l i n u x : s h a r e / d f h a c k
if ( BUILD_DFHACK_DEVEL )
@ -206,7 +198,7 @@ if(BUILD_DFHACK_DEVEL)
install ( TARGETS dfhack
A R C H I V E D E S T I N A T I O N $ { D F H A C K _ D E V L I B _ D E S T I N A T I O N } )
endif ( )
install ( DIRECTORY ${ CMAKE_SOURCE_DIR } /library/ include/
install ( DIRECTORY include
D E S T I N A T I O N $ { D F H A C K _ I N C L U D E S _ D E S T I N A T I O N }
F I L E S _ M A T C H I N G P A T T E R N " * . h " ) # l i n u x : i n c l u d e
endif ( )