Skip to content
Snippets Groups Projects
Commit 23b4768d authored by Huste, Tobias's avatar Huste, Tobias
Browse files

Merge branch '1-fix-linting-violations-in-code-and-errors-in-cmake-project' into 'main'

Fix linting violations and errors in cmake project

Closes #1

See merge request hifis/software/education/gitlab-ci/exercise-project!2
parents 7c22f4c7 e2d3fd5c
No related branches found
No related tags found
1 merge request!2Fix linting violations and errors in cmake project
......@@ -4,12 +4,12 @@
cmake_minimum_required(VERSION 3.14)
project (helloWorld)
include_directories(${CMAKE_SOURCE_DIR})
add_subdirectory(src)
# GoogleTest requires at least C++11
set(CMAKE_CXX_STANDARD 11)
add_executable(helloWorld src/helloworld.cpp src/main.cpp)
# Setup GoogleTest and build tests
include(FetchContent)
FetchContent_Declare(
......
# Copyright (c) 2021 Helmholtz-Zentrum Dresden - Rossendorf e.V.
#
# SPDX-License-Identifier: MIT
set(SRCS main.cpp helloworld.cpp)
add_executable(helloWorld ${SRCS})
......@@ -5,7 +5,7 @@
#include <string>
#include <cstdlib>
#include "./helloworld.h"
#include "src/helloworld.h"
std::string getUserNameViaEnv() {
// Return content of the variable GITLAB_USER_NAME
......
......@@ -2,12 +2,12 @@
//
// SPDX-License-Identifier: MIT
#ifndef HELLOWORLD_H_
#define HELLOWORLD_H_
#ifndef SRC_HELLOWORLD_H_
#define SRC_HELLOWORLD_H_
#include <string>
// Return content of the variable GITLAB_USER_NAME
std::string getUserNameViaEnv();
#endif // HELLOWORLD_H_
#endif // SRC_HELLOWORLD_H_
......@@ -4,7 +4,7 @@
#include <iostream>
#include "./helloworld.h"
#include "src/helloworld.h"
int main() {
std::string gitlabUserName = getUserNameViaEnv();
......
......@@ -5,7 +5,7 @@
#include <gtest/gtest.h>
#include <cstdlib>
#include "../src/helloworld.h"
#include "src/helloworld.h"
namespace {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment