Compare commits

..

1 Commits

Author SHA1 Message Date
f0f9240b24 Support for both production and debug builds 2023-02-01 19:44:54 -06:00
2 changed files with 11 additions and 5 deletions

View File

@ -29,9 +29,14 @@ set(HEADERS
src/main.h)
set(PRODUCTION true)
add_definitions(-DPRODUCTION=${PRODUCTION})
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}
RUNTIME DESTINATION bin)

View File

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