diff --git a/CMakeLists.txt b/CMakeLists.txt index 30f6314..b8ca140 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,15 +28,6 @@ install(CODE # Initialize content variable set(FINAL_CONTENT \"\") - # Check if the optional prefix file exists - if(EXISTS \${PREFIX_FILE}) - message(STATUS \"Prefix file found. Adding .script_prefix.lua.\") - file(READ \${PREFIX_FILE} PREFIX_CONTENT) - set(FINAL_CONTENT \"\${PREFIX_CONTENT}\") - else() - message(STATUS \"Prefix file not found.\") - endif() - # Check if scripts directory exists and contains .lua files if(EXISTS \${SCRIPTS_DIR} AND IS_DIRECTORY \${SCRIPTS_DIR}) file(GLOB LUA_SCRIPTS \"\${SCRIPTS_DIR}/*.lua\") @@ -59,6 +50,15 @@ install(CODE message(STATUS \"Scripts directory not found.\") endif() + # Check if the optional prefix file exists + if(EXISTS \${PREFIX_FILE}) + message(STATUS \"Prefix file found. Adding .script_prefix.lua.\") + file(READ \${PREFIX_FILE} PREFIX_CONTENT) + set(FINAL_CONTENT \"\${PREFIX_CONTENT}\") + else() + message(STATUS \"Prefix file not found.\") + endif() + # Write the resulting content to the destination file message(STATUS \"Installing script file to \${DEST_FILE}\") file(WRITE \${DEST_FILE} \"\${FINAL_CONTENT}\")