Skip to content

Commit

Permalink
Project initialized.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zen0x7 committed Oct 25, 2024
0 parents commit 5569cf7
Show file tree
Hide file tree
Showing 11 changed files with 170 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v6
with:
push: ${{ github.ref == 'refs/heads/master' }}
tags: iantorres/authentication:latest
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/cmake-build-debug
/bin
.idea
66 changes: 66 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.25)
PROJECT(Authentication VERSION 1.0.0 LANGUAGES CXX)

SET(CMAKE_CXX_STANDARD 23)
SET(CMAKE_CXX_STANDARD_REQUIRED True)

OPTION(BUILD_TESTS "Build tests" OFF)

INCLUDE(FetchContent)

INCLUDE_DIRECTORIES(lib/headers)

FILE(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/lib/sources/*.cpp")
FILE(GLOB_RECURSE TESTS CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cc")

ADD_LIBRARY(authentication STATIC ${SOURCES})

TARGET_INCLUDE_DIRECTORIES(authentication PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/headers>
$<INSTALL_INTERFACE:include>
)

INSTALL(DIRECTORY lib/headers/ DESTINATION include)

INSTALL(TARGETS authentication
EXPORT AuthenticationTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)

INSTALL(EXPORT AuthenticationTargets
FILE AuthenticationTargets.cmake
NAMESPACE authentication::
DESTINATION lib/cmake/Authentication
)

INCLUDE(CMakePackageConfigHelpers)
CONFIGURE_PACKAGE_CONFIG_FILE(
cmake/AuthenticationConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/AuthenticationConfig.cmake
INSTALL_DESTINATION lib/cmake/Authentication
)

INSTALL(FILES
${CMAKE_CURRENT_BINARY_DIR}/AuthenticationConfig.cmake
DESTINATION lib/cmake/Authentication
)

SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)

if (BUILD_TESTS)
FETCHCONTENT_DECLARE(
googletest
URL https://github.com/google/googletest/archive/b514bdc898e2951020cbdca1304b75f5950d1f59.zip
)
SET(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FETCHCONTENT_MAKEAVAILABLE(googletest)
ENABLE_TESTING()
ADD_EXECUTABLE(tests ${TESTS} ${SOURCES})
TARGET_LINK_LIBRARIES(tests GTest::gtest_main)
INCLUDE(GoogleTest)
GTEST_DISCOVER_TESTS(tests)
endif()

16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM iantorres/boosted:amd64-latest

COPY . .

RUN mkdir build \
&& cd build \
&& cmake .. -DBUILD_TESTS=ON \
&& make \
&& cd ../bin \
&& ./tests

RUN mkdir install \
&& cd install \
&& cmake .. -DBUILD_TESTS=OFF \
&& make \
&& make install
15 changes: 15 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ZenAlgorithms Authentication
Copyright (C) 2024 Ian Torres <[email protected]>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Build

```shell
git clone https://github.com/ZenAlgorithms/Authentication.git
cd Authentication
mkdir build
cd build
cmake ..
make
make install
```
5 changes: 5 additions & 0 deletions cmake/AuthenticationConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@PACKAGE_INIT@

INCLUDE(CMakeFindDependencyMacro)

INCLUDE("${CMAKE_CURRENT_LIST_DIR}/AuthenticationTargets.cmake")
11 changes: 11 additions & 0 deletions lib/headers/authentication/container.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#pragma once

#include <string>
#include <vector>
#include <memory>
#include <regex>

namespace authentication {
struct container {
};
}
4 changes: 4 additions & 0 deletions lib/sources/container.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include <authentication/container.hpp>

namespace authentication {
}
6 changes: 6 additions & 0 deletions tests/base_test.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <gtest/gtest.h>

TEST(Base, Assertions) {
EXPECT_EQ(true, true);
EXPECT_NE(true, false);
}
6 changes: 6 additions & 0 deletions tests/implementation_test.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <gtest/gtest.h>
#include <authentication/container.hpp>

TEST(Authentication, Assertions) {
using namespace authentication;
}

0 comments on commit 5569cf7

Please sign in to comment.