Make building C bindings optional.

develop
Petr Mrázek 2010-08-13 02:35:10 +02:00
parent 21f7f8e703
commit 8fa3d0811c
2 changed files with 26 additions and 7 deletions

@ -54,6 +54,11 @@ include/dfhack/modules/WindowIO.h
include/dfhack/modules/World.h
)
SET(PROJECT_C_HDRS
include/dfhack-c/DFTypes_C.h
include/dfhack-c/DFContext_C.h
)
SET(PROJECT_SRCS
DFMemInfo.cpp
DFMemInfoManager.cpp
@ -61,8 +66,6 @@ DFContextManager.cpp
DFContext.cpp
DFProcessEnumerator.cpp
ContextShared.cpp
DFContext_C.cpp
DFTypes_C.cpp
depends/md5/md5.cpp
depends/md5/md5wrapper.cpp
@ -83,6 +86,11 @@ modules/Position.cpp
modules/Translation.cpp
modules/Vegetation.cpp
modules/World.cpp
)
SET(PROJECT_C_SRCS
DFContext_C.cpp
DFTypes_C.cpp
modules/Buildings_C.cpp
modules/Constructions_C.cpp
@ -126,6 +134,11 @@ ELSE(UNIX)
LIST(APPEND PROJECT_SRCS ${PROJECT_SRCS_WINDOWS})
ENDIF(UNIX)
IF(BUILD_DFHACK_C_BINDIGS)
LIST(APPEND PROJECT_HDRS ${PROJECT_C_HDRS})
LIST(APPEND PROJECT_SRCS ${PROJECT_C_SRCS})
ENDIF(BUILD_DFHACK_C_BINDIGS)
SET_SOURCE_FILES_PROPERTIES( ${PROJECT_HDRS} PROPERTIES HEADER_FILE_ONLY TRUE )
LIST(APPEND PROJECT_SRCS ${PROJECT_HDRS})

@ -12,10 +12,6 @@ ENDIF(UNIX)
ADD_EXECUTABLE(dfmoodump moodump.cpp)
TARGET_LINK_LIBRARIES(dfmoodump dfhack)
# for trying out some 'stuff'
ADD_EXECUTABLE(dftest test.cpp)
TARGET_LINK_LIBRARIES(dftest dfhack)
# bauxite - turn all mechanisms into bauxite mechanisms
# Author: Alex Legg
#ADD_EXECUTABLE(dfbauxite dfbauxite.cpp)
@ -60,9 +56,19 @@ TARGET_LINK_LIBRARIES(dfcatsplosion dfhack)
#ADD_EXECUTABLE(dfrenamer renamer.cpp)
#TARGET_LINK_LIBRARIES(dfrenamer dfhack)
# this needs the C bindings
IF(BUILD_DFHACK_C_BINDIGS)
# for trying out some 'stuff'
ADD_EXECUTABLE(dftest test.cpp)
TARGET_LINK_LIBRARIES(dftest dfhack)
install(TARGETS
dftest
RUNTIME DESTINATION bin
)
ENDIF(BUILD_DFHACK_C_BINDIGS)
install(TARGETS
dfmoodump
dftest
dfdigger
dfdigger2
dfcatsplosion