2014-12-02 04:06:01 -07:00
|
|
|
PROJECT(stockpiles)
|
|
|
|
|
|
|
|
# add *our* headers here.
|
|
|
|
SET(PROJECT_HDRS
|
2014-12-02 12:00:16 -07:00
|
|
|
StockpileUtils.h
|
|
|
|
OrganicMatLookup.h
|
|
|
|
StockpileSerializer.h
|
2014-12-02 04:06:01 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
SET(PROJECT_SRCS
|
2014-12-02 12:00:16 -07:00
|
|
|
OrganicMatLookup.cpp
|
|
|
|
StockpileSerializer.cpp
|
|
|
|
stockpiles.cpp
|
2014-12-02 04:06:01 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
SET(PROJECT_PROTOS
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/proto/stockpiles.proto
|
|
|
|
)
|
|
|
|
|
|
|
|
#Create new lists of what sources and headers protoc will output after we invoke it
|
|
|
|
STRING(REPLACE ".proto" ".pb.cc;" PROJECT_PROTO_SRCS ${PROJECT_PROTOS})
|
|
|
|
STRING(REPLACE ".proto" ".pb.h;" PROJECT_PROTO_HDRS ${PROJECT_PROTOS})
|
|
|
|
|
|
|
|
SET_SOURCE_FILES_PROPERTIES( ${PROJECT_PROTO_HDRS} PROPERTIES GENERATED TRUE)
|
|
|
|
SET_SOURCE_FILES_PROPERTIES( ${PROJECT_PROTO_SRCS} PROPERTIES GENERATED TRUE)
|
|
|
|
|
|
|
|
LIST(APPEND PROJECT_HDRS ${PROJECT_PROTO_HDRS})
|
|
|
|
LIST(APPEND PROJECT_SRCS ${PROJECT_PROTO_SRCS})
|
|
|
|
|
|
|
|
SET_SOURCE_FILES_PROPERTIES( ${PROJECT_HDRS} PROPERTIES HEADER_FILE_ONLY TRUE)
|
|
|
|
LIST(APPEND PROJECT_SRCS ${PROJECT_HDRS})
|
|
|
|
|
|
|
|
#Generate sources from our proto files and store them in the source tree
|
|
|
|
ADD_CUSTOM_COMMAND(
|
|
|
|
OUTPUT ${PROJECT_PROTO_SRCS} ${PROJECT_PROTO_HDRS}
|
|
|
|
COMMAND protoc-bin -I=${CMAKE_CURRENT_SOURCE_DIR}/proto/ --cpp_out=${CMAKE_CURRENT_SOURCE_DIR}/proto/ ${PROJECT_PROTOS}
|
|
|
|
DEPENDS protoc-bin ${PROJECT_PROTOS}
|
|
|
|
)
|
|
|
|
|
|
|
|
IF(WIN32)
|
2014-12-02 12:00:16 -07:00
|
|
|
DFHACK_PLUGIN(stockpiles ${PROJECT_SRCS} ${PROJECT_HDRS} LINK_LIBRARIES protobuf-lite lua)
|
2014-12-02 04:06:01 -07:00
|
|
|
ELSE()
|
2014-12-02 12:00:16 -07:00
|
|
|
DFHACK_PLUGIN(stockpiles ${PROJECT_SRCS} ${PROJECT_HDRS} LINK_LIBRARIES protobuf-lite lua)
|
2014-12-02 04:06:01 -07:00
|
|
|
ENDIF()
|