Commit f9b1bd37 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

CMake config cleanup and adding (yet unused) generic path test

parent 2566a468
cmake_minimum_required( VERSION 2.8 ) cmake_minimum_required( VERSION 2.8 )
if( NOT VACORE_COMMON_BUILD ) project( VACoreTest )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
project( VACoreTest ) include( VistaCommon )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
endif()
vista_use_package( VACore REQUIRED FIND_DEPENDENCIES ) vista_use_package( VACore REQUIRED FIND_DEPENDENCIES )
if( ITA_VA_BUILD_STATIC AND DEFINED ITA_VA_BUILD_STATIC )
add_definitions( -DVABASE_STATIC -DVACORE_STATIC )
endif( ITA_VA_BUILD_STATIC AND DEFINED ITA_VA_BUILD_STATIC )
add_executable( CoreTest CoreTest.cpp ) add_executable( CoreTest CoreTest.cpp )
target_link_libraries( CoreTest ${VISTA_USE_PACKAGE_LIBRARIES} ) target_link_libraries( CoreTest ${VISTA_USE_PACKAGE_LIBRARIES} )
...@@ -43,3 +35,13 @@ vista_install( SceneConfigTest ) ...@@ -43,3 +35,13 @@ vista_install( SceneConfigTest )
vista_create_default_info_file( SceneConfigTest ) vista_create_default_info_file( SceneConfigTest )
set_property( TARGET SceneConfigTest PROPERTY FOLDER "VA/Tests/VACore" ) set_property( TARGET SceneConfigTest PROPERTY FOLDER "VA/Tests/VACore" )
add_executable( GenericPathRendererTest GenericPathRendererTest.cpp )
target_link_libraries( GenericPathRendererTest ${VISTA_USE_PACKAGE_LIBRARIES} )
vista_configure_app( GenericPathRendererTest )
vista_install( GenericPathRendererTest )
vista_create_default_info_file( GenericPathRendererTest )
set_property( TARGET GenericPathRendererTest PROPERTY FOLDER "VA/Tests/VACore" )
#include <VACore.h>
#include <VACoreFactory.h>
#include <VAException.h>
#include <iostream>
using namespace std;
IVACore* core = NULL;
void TestModuleInterface()
{
std::vector< CVAModuleInfo > viModuleInfos;
core->EnumerateModules( viModuleInfos );
if( viModuleInfos.size() )
cout << "Found " << viModuleInfos.size() << " modules" << endl;
for( size_t i = 0; i < viModuleInfos.size(); i++ )
{
cout << " + Module #" << i+1 << ": " << viModuleInfos[ i ].sName << " ( " << viModuleInfos[ i ].sDesc << " )" << endl;
}
}
int main()
{
try
{
core = VACore::CreateCoreInstance();
core->Initialize();
TestModuleInterface();
int iListenerID = core->CreateListener( "MyGPListener" );
core->SetListenerPosition( iListenerID, 0, 0, 0 );
int iSourceID = core->CreateSoundSource( "MyGPSoundSource" );
core->SetSoundSourcePosition( iSourceID, 0, 0, -2 );
cout << "q+Enter to close." << endl;
char cIn;
cin >> cIn;
core->Finalize();
}
catch( CVAException& e )
{
cerr << "Error: " << e << endl;
int iErrorCode = e.GetErrorCode();
delete core;
return iErrorCode;
}
delete core;
return 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment