logicp преди 5 години
родител
ревизия
b887a90502
променени са 4 файла, в които са добавени 173 реда и са изтрити 6 реда
  1. 29 0
      src/.vscode/launch.json
  2. 71 0
      src/.vscode/settings.json
  3. 64 0
      src/.vscode/tasks.json
  4. 9 6
      src/CMakeLists.txt

+ 29 - 0
src/.vscode/launch.json

@@ -0,0 +1,29 @@
+{
+  // Use IntelliSense to learn about possible attributes.
+  // Hover to view descriptions of existing attributes.
+  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+  "version": "0.2.0",
+  "configurations": [
+    {
+      "name": "Debug KIQ",
+      "type": "cppdbg",
+      "request": "launch",
+      "program": "${workspaceFolder}/kiq",
+      "args": ["-std=c++11"],
+      "stopAtEntry": false,
+      "cwd": "${workspaceFolder}",
+      "environment": [],
+      "externalConsole": false,
+      "MIMode": "gdb",
+      "setupCommands": [
+        {
+          "description": "Enable pretty-printing for gdb",
+          "text": "-enable-pretty-printing",
+          "ignoreFailures": true
+        }
+      ],
+      "preLaunchTask": "Build",
+      "miDebuggerPath": "/usr/bin/gdb"
+    }
+  ]
+}

+ 71 - 0
src/.vscode/settings.json

@@ -0,0 +1,71 @@
+{
+  "files.associations": {
+    "cctype": "cpp",
+    "clocale": "cpp",
+    "cmath": "cpp",
+    "cstdarg": "cpp",
+    "cstddef": "cpp",
+    "cstdio": "cpp",
+    "cstdlib": "cpp",
+    "cstring": "cpp",
+    "ctime": "cpp",
+    "cwchar": "cpp",
+    "cwctype": "cpp",
+    "array": "cpp",
+    "atomic": "cpp",
+    "bit": "cpp",
+    "*.tcc": "cpp",
+    "charconv": "cpp",
+    "chrono": "cpp",
+    "condition_variable": "cpp",
+    "cstdint": "cpp",
+    "deque": "cpp",
+    "list": "cpp",
+    "map": "cpp",
+    "set": "cpp",
+    "unordered_map": "cpp",
+    "unordered_set": "cpp",
+    "vector": "cpp",
+    "exception": "cpp",
+    "algorithm": "cpp",
+    "functional": "cpp",
+    "iterator": "cpp",
+    "memory": "cpp",
+    "memory_resource": "cpp",
+    "numeric": "cpp",
+    "optional": "cpp",
+    "random": "cpp",
+    "ratio": "cpp",
+    "string": "cpp",
+    "string_view": "cpp",
+    "system_error": "cpp",
+    "tuple": "cpp",
+    "type_traits": "cpp",
+    "utility": "cpp",
+    "fstream": "cpp",
+    "future": "cpp",
+    "initializer_list": "cpp",
+    "iosfwd": "cpp",
+    "iostream": "cpp",
+    "istream": "cpp",
+    "limits": "cpp",
+    "mutex": "cpp",
+    "new": "cpp",
+    "ostream": "cpp",
+    "sstream": "cpp",
+    "stdexcept": "cpp",
+    "streambuf": "cpp",
+    "thread": "cpp",
+    "cinttypes": "cpp",
+    "typeinfo": "cpp",
+    "variant": "cpp",
+    "valarray": "cpp",
+    "csignal": "cpp",
+    "bitset": "cpp",
+    "forward_list": "cpp",
+    "netfwd": "cpp",
+    "regex": "cpp",
+    "iomanip": "cpp",
+    "shared_mutex": "cpp"
+  }
+}

+ 64 - 0
src/.vscode/tasks.json

@@ -0,0 +1,64 @@
+{
+  "tasks": [
+    {
+      "type": "shell",
+      "label": "CMake",
+      "command": "cmake",
+      "group": "build",
+      "args": [
+        "-G 'Unix Makefiles' DCMAKE_BUILD_TYPE=Debug"
+      ],
+      "options": {
+        "cwd": "${workspaceFolder}"
+      }
+    },
+    {
+      "type": "shell",
+      "label": "make",
+      "command": "make",
+      "group": "build",
+      "args": [
+        "-j8"
+      ],
+      "options": {
+        "cwd": "${workspaceFolder}"
+      }
+    },
+    {
+      "label": "Build",
+      "dependsOn": [
+        "CMake",
+        "make"
+      ]
+    },
+    {
+      "type": "shell",
+      "label": "clang++ build active file",
+      "command": "/usr/bin/clang++",
+      "args": [
+        "-g",
+        "${file}",
+        "-o",
+        "${fileDirname}/${fileBasenameNoExtension}"
+      ],
+      "options": {
+        "cwd": "/usr/bin"
+      }
+    },
+    {
+      "type": "shell",
+      "label": "g++ build active file",
+      "command": "/usr/bin/g++",
+      "args": [
+        "-g",
+        "${file}",
+        "-o",
+        "${fileDirname}/${fileBasenameNoExtension}"
+      ],
+      "options": {
+        "cwd": "/usr/bin"
+      }
+    }
+  ],
+  "version": "2.0.0"
+}

+ 9 - 6
src/CMakeLists.txt

@@ -1,22 +1,25 @@
 cmake_minimum_required(VERSION 2.8)
 # g++ main.cpp -std=c++17 -lpqxx -lpq -B /interfaces -o kiq
-project(untitled)
+project(kiq)
 
-#SET(INCLUDE_HEADERS "/usr/local/include/pqxx ./interfaces")
-#SET(COMPILER_FLAGS "-std=c++17 -lpqxx -lpq")
-#SET(LINKER_FLAGS "-L/usr/local/include/pqxx")
+list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
 
-#SET(CMAKE_EXE_LINKER_FLAGS  "${LINKER_FLAGS}")
-#SET(CMAKE_CXX_FLAGS "${COMPILER_FLAGS} -I${INCLUDE_HEADERS}")
+include (pistache)
 
 set(CMAKE_CXX_STANDARD 17)
 
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
+
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -lpqxx -lpq")
 set(PQXX /usr/local/include/pqxx)
 find_library(PQXX_LIB pqxx)
 find_library(PQ_LIB pq)
 
 add_executable(${PROJECT_NAME} "main.cpp" "interfaces/DatabaseConnection.cpp")
+target_include_directories(${PROJECT_NAME} PRIVATE
+  "external",
+  "src"
+)
 
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PQXX_LIB} ${PQ_LIB})