mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 21:00:01 -05:00
FindOctave: Add module to find GNU octave
This commit is contained in:
committed by
Brad King
parent
81bea69bd1
commit
170bcb6fdc
@@ -0,0 +1,10 @@
|
||||
add_test(NAME FindOctave.Test COMMAND
|
||||
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
|
||||
--build-and-test
|
||||
"${CMake_SOURCE_DIR}/Tests/FindOctave/Test"
|
||||
"${CMake_BINARY_DIR}/Tests/FindOctave/Test"
|
||||
${build_generator_args}
|
||||
--build-project TestFindOctave
|
||||
--build-options ${build_options}
|
||||
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
cmake_minimum_required(VERSION 3.3)
|
||||
project(TestFindOctave CXX)
|
||||
enable_testing()
|
||||
|
||||
find_package(Octave REQUIRED COMPONENTS Development Interpreter)
|
||||
|
||||
add_definitions(-DCMAKE_EXPECTED_Octave_VERSION=${Octave_VERSION})
|
||||
|
||||
add_executable(test_tgt main.cpp)
|
||||
target_link_libraries(test_tgt Octave::Octave)
|
||||
add_test(NAME test_tgt COMMAND test_tgt)
|
||||
|
||||
add_test(NAME test_tgt_exe
|
||||
COMMAND Octave::Interpreter -q --eval "runtests('.')"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_executable(test_var main.cpp)
|
||||
target_include_directories(test_var PRIVATE ${Octave_INCLUDE_DIRS})
|
||||
target_link_libraries(test_var PRIVATE ${Octave_LIBRARIES})
|
||||
add_test(NAME test_var COMMAND test_var)
|
||||
@@ -0,0 +1,18 @@
|
||||
#include <iostream>
|
||||
#include <oct.h>
|
||||
|
||||
// http://www.dm.unibo.it/~achilles/calc/octave.html/Standalone-Programs.html
|
||||
int main(void)
|
||||
{
|
||||
int n = 2;
|
||||
Matrix a_matrix = Matrix(n, n);
|
||||
for (octave_idx_type i = 0; i < n; i++) {
|
||||
for (octave_idx_type j = 0; j < n; j++) {
|
||||
a_matrix(i, j) = (i + 1) * 10 + (j + 1);
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << a_matrix << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
%!assert(true)
|
||||
Reference in New Issue
Block a user