Update ENG-06-View.md (#67)

Replaced deprecated cmake command EXEC_PROGRAM() with execute_process().
A.O.G. Poston 2024-03-29 02:07:25 -04:00 committed by GitHub
parent dbe13a9ee3
commit 8bf0ddbeff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 9 deletions

@ -115,15 +115,15 @@ Obviously, it is too inconvenient to manually run the drogon_ctl command every t
```cmake
FILE(GLOB SCP_LIST ${CMAKE_CURRENT_SOURCE_DIR}/views/*.csp)
foreach(cspFile ${SCP_LIST})
message(STATUS "cspFile:" ${cspFile})
EXEC_PROGRAM(basename ARGS "-s .csp ${cspFile}" OUTPUT_VARIABLE classname)
message(STATUS "view classname:" ${classname})
add_custom_command(OUTPUT ${classname}.h ${classname}.cc
COMMAND drogon_ctl
ARGS create view ${cspFile}
DEPENDS ${cspFile}
VERBATIM )
set(VIEWSRC ${VIEWSRC} ${classname}.cc)
message(STATUS "cspFile:" ${cspFile})
execute_process(COMMAND basename ARGS "-s .csp ${cspFile}" OUTPUT_VARIABLE classname)
message(STATUS "view classname:" ${classname})
add_custom_command(
OUTPUT ${classname}.h ${classname}.cc
COMMAND drogon_ctl ARGS create view ${cspFile}
DEPENDS ${cspFile}
VERBATIM)
set(VIEWSRC ${VIEWSRC} ${classname}.cc)
endforeach()
```