Compare commits

...

2 Commits

Author SHA1 Message Date
Karl-Wilfried Zimmer
6ff2cf0d85 more wide reaching build ignoring 2023-12-31 19:17:56 +01:00
Karl-Wilfried Zimmer
cb21cc1a6d snap 2023-12-31 16:21:44 +01:00
10 changed files with 40 additions and 24 deletions

1
.gitignore vendored
View File

@ -120,3 +120,4 @@ fabric.properties
*.fatbin *.fatbin
.idea/ .idea/
*build*/

View File

@ -2,14 +2,20 @@ cmake_minimum_required(VERSION 3.14)
project(Geometry VERSION 0.1 LANGUAGES CXX) project(Geometry VERSION 0.1 LANGUAGES CXX)
include(FetchContent)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include(CTest)
endif ()
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR GEOMETRY_BUILD_TESTING)
add_subdirectory(tests)
endif () endif ()
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
include(FetchContent)
FetchContent_Declare( FetchContent_Declare(
eigen eigen
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
@ -17,8 +23,6 @@ FetchContent_Declare(
) )
FetchContent_MakeAvailable(eigen) FetchContent_MakeAvailable(eigen)
#include_directories(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/Geometry)
add_subdirectory(src) add_subdirectory(src)
add_subdirectory(apps) add_subdirectory(apps)

View File

@ -1,3 +1,3 @@
add_executable(app main.cpp) add_executable(app main.cpp)
target_link_libraries(app PUBLIC Eigen3::Eigen Geometry) target_link_libraries(app PUBLIC Geometry)

View File

@ -1,5 +1,5 @@
#include "Geometry/dummy.h" #include "Geometry/dummy.hpp"
#include "main.h" #include "main.hpp"
int main(){ int main(){
cout<<"Hello World"<<endl; cout<<"Hello World"<<endl;
eigenExample(); eigenExample();

View File

@ -1,10 +0,0 @@
//
// Created by nb on 31.12.23.
//
#ifndef GEOMETRY_DUMMY_H
#define GEOMETRY_DUMMY_H
void eigenExample();
#endif //GEOMETRY_DUMMY_H

View File

@ -0,0 +1,10 @@
//
// Created by nb on 31.12.23.
//
#ifndef GEOMETRY_DUMMY_HPP
#define GEOMETRY_DUMMY_HPP
void eigenExample();
#endif //GEOMETRY_DUMMY_HPP

View File

@ -2,8 +2,8 @@
// Created by nb on 31.12.23. // Created by nb on 31.12.23.
// //
#ifndef GEOMETRY_MAIN_H #ifndef GEOMETRY_MAIN_HPP
#define GEOMETRY_MAIN_H #define GEOMETRY_MAIN_HPP
#include <iostream> #include <iostream>
#include <Eigen/Dense> #include <Eigen/Dense>
@ -12,4 +12,4 @@ using namespace std;
int main(); int main();
#endif //GEOMETRY_MAIN_H #endif //GEOMETRY_MAIN_HPP

View File

@ -1,6 +1,6 @@
set(HEADER_LIST "${Geometry_SOURCE_DIR}/include/Geometry/dummy.h") set(HEADER_LIST "${Geometry_SOURCE_DIR}/include/Geometry/dummy.hpp")
add_library(Geometry Dummy.cpp ${HEADER_LIST}) add_library(Geometry dummy.cpp ${HEADER_LIST})
target_include_directories(Geometry PUBLIC "${PROJECT_SOURCE_DIR}/include") target_include_directories(Geometry PUBLIC "${PROJECT_SOURCE_DIR}/include")

View File

@ -1,7 +1,7 @@
// //
// Created by nb on 31.12.23. // Created by nb on 31.12.23.
// //
#include "Geometry/dummy.h" #include "Geometry/dummy.hpp"
#include <Eigen/Dense> #include <Eigen/Dense>
#include <iostream> #include <iostream>

11
tests/CMakeLists.txt Normal file
View File

@ -0,0 +1,11 @@
FetchContent_Declare(
catch
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.6)
FetchContent_MakeAvailable(catch)
add_executable(testlib testgeometry.cpp)
target_link_libraries(testlib PRIVATE Geometry Catch2::Catch2)
add_test(NAME testlibtest COMMAND testlib)