diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 21c9797..f67d197 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -46,17 +46,16 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) file(GLOB_RECURSE SOURCES "src/*.cpp") file(GLOB_RECURSE HEADERS "src/*.hpp") -# Add custom target to run make_createagent.sh at the start of the build process -add_custom_target(run_createagent ALL - COMMAND ${CMAKE_COMMAND} -E echo "Running make_createagent.sh..." - COMMAND ${CMAKE_COMMAND} -E env bash ${CMAKE_CURRENT_SOURCE_DIR}/make_createagent.sh +# Add custom target to run cmake_prebuild.sh at the start of the build process +add_custom_target(run_prebuild_script ALL + COMMAND ${CMAKE_COMMAND} -E echo "Running cmake_prebuild.sh..." + COMMAND ${CMAKE_COMMAND} -E env bash ${CMAKE_CURRENT_SOURCE_DIR}/cmake_prebuild.sh WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Running make_createagent.sh before build" ) # Add executable add_executable(dropshell ${SOURCES}) -add_dependencies(dropshell run_createagent) +add_dependencies(dropshell run_prebuild_script) # Mark the generated files as GENERATED so CMake knows they'll be created during build set_source_files_properties( diff --git a/source/make_createagent.sh b/source/cmake_prebuild.sh similarity index 91% rename from source/make_createagent.sh rename to source/cmake_prebuild.sh index ccb7c99..fdb00b5 100755 --- a/source/make_createagent.sh +++ b/source/cmake_prebuild.sh @@ -1,6 +1,9 @@ #!/bin/bash set -e +# CMake pre-build script. +# Runs before the build process. + # This script creates two files: # src/utils/createagent.hpp # src/utils/createagent.cpp