Skip to content

Instantly share code, notes, and snippets.

View leozz37's full-sized avatar
🛠️
Hope is not a strategy

Leonardo Lima leozz37

🛠️
Hope is not a strategy
View GitHub Profile
CPMAddPackage(
NAME nlohmann_json
GITHUB_REPOSITORY nlohmann/json
VERSION 3.6.1)
cmake_minimum_required(VERSION 3.18)
project(cpm_example)
set(CMAKE_CXX_STANDARD 17)
add_executable(cpm_example src/main.cpp)
CPMAddPackage(
NAME spdlog
GITHUB_REPOSITORY gabime/spdlog
VERSION 1.7.0)
target_link_libraries(cpm_example
spdlog)
#include <spdlog/spdlog.h>
int main() {
spdlog::info("Hello world!");
return 0;
}
set(CPM_DOWNLOAD_VERSION 0.27.2)
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
message(STATUS "Downloading CPM.cmake")
file(DOWNLOAD https://github.com/TheLartians/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake ${CPM_DOWNLOAD_LOCATION})
endif()
include(${CPM_DOWNLOAD_LOCATION})
cmake_minimum_required(VERSION 3.18)
project(cpm_example)
set(CMAKE_CXX_STANDARD 17)
set(CPM_DOWNLOAD_VERSION 0.27.2)
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
@leozz37
leozz37 / main.py
Created August 16, 2020 09:34
Snippet used for a Medium article
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Hello, Medium!'
app.run(host='0.0.0.0', port=8000)
Flask==1.1.2
pytest==6.0.1
pytest-cov==2.10.1