Skip to content

Commit

Permalink
Update CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
guchengxi1994 committed Apr 30, 2024
1 parent 76fa59f commit 1122614
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions windows/runner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,25 @@ string(REPLACE "/build/windows/x64" "" ROOT_DIR ${P1})

message(STATUS "ROOT_DIR ==> " ${ROOT_DIR})

# create .env if .env not exists
set(ENV_PATH ${ROOT_DIR}/.env)

if(NOT EXISTS ${ENV_PATH})
set(MULTILINE_TEXT
"LLM_BASE =\" your api here \"
LLM_MODEL_NAME =\" your model name here \"
LLM_SK =\" your api key here \"
CHAT_CHAT_BASE = \" your chatchat api here \"
"
)
file(WRITE ${ENV_PATH} ${MULTILINE_TEXT})
message("File did not exist, so it was created.")
else()
message("File already exists.")
endif()

add_custom_target(copy-runtime-files ALL
COMMAND ${CMAKE_COMMAND} -E copy ${ROOT_DIR}/.env ${P1}/runner/Debug/.env
COMMAND ${CMAKE_COMMAND} -E copy ${ROOT_DIR}/.env ${P1}/runner/Release/.env
COMMAND ${CMAKE_COMMAND} -E copy ${ROOT_DIR}/.env ${P1}/runner/Profile/.env
COMMAND ${CMAKE_COMMAND} -E copy ${ENV_PATH} ${P1}/runner/Debug/.env
COMMAND ${CMAKE_COMMAND} -E copy ${ENV_PATH} ${P1}/runner/Release/.env
COMMAND ${CMAKE_COMMAND} -E copy ${ENV_PATH} ${P1}/runner/Profile/.env
)

0 comments on commit 1122614

Please sign in to comment.