Compare commits

..

1 Commits

Author SHA1 Message Date
410f9190fc Support for both production and debug builds 2023-01-31 23:22:54 -06:00
2 changed files with 5 additions and 11 deletions

View File

@ -29,14 +29,9 @@ set(HEADERS
src/main.h) src/main.h)
set(PRODUCTION true)
add_definitions(-DPRODUCTION=${PRODUCTION})
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS}) add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_definitions(DEBUG=1)
ELSE()
add_compile_definitions(DEBUG=0)
ENDIF()
message(STATUS "Build type is " ${CMAKE_BUILD_TYPE})
install(TARGETS ${PROJECT_NAME} install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin) RUNTIME DESTINATION bin)

View File

@ -11,11 +11,10 @@
const static std::string homeDirectory = getpwuid(getuid())->pw_dir; const static std::string homeDirectory = getpwuid(getuid())->pw_dir;
const static std::string configD = homeDirectory + "/.config/budget/"; const static std::string configD = homeDirectory + "/.config/budget/";
const static std::string storageD = homeDirectory + "/.local/share/budget/"; const static std::string storageD = homeDirectory + "/.local/share/budget/";
#if PRODUCTION == true
#if DEBUG const static std::string databaseFile = homeDirectory + "/.local/share/budget/budget.sqlite";
const static std::string databaseFile = homeDirectory + "/.local/share/budget/budgetDebug.sqlite";
#else #else
const static std::string databaseFile = homeDirectory + "/.local/share/budget/budget.sqlite"; const static std::string databaseFile = homeDirectory + "/.local/share/budget/budgetDebug.sqlite";
#endif #endif