cleanup: removed some unneeded deps and commented out unneeded code

This commit is contained in:
Kaley, Fischer 2024-10-06 15:29:52 +02:00
parent 4b057fbed5
commit b13245f777
2 changed files with 20 additions and 25 deletions

View file

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.19) cmake_minimum_required(VERSION 3.28.2)
# Get version # Get version
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/props.json PROPS) file(READ ${CMAKE_CURRENT_SOURCE_DIR}/props.json PROPS)
@ -8,7 +8,7 @@ project(stc
DESCRIPTION "Utilize configuration files to create runner scripts." DESCRIPTION "Utilize configuration files to create runner scripts."
VERSION ${VER}) VERSION ${VER})
set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD 26)
# Add the path to the source files for stc # Add the path to the source files for stc
file(GLOB_RECURSE STC_SOURCE_FILES "src/*.cpp") file(GLOB_RECURSE STC_SOURCE_FILES "src/*.cpp")
@ -17,14 +17,8 @@ file(GLOB_RECURSE STC_SOURCE_FILES "src/*.cpp")
add_executable(stc ${STC_SOURCE_FILES}) add_executable(stc ${STC_SOURCE_FILES})
install(TARGETS stc DESTINATION bin) install(TARGETS stc DESTINATION bin)
# Find and link against the tomlplusplus library
find_package(tomlplusplus REQUIRED)
target_link_libraries(stc PRIVATE tomlplusplus::tomlplusplus)
# DEBIAN # DEBIAN
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "DRAGONTOS") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "DRAGONTOS")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libcpptoml-dev")
set(CPACK_DEBIAN_PACKAGE_LICENSE "GPLv3") set(CPACK_DEBIAN_PACKAGE_LICENSE "GPLv3")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${DESCRIPTION}) set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${DESCRIPTION})
set(CPACK_DEBIAN_PACKAGE_RELEASE_DIST ON) set(CPACK_DEBIAN_PACKAGE_RELEASE_DIST ON)
@ -32,7 +26,6 @@ set(CPACK_GENERATOR DEBIAN)
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
# RPM # RPM
set(CPACK_PACKAGE_VENDOR "DRAGONTOS") set(CPACK_PACKAGE_VENDOR "DRAGONTOS")
set(CPACK_RPM_PACKAGE_REQUIRES "tomlplusplus-devel")
set(CPACK_RPM_PACKAGE_LICENSE "GPLv3") set(CPACK_RPM_PACKAGE_LICENSE "GPLv3")
set(CPACK_RPM_PACKAGE_DESCRIPTION ${DESCRIPTION}) set(CPACK_RPM_PACKAGE_DESCRIPTION ${DESCRIPTION})
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")

View file

@ -16,20 +16,20 @@
// should be in an alphabatical order ^^^ // should be in an alphabatical order ^^^
// clear buffers might not be needed // clear buffers might not be needed
void clearBuffer() { // void clearBuffer() {
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); // std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
} // }
//
inline void checkIfExtractionFailed() { // inline void checkIfExtractionFailed() {
if (!std::cin) { // if previous extraction failed // if (!std::cin) { // if previous extraction failed
if (std::cin.eof()) { // check if eof and if yes aborts the program // if (std::cin.eof()) { // check if eof and if yes aborts the program
std::abort(); // std::abort();
} // }
//
std::cin.clear(); // put std::cin back into normal mode // std::cin.clear(); // put std::cin back into normal mode
clearBuffer(); // remove bad input // clearBuffer(); // remove bad input
} // }
} // }
std::string woof(std::ifstream& meow){ std::string woof(std::ifstream& meow){
std::ostringstream nya; std::ostringstream nya;
@ -44,10 +44,12 @@ LISTING COMMANDS:
)#"; )#";
// strings are kinda broken // strings are kinda broken
const std::string invalidvalue = "Invalid value in config: "; const std::string invalidvalue = "Invalid value in config: \n";
const std::string invalidconfig = "Not a valid config: "; const std::string invalidconfig = "Not a valid config: \n";
int main(int argc, char **argv, char **envp) { int main(int argc, char **argv, char **envp) {
std::cout << "Test\n";
std::cout << invalidvalue + invalidconfig;
// need some cleaning in the future ata // need some cleaning in the future ata
const char* userHome = getenv("HOME"); const char* userHome = getenv("HOME");