2019-07-26 14:22:12 +00:00
|
|
|
LINK_LIBRARIES(drogon trantor pthread dl)
|
2018-10-15 05:34:38 +00:00
|
|
|
|
2019-07-26 14:22:12 +00:00
|
|
|
SET(ctl_sources cmd.cc
|
|
|
|
create.cc
|
|
|
|
create_controller.cc
|
|
|
|
create_filter.cc
|
|
|
|
create_model.cc
|
|
|
|
create_plugin.cc
|
|
|
|
create_project.cc
|
|
|
|
create_view.cc
|
|
|
|
help.cc
|
|
|
|
main.cc
|
|
|
|
press.cc
|
|
|
|
version.cc)
|
|
|
|
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)
|
2019-07-26 14:22:12 +00:00
|
|
|
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)
|
2019-07-26 14:22:12 +00:00
|
|
|
MESSAGE(STATUS "view classname:" ${classname})
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${classname}.h ${classname}.cc
|
2018-10-15 05:34:38 +00:00
|
|
|
COMMAND _drogon_ctl
|
|
|
|
ARGS create view ${cspFile}
|
|
|
|
DEPENDS ${cspFile}
|
|
|
|
VERBATIM )
|
2019-07-26 14:22:12 +00:00
|
|
|
SET(TEMPL_SRC ${TEMPL_SRC} ${classname}.cc)
|
|
|
|
ENDFOREACH()
|
|
|
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
ADD_EXECUTABLE(drogon_ctl ${ctl_sources} ${TEMPL_SRC})
|
|
|
|
ADD_DEPENDENCIES(drogon_ctl trantor makeVersion _drogon_ctl)
|
2019-08-08 07:17:09 +00:00
|
|
|
message(STATUS "bin:" ${INSTALL_BIN_DIR})
|
|
|
|
INSTALL(TARGETS drogon_ctl RUNTIME DESTINATION ${INSTALL_BIN_DIR})
|
|
|
|
INSTALL(PROGRAMS $<TARGET_FILE_DIR:drogon_ctl>/drogon_ctl DESTINATION ${INSTALL_BIN_DIR} RENAME dg_ctl)
|
2019-07-26 14:22:12 +00:00
|
|
|
SET(ctl_targets _drogon_ctl drogon_ctl)
|
|
|
|
SET_PROPERTY(TARGET ${ctl_targets} PROPERTY CXX_STANDARD ${DROGON_CXX_STANDARD})
|
|
|
|
SET_PROPERTY(TARGET ${ctl_targets} PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
|
|
SET_PROPERTY(TARGET ${ctl_targets} PROPERTY CXX_EXTENSIONS OFF)
|
|
|
|
|