diff --git a/dropshell-build/dropshell-build.sh b/dropshell-build/dropshell-build.sh index 022ac2a..bb522ac 100755 --- a/dropshell-build/dropshell-build.sh +++ b/dropshell-build/dropshell-build.sh @@ -146,19 +146,23 @@ function get_executable_name() { EXECUTABLE_NAME="" local var_value="" + echo "Getting executable name from ${SOURCE_DIR}/${CMAKE_FILE}" + while IFS= read -r line; do # Look for set(PROJECT_EXE_NAME ipdemo) - if [[ "$line" =~ set\(PROJECT_EXE_NAME[[:space:]]+([a-zA-Z0-9_]+)\) ]]; then - var_value=$(echo "$line" | sed -E 's/.*set\(PROJECT_EXE_NAME[[:space:]]+([a-zA-Z0-9_]+)\).*/\1/') + if [[ "$line" =~ set\(PROJECT_EXE_NAME[[:space:]]+([a-zA-Z0-9_-]+)\) ]]; then + var_value=$(echo "$line" | sed -E 's/.*set\(PROJECT_EXE_NAME[[:space:]]+([a-zA-Z0-9_-]+)\).*/\1/') fi # Look for add_executable(${PROJECT_EXE_NAME} - if [[ "$line" =~ add_executable\(\$\{PROJECT_EXE_NAME\} ]]; then + if [[ "$line" =~ add_executable\([[:space:]]*\$\{PROJECT_EXE_NAME\}[[:space:]] ]]; then + echo "Found executable name: $var_value" EXECUTABLE_NAME="$var_value" fi done < "${SOURCE_DIR}/${CMAKE_FILE}" if [[ -z "$EXECUTABLE_NAME" ]]; then echo "Executable name not found." + exit 1 else echo "Executable name: $EXECUTABLE_NAME" fi diff --git a/dropshell-build/test/CMakeLists.txt b/dropshell-build/test/CMakeLists.txt index 946fa5f..6d6131f 100644 --- a/dropshell-build/test/CMakeLists.txt +++ b/dropshell-build/test/CMakeLists.txt @@ -101,9 +101,3 @@ target_link_libraries(${PROJECT_EXE_NAME} PRIVATE set_target_properties(${PROJECT_EXE_NAME} PROPERTIES LINK_FLAGS "-static" ) - -# Install targets -install(TARGETS ${PROJECT_EXE_NAME} - RUNTIME DESTINATION $ENV{HOME}/.local/bin -) - diff --git a/dropshell-tool/CMakeLists.txt b/dropshell-tool/CMakeLists.txt index b939ae0..726928e 100644 --- a/dropshell-tool/CMakeLists.txt +++ b/dropshell-tool/CMakeLists.txt @@ -102,8 +102,3 @@ set_target_properties(${PROJECT_EXE_NAME} PROPERTIES LINK_FLAGS "-static" ) -# Install targets -install(TARGETS ${PROJECT_EXE_NAME} - RUNTIME DESTINATION $ENV{HOME}/.local/bin -) - diff --git a/dropshell-tool/src/version.hpp.in b/dropshell-tool/src/version.hpp.in new file mode 100644 index 0000000..2a9cf89 --- /dev/null +++ b/dropshell-tool/src/version.hpp.in @@ -0,0 +1,21 @@ +#pragma once + +/* + +version.hpp is automatically generated by the build system, from version.hpp.in. + +DO NOT EDIT VERSION.HPP! + +*/ + +#include + +namespace dropshell { + +// Version information +const std::string VERSION = "@PROJECT_VERSION@"; +const std::string RELEASE_DATE = "@RELEASE_DATE@"; +const std::string AUTHOR = "j842"; +const std::string LICENSE = "MIT"; + +} // namespace dropshell \ No newline at end of file