[cpp] Fix root project build and dependencies.
This commit is contained in:
@@ -14,18 +14,22 @@ project(
|
||||
DESCRIPTION "Practice project for learning Catch2"
|
||||
LANGUAGES CXX
|
||||
)
|
||||
message(STATUS "[Klips] Configuring example: ${PROJECT_NAME}")
|
||||
|
||||
add_compile_options(-Wall)
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
Include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v3.0.1
|
||||
GIT_TAG v3.4.0
|
||||
)
|
||||
FetchContent_MakeAvailable(Catch2)
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(test)
|
||||
add_library(klips SHARED src/klips.cpp)
|
||||
target_include_directories(klips PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
|
||||
add_executable(test_klips src/test_klips.cpp)
|
||||
target_link_libraries(test_klips PUBLIC Catch2::Catch2WithMain klips)
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
################################################################################
|
||||
## Author: Shaun Reed ##
|
||||
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||
## About: Practice project for testing with catch2 framework ##
|
||||
## ##
|
||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||
################################################################################
|
||||
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
project(
|
||||
#[[NAME]] Catch2
|
||||
VERSION 1.0
|
||||
DESCRIPTION "Practice project for learning Catch2"
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
add_compile_options(-Wall)
|
||||
add_definitions("-std=c++17")
|
||||
|
||||
add_library(klips SHARED klips.cpp)
|
||||
target_include_directories(klips PRIVATE ${CMAKE_SOURCE_DIR}/include)
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "../bin/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
|
||||
#include "klips.hpp"
|
||||
#include "type_name.hpp"
|
||||
|
||||
@@ -139,7 +140,7 @@ template <> template <bool must_find> void test_config_get<std::string>::run() {
|
||||
TEMPLATE_PRODUCT_TEST_CASE("Test", "[test]", test_config_get,
|
||||
(int, std::string)) {
|
||||
TT();
|
||||
TestType t;
|
||||
// TestType t;
|
||||
test_config_get<int> s;
|
||||
s.template run<true>();
|
||||
// TestType t;
|
||||
@@ -1,22 +0,0 @@
|
||||
################################################################################
|
||||
## Author: Shaun Reed ##
|
||||
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
||||
## About: Practice project for testing with catch2 framework ##
|
||||
## ##
|
||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||
################################################################################
|
||||
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
project(
|
||||
#[[NAME]] Catch2
|
||||
VERSION 1.0
|
||||
DESCRIPTION "Practice project for learning Catch2"
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
add_compile_options(-Wall)
|
||||
|
||||
add_executable(test_klips test_klips.cpp)
|
||||
target_link_libraries(test_klips PRIVATE Catch2::Catch2WithMain klips)
|
||||
target_include_directories(test_klips PRIVATE ${CMAKE_SOURCE_DIR}/include)
|
||||
Reference in New Issue
Block a user