initial commit

This commit is contained in:
2022-04-22 23:42:48 +02:00
commit 4e31c21500
7 changed files with 82 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
build
.venv

19
CMakeLists.txt Normal file
View File

@@ -0,0 +1,19 @@
cmake_minimum_required (VERSION 3.2.2)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_BUILD_TYPE Release)
project("commons" CXX)
add_definitions("-std=c++2a -g")
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
add_executable(${PROJECT_NAME} src/main.cpp)
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
#enable_testing()
#add_subdirectory(tests)

9
conanfile.txt Normal file
View File

@@ -0,0 +1,9 @@
[requires]
boost/1.78.0
spdlog/1.10.0
gtest/cci.20210126
openssl/3.0.2
nlohmann_json/3.10.5
[generators]
cmake

1
requirements.txt Normal file
View File

@@ -0,0 +1 @@
conan

15
src/main.cpp Normal file
View File

@@ -0,0 +1,15 @@
#include <iostream>
#include <boost/asio.hpp>
#include "crow.h"
int main()
{
crow::SimpleApp app;
CROW_ROUTE(app, "/")([]() {
return "Hello World";
});
app.port(18080).run();
return 0;
}

26
tests/CMakeLists.txt Normal file
View File

@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.10.1)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
set(EXEC_TEST
"test.cpp"
)
add_executable(exec_test ${EXEC_TEST})
message("CONAN INCLUDE DIRS:")
message("${CONAN_INCLUDE_DIRS}")
message("CONAN LIB DIRS:")
message("${CONAN_LIBS}")
target_include_directories(exec_test
PUBLIC
${CONAN_INCLUDE_DIRS}
)
target_link_libraries(exec_test
PUBLIC
gtest
)
add_test(NAME exec_test COMMAND exec_test)

10
tests/test.cpp Normal file
View File

@@ -0,0 +1,10 @@
#include <gtest/gtest.h> // googletest header file
TEST(StrCompare, CStrNotEqual) {
EXPECT_EQ(1, 1);
}
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}