diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ded4b8..6e4f709 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,4 +13,7 @@ endif () include(${CMAKE_BINARY_DIR}/conan.cmake) conan_add_remote(NAME bincrafters INDEX 1 URL https://api.bintray.com/conan/bincrafters/public-conan) +set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}/pacman/;${CMAKE_BINARY_DIR}/pomodoro/) + add_subdirectory(pacman) +add_subdirectory(pomodoro) diff --git a/pacman/CMakeLists.txt b/pacman/CMakeLists.txt index cf62a5c..fea05a7 100644 --- a/pacman/CMakeLists.txt +++ b/pacman/CMakeLists.txt @@ -1,8 +1,5 @@ - conan_cmake_run(CONANFILE conanfile.py BASIC_SETUP CMAKE_TARGETS BUILD missing) -set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}/pacman/) - find_package(sdl2 REQUIRED) find_package(sdl2_image REQUIRED) include_directories(${sdl2_INCLUDE_DIRS} ${sdl2_image_INCLUDE_DIRS}) diff --git a/pacman/test/CMakeLists.txt b/pacman/test/CMakeLists.txt index a4982ef..f2e551c 100644 --- a/pacman/test/CMakeLists.txt +++ b/pacman/test/CMakeLists.txt @@ -3,8 +3,8 @@ find_package(GTest REQUIRED) include(GoogleTest) -add_executable(tests tests.cpp) -target_link_libraries(tests GTest::GTest libpacman) +add_executable(pacman_tests tests.cpp) +target_link_libraries(pacman_tests GTest::GTest libpacman) -gtest_discover_tests(tests TEST_PREFIX pacman:) -add_test(NAME monolithic COMMAND tests) \ No newline at end of file +gtest_discover_tests(pacman_tests TEST_PREFIX pacman:) +add_test(NAME monolithic COMMAND pacman_tests) \ No newline at end of file diff --git a/pomodoro/CMakeLists.txt b/pomodoro/CMakeLists.txt new file mode 100644 index 0000000..570c9d9 --- /dev/null +++ b/pomodoro/CMakeLists.txt @@ -0,0 +1,11 @@ +conan_cmake_run(CONANFILE conanfile.py BASIC_SETUP CMAKE_TARGETS BUILD missing) + +find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +add_subdirectory(lib) +add_subdirectory(src) +add_subdirectory(test) diff --git a/pomodoro/README.md b/pomodoro/README.md new file mode 100644 index 0000000..bbe49bb --- /dev/null +++ b/pomodoro/README.md @@ -0,0 +1,2 @@ +[< Back](../README.md) +# Mod(C++) - Pomodoro Exercise diff --git a/pomodoro/conanfile.py b/pomodoro/conanfile.py new file mode 100644 index 0000000..6682161 --- /dev/null +++ b/pomodoro/conanfile.py @@ -0,0 +1,23 @@ +from conans import ConanFile, CMake + +class ConanDependencies(ConanFile): + + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "qt", "virtualrunenv" + + default_options = {} + + def requirements(self): + # self.requires("gtest/1.10.0") + self.requires("qt/5.15.2@bincrafters/stable") + + 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('*', dst='libexec', src='libexec') + self.copy('*', dst='plugins', src='plugins') + self.copy('*', dst='qml', src='qml') + self.copy('*', dst='translations', src='translations') + self.copy('*', dst='resources', src='resources') + self.copy("license*", dst="licenses", folder=True, ignore_case=True) \ No newline at end of file diff --git a/pomodoro/lib/CMakeLists.txt b/pomodoro/lib/CMakeLists.txt new file mode 100644 index 0000000..de0b0cb --- /dev/null +++ b/pomodoro/lib/CMakeLists.txt @@ -0,0 +1,3 @@ +file(GLOB_RECURSE sources CONFIGURE_DEPENDS "*.cpp") +add_library(libpomodoro ${sources}) +target_link_libraries(libpomodoro Qt5::Core Qt5::Gui Qt5::Widgets) \ No newline at end of file diff --git a/pomodoro/lib/Pomodoro.cpp b/pomodoro/lib/Pomodoro.cpp new file mode 100644 index 0000000..f51a96d --- /dev/null +++ b/pomodoro/lib/Pomodoro.cpp @@ -0,0 +1,5 @@ +// +// Created by patricia on 11/28/2020. +// + +#include "Pomodoro.hpp" diff --git a/pomodoro/lib/Pomodoro.hpp b/pomodoro/lib/Pomodoro.hpp new file mode 100644 index 0000000..3f1d120 --- /dev/null +++ b/pomodoro/lib/Pomodoro.hpp @@ -0,0 +1,8 @@ +#ifndef POMODORO_POMODORO_HPP +#define POMODORO_POMODORO_HPP + +class Pomodoro { + +}; + +#endif //POMODORO_POMODORO_HPP diff --git a/pomodoro/src/CMakeLists.txt b/pomodoro/src/CMakeLists.txt new file mode 100644 index 0000000..b597e71 --- /dev/null +++ b/pomodoro/src/CMakeLists.txt @@ -0,0 +1,4 @@ +file(GLOB_RECURSE sources CONFIGURE_DEPENDS "*.cpp") +add_executable(pomodoro ${sources}) +target_link_libraries(pomodoro libpomodoro Qt5::Core Qt5::Gui Qt5::Widgets) + diff --git a/pomodoro/src/main.cpp b/pomodoro/src/main.cpp new file mode 100644 index 0000000..d0900e8 --- /dev/null +++ b/pomodoro/src/main.cpp @@ -0,0 +1,11 @@ +#include +#include +#include "../lib/Pomodoro.hpp" + +int main(int argc, char * argv[]) { + QApplication app (argc, argv); + QPushButton button ("Hello world !"); + Pomodoro pomodoro; + button.show(); + return app.exec(); +} diff --git a/pomodoro/test/CMakeLists.txt b/pomodoro/test/CMakeLists.txt new file mode 100644 index 0000000..22cb7b0 --- /dev/null +++ b/pomodoro/test/CMakeLists.txt @@ -0,0 +1,10 @@ +enable_testing() +find_package(GTest REQUIRED) + +include(GoogleTest) + +add_executable(pomodoro_tests tests.cpp) +target_link_libraries(pomodoro_tests GTest::GTest libpomodoro) + +gtest_discover_tests(pomodoro_tests TEST_PREFIX pomodoro:) +add_test(NAME monolithic COMMAND pomodoro_tests) \ No newline at end of file diff --git a/pomodoro/test/tests.cpp b/pomodoro/test/tests.cpp new file mode 100644 index 0000000..866f76b --- /dev/null +++ b/pomodoro/test/tests.cpp @@ -0,0 +1,10 @@ +#include + +TEST(PomodoroTest, Init) { + EXPECT_EQ(1, 2); +} + +int main(int argc, char* argv[]) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file