Add lcd framework

This commit is contained in:
Patricia Aas 2020-11-29 17:42:03 +01:00
parent 17391073d1
commit 04c93ef20f
12 changed files with 68 additions and 0 deletions

View file

@ -15,5 +15,6 @@ conan_add_remote(NAME bincrafters INDEX 1 URL https://api.bintray.com/conan/binc
set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}/pacman/;${CMAKE_BINARY_DIR}/pomodoro/)
add_subdirectory(lcd)
add_subdirectory(pacman)
add_subdirectory(pomodoro)

View file

@ -3,7 +3,9 @@
## Exercises
* [LCD](lcd/README.md)
* [Pac-Man](pacman/README.md)
* [Pomodoro](pomodoro/README.md)
## Build instructions

5
lcd/CMakeLists.txt Normal file
View file

@ -0,0 +1,5 @@
conan_cmake_run(CONANFILE conanfile.py BASIC_SETUP CMAKE_TARGETS BUILD missing)
add_subdirectory(lib)
add_subdirectory(src)
add_subdirectory(test)

2
lcd/README.md Normal file
View file

@ -0,0 +1,2 @@
[< Back](../README.md)
# Mod(C++) - Lcd Exercise

15
lcd/conanfile.py Normal file
View file

@ -0,0 +1,15 @@
from conans import ConanFile, CMake
class ConanDependencies(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package"
default_options = {}
def requirements(self):
self.requires("gtest/1.10.0")
def imports(self):
self.copy("*.dll", dst="bin", src="bin")
self.copy("*.dylib*", dst="bin", src="lib")
self.copy('*.so*', dst='lib', src='lib')
self.copy("license*", dst="licenses", folder=True, ignore_case=True)

3
lcd/lib/CMakeLists.txt Normal file
View file

@ -0,0 +1,3 @@
file(GLOB_RECURSE sources CONFIGURE_DEPENDS "*.cpp")
add_library(liblcd ${sources})
target_link_libraries(liblcd)

5
lcd/lib/lcd.cpp Normal file
View file

@ -0,0 +1,5 @@
//
// Created by patricia on 11/29/2020.
//
#include "lcd.hpp"

8
lcd/lib/lcd.hpp Normal file
View file

@ -0,0 +1,8 @@
#ifndef LCD_LCD_HPP
#define LCD_LCD_HPP
class lcd {
};
#endif //LCD_LCD_HPP

4
lcd/src/CMakeLists.txt Normal file
View file

@ -0,0 +1,4 @@
file(GLOB_RECURSE sources CONFIGURE_DEPENDS "*.cpp")
add_executable(lcd ${sources})
target_link_libraries(lcd liblcd)

3
lcd/src/main.cpp Normal file
View file

@ -0,0 +1,3 @@
int main(int argc, char * argv[]) {
return 0;
}

10
lcd/test/CMakeLists.txt Normal file
View file

@ -0,0 +1,10 @@
enable_testing()
find_package(GTest REQUIRED)
include(GoogleTest)
add_executable(lcd_tests tests.cpp)
target_link_libraries(lcd_tests GTest::GTest liblcd)
gtest_discover_tests(lcd_tests TEST_PREFIX lcd:)
add_test(NAME monolithic COMMAND lcd_tests)

10
lcd/test/tests.cpp Normal file
View file

@ -0,0 +1,10 @@
#include <gtest/gtest.h>
TEST(LcdTest, Initial) {
EXPECT_EQ(1, 2);
}
int main(int argc, char* argv[]) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}