2018-10-21 06:52:41 +00:00
|
|
|
link_libraries(drogon trantor pthread dl)
|
2018-10-15 05:34:38 +00:00
|
|
|
|
2018-05-28 06:34:47 +00:00
|
|
|
AUX_SOURCE_DIRECTORY(. SRC_DIR)
|
2018-10-20 09:35:52 +00:00
|
|
|
add_executable(_drogon_ctl main.cc cmd.cc create.cc create_view.cc)
|
2018-10-15 05:34:38 +00:00
|
|
|
FILE(GLOB SCP_LIST ${CMAKE_CURRENT_SOURCE_DIR}/templates/*.csp)
|
|
|
|
foreach(cspFile ${SCP_LIST})
|
|
|
|
message(STATUS "cspFile:" ${cspFile})
|
2018-10-17 10:43:51 +00:00
|
|
|
EXEC_PROGRAM(basename ARGS "${cspFile} .csp" OUTPUT_VARIABLE classname)
|
2018-10-15 05:34:38 +00:00
|
|
|
message(STATUS "view classname:" ${classname})
|
|
|
|
add_custom_command(OUTPUT ${classname}.h ${classname}.cc
|
|
|
|
COMMAND _drogon_ctl
|
|
|
|
ARGS create view ${cspFile}
|
|
|
|
DEPENDS ${cspFile}
|
|
|
|
VERBATIM )
|
|
|
|
set(TEMPL_SRC ${TEMPL_SRC} ${classname}.cc)
|
|
|
|
endforeach()
|
2018-10-31 08:45:27 +00:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
2018-10-15 05:34:38 +00:00
|
|
|
add_executable(drogon_ctl ${SRC_DIR} ${TEMPL_SRC})
|
|
|
|
add_dependencies(drogon_ctl trantor makeVersion _drogon_ctl)
|
2018-05-28 06:34:47 +00:00
|
|
|
install(TARGETS drogon_ctl DESTINATION bin)
|
2019-03-09 02:31:58 +00:00
|
|
|
install(PROGRAMS $<TARGET_FILE_DIR:drogon_ctl>/drogon_ctl DESTINATION bin RENAME dg_ctl)
|