Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMAKELISTS_TXT::-------------------------------------------------------------
- #vcpkg install fmt:x64-mingw-static
- cmake_minimum_required(VERSION 3.30 FATAL_ERROR)
- #установка поиска библиотек в share vcpkg
- set(CMAKE_PREFIX_PATH "F:\\COMPILESOFT\\vcpkg\\installed\\x64-mingw-static\\share")
- project(vsc7 CXX)
- set(CMAKE_CXX_STANDARD 20)
- #показать пути к vcpkg include библиотекам
- include_directories("F:\\COMPILESOFT\\vcpkg\\installed\\x64-mingw-static\\include")
- link_directories("F:\\COMPILESOFT\\vcpkg\\installed\\x64-mingw-static\\lib")
- #установка параметров postgre
- set(PostgreSQL_INCLUDE_DIR "F:\\COMPILESOFT\\POSTGRE\\17.0.1\\include")
- set(PostgreSQL_LIBRARY_DIR "F:\\COMPILESOFT\\POSTGRE\\17.0.1\\lib")
- set(PostgreSQL_ROOT "F:\\COMPILESOFT\\POSTGRE\\17.0.1")
- #показать пути к postgre
- include_directories("F:\\COMPILESOFT\\POSTGRE\\17.0.1\\include")
- link_directories("F:\\COMPILESOFT\\POSTGRE\\17.0.1\\lib")
- #установка параметров open ssl
- set(OPENSSL_INCLUDE_DIR "F:/COMPILESOFT/vcpkg/packages/openssl_x64-mingw-static/include/openssl")
- set(OPENSSL_CRYPTO_LIBRARY "F:/COMPILESOFT/vcpkg/packages/openssl_x64-mingw-static/lib/libcrypto.a")
- set(OPENSSL_SSL_LIBRARY "F:/COMPILESOFT/vcpkg/packages/openssl_x64-mingw-static/lib/liblibssl.a")
- set(OPENSSL_ROOT_DIR "F:/COMPILESOFT/vcpkg/packages/openssl_x64-mingw-static")
- #показать пути к openssl
- link_directories("F:/COMPILESOFT/vcpkg/packages")
- include_directories("F:/COMPILESOFT/vcpkg/packages/openssl_x64-mingw-static/include/openssl")
- find_package(OpenSSL REQUIRED)
- if(OpenSSL_FOUND)
- message(STATUS "------------------>>>>> OpenSSL found: ${OpenSSL_VERSION}")
- message(STATUS "------------------>>>>> OpenSSL found: ${OpenSSL_ROOT}")
- else()
- message(FATAL_ERROR "OpenSSL not found")
- endif()
- find_package(libpqxx REQUIRED)
- if(libpqxx_FOUND)
- message(STATUS "------------------>>>>> libpqxx found: ${libpqxx_VERSION}")
- message(STATUS "------------------>>>>> libpqxx found: ${libpqxx_ROOT}")
- else()
- message(FATAL_ERROR "libpqxx not found")
- endif()
- # Вывод информации о найденном пакете
- add_executable(exec main.cpp)
- target_link_libraries(exec libpqxx::pqxx)
- ------------------------------------(settings.json in folder .vscode)
- {
- "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
- "cmake.configureSettings": {
- "CMAKE_TOOLCHAIN_FILE" : "F:/COMPILESOFT/vcpkg/scripts/buildsystems/vcpkg.cmake",}}
- ------------------------------------(c_cpp_properties.json in folder .vscode)
- {
- "configurations": [
- {
- "name": "Win32",
- "includePath": [
- "${workspaceFolder}/**"
- ],
- "defines": [
- "_DEBUG",
- "UNICODE",
- "_UNICODE"
- ],
- "windowsSdkVersion": "10.0.22621.0",
- "compilerPath": "F:/COMPILESOFT/mingw64/bin/g++.exe",
- "cStandard": "c17",
- "cppStandard": "c++20",
- "intelliSenseMode": "windows-gcc-x64",
- "configurationProvider": "ms-vscode.cmake-tools"
- }
- ],
- "version": 4
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement