CMake setup
This commit is contained in:
commit
55505b6288
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
build/
|
||||
15
CMakeLists.txt
Normal file
15
CMakeLists.txt
Normal file
@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.28)
|
||||
project(Metadump LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
add_library(metadump INTERFACE)
|
||||
target_include_directories(metadump INTERFACE include)
|
||||
|
||||
# Building the tests is optional
|
||||
option(METADUMP_BUILD_TESTS "Build metadump tests" OFF)
|
||||
if (METADUMP_BUILD_TESTS OR (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME))
|
||||
find_package(GTest REQUIRED)
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
5
include/metadump.hpp
Normal file
5
include/metadump.hpp
Normal file
@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
namespace metadump {
|
||||
|
||||
}
|
||||
2
test/CMakeLists.txt
Normal file
2
test/CMakeLists.txt
Normal file
@ -0,0 +1,2 @@
|
||||
add_executable(metadump_test_simple simple.cpp)
|
||||
target_link_libraries(metadump_test_simple PRIVATE metadump GTest::GTest)
|
||||
11
test/simple.cpp
Normal file
11
test/simple.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include "metadump.hpp"
|
||||
|
||||
TEST(METADUMP_SIMPLE, EMPTY) {
|
||||
ASSERT_TRUE(false) << "Tests not implemented!";
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user