summaryrefslogtreecommitdiffstats
path: root/Tests/FindOctave/Test/CMakeLists.txt
blob: 73aa8319d8886c28a7f36b139e8e62ad0ae7825b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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_executable(test_octinterp_tgt interp_main.cpp)
target_link_libraries(test_octinterp_tgt Octave::Octinterp)
add_test(NAME test_octinterp_tgt COMMAND test_octinterp_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)