-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modernized CMake, enabled support for CMake's FetContent-API
- Loading branch information
Showing
13 changed files
with
425 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
examples/extcmake_fetchcontent_tinymat_test/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# set minimum required CMake-Version | ||
cmake_minimum_required(VERSION 3.23) | ||
|
||
# set Project name | ||
project(extcmake_fetchcontent_tinymat_test LANGUAGES CXX) | ||
|
||
# include TinyMAT via FetchContent-API: | ||
# ... first load the FetchContent-API: | ||
include(FetchContent) # once in the project to include the module | ||
# ... now declare TinyMAT | ||
FetchContent_Declare(TinyMAT | ||
GIT_REPOSITORY https://github.com/jkriege2/TinyMAT.git | ||
# GIT_TAG 3.1.0.0 | ||
) | ||
|
||
# ... finally make TinyMAT available | ||
FetchContent_MakeAvailable(TinyMAT) | ||
|
||
add_executable(${PROJECT_NAME} | ||
extcmake_fetchcontent_tinymat_test.cpp | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME} TinyMAT::TinyMAT) |
22 changes: 22 additions & 0 deletions
22
examples/extcmake_fetchcontent_tinymat_test/extcmake_fetchcontent_tinymat_test.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "tinymatwriter.h" | ||
|
||
|
||
using namespace std; | ||
|
||
|
||
int main() { | ||
TinyMATWriterFile* mat=TinyMATWriter_open("extcmake_tinymat_test.mat"); | ||
if (mat) { | ||
// a matrix in row-major form | ||
double mat1[6]={ | ||
1,2, | ||
3,4, | ||
5,6 | ||
}; | ||
|
||
TinyMATWriter_writeMatrix2D_rowmajor(mat, "matrix1", mat1, 2,3); | ||
|
||
TinyMATWriter_close(mat); | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.