2012-01-19 23:15:51 -07:00
|
|
|
PROJECT(mapexport)
|
|
|
|
|
2012-03-13 07:46:48 -06:00
|
|
|
# add *our* headers here.
|
2012-01-19 23:15:51 -07:00
|
|
|
SET(PROJECT_HDRS
|
|
|
|
)
|
|
|
|
|
|
|
|
SET(PROJECT_SRCS
|
|
|
|
mapexport.cpp
|
|
|
|
)
|
|
|
|
|
2012-01-20 12:21:29 -07:00
|
|
|
SET(PROJECT_PROTOS
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/proto/Tile.proto
|
2012-02-04 14:05:41 -07:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/proto/Plant.proto
|
2012-01-20 12:21:29 -07:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/proto/Block.proto
|
2012-02-04 14:05:41 -07:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/proto/Material.proto
|
2012-01-20 12:21:29 -07:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/proto/Map.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})
|
|
|
|
|
2012-03-13 07:46:48 -06:00
|
|
|
SET_SOURCE_FILES_PROPERTIES( ${PROJECT_PROTO_HDRS} PROPERTIES GENERATED TRUE)
|
|
|
|
SET_SOURCE_FILES_PROPERTIES( ${PROJECT_PROTO_SRCS} PROPERTIES GENERATED TRUE)
|
|
|
|
|
2012-01-20 12:21:29 -07:00
|
|
|
LIST(APPEND PROJECT_HDRS ${PROJECT_PROTO_HDRS})
|
|
|
|
LIST(APPEND PROJECT_SRCS ${PROJECT_PROTO_SRCS})
|
|
|
|
|
2012-01-19 23:15:51 -07:00
|
|
|
SET_SOURCE_FILES_PROPERTIES( ${PROJECT_HDRS} PROPERTIES HEADER_FILE_ONLY TRUE)
|
|
|
|
LIST(APPEND PROJECT_SRCS ${PROJECT_HDRS})
|
|
|
|
|
2012-01-20 12:21:29 -07:00
|
|
|
#Generate sources from our proto files and store them in the source tree
|
2012-01-19 23:15:51 -07:00
|
|
|
ADD_CUSTOM_COMMAND(
|
2012-01-20 12:21:29 -07:00
|
|
|
OUTPUT ${PROJECT_PROTO_SRCS} ${PROJECT_PROTO_HDRS}
|
2012-01-26 21:54:26 -07:00
|
|
|
COMMAND protoc-bin -I=${CMAKE_CURRENT_SOURCE_DIR}/proto/ --cpp_out=${CMAKE_CURRENT_SOURCE_DIR}/proto/ ${PROJECT_PROTOS}
|
2012-01-20 12:21:29 -07:00
|
|
|
DEPENDS protoc-bin ${PROJECT_PROTOS}
|
2012-01-19 23:15:51 -07:00
|
|
|
)
|
|
|
|
|
2012-01-31 09:42:25 -07:00
|
|
|
IF(WIN32)
|
2014-11-27 05:39:30 -07:00
|
|
|
DFHACK_PLUGIN(mapexport ${PROJECT_SRCS} ${PROJECT_HDRS} LINK_LIBRARIES protobuf-lite)
|
2012-01-31 09:42:25 -07:00
|
|
|
ELSE()
|
2014-11-27 05:39:30 -07:00
|
|
|
DFHACK_PLUGIN(mapexport ${PROJECT_SRCS} ${PROJECT_HDRS} LINK_LIBRARIES protobuf-lite)
|
2012-01-31 09:42:25 -07:00
|
|
|
ENDIF()
|