Switching to default dynamic lib build mode by changing base definition...

Switching to default dynamic lib build mode by changing base definition behavior. If you do not define anything, you will end up with a shared library, now.
parent 1c15cd44
......@@ -8,6 +8,11 @@ list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
if( NOT DEFINED ITA_VA_BUILD_STATIC )
set( ITA_VA_BUILD_STATIC OFF CACHE BOOL "Build static VA libs" )
endif( NOT DEFINED ITA_VA_BUILD_STATIC )
if( NOT DEFINED ITA_VABASE_INSTALL_WITH_DLLS )
set( ITA_VABASE_INSTALL_WITH_DLLS ON CACHE BOOL "Install VABase with depending DLLs (use this switch with care)" )
endif( NOT DEFINED ITA_VABASE_INSTALL_WITH_DLLS )
......@@ -22,7 +27,11 @@ include( "src/_SourceFiles.cmake" )
include_directories( "include" )
add_definitions( -DVABASE_DLL -DVABASE_EXPORTS )
if( NOT ITA_VA_BUILD_STATIC )
add_definitions( -DVABASE_EXPORT )
else( NOT ITA_VA_BUILD_STATIC )
add_definitions( -VABASE_STATIC )
endif( NOT ITA_VA_BUILD_STATIC )
add_library( VABase "${ProjectSources}" )
target_link_libraries( VABase ${VISTA_USE_PACKAGE_LIBRARIES} )
......
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics
* VVV VVV AAA Virtual Acoustics (VA)
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA)
* VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*
* File: VABaseDefinitions.h
*
* Purspose: Global definitions and declarations
*
* Author(s): Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
* --------------------------------------------------------------------------------------------
*/
// $Id: VABaseDefinitions.h 4599 2016-02-29 20:02:48Z stienen $
#ifndef __VABASE_DEFINITIONS_H__
#define __VABASE_DEFINITIONS_H__
#ifndef VA_INCLUDE_GUARD_VABASE_DEFINITIONS
#define VA_INCLUDE_GUARD_VABASE_DEFINITIONS
#include <string>
#include <vector>
#include <cmath>
// Definition of import-/export-conventions for the library
#if defined( _MSC_VER ) && defined( VABASE_DLL )
// Dynamic library
#if ( defined WIN32 ) && !( defined VABASE_STATIC )
#ifdef VABASE_EXPORTS
#define VABASE_API __declspec(dllexport)
#define VABASE_API __declspec( dllexport )
#define VABASE_IMPL_TEMPLATE
#else
#define VABASE_API __declspec(dllimport)
#define VABASE_IMPL_TEMPLATE extern
#define VABASE_API __declspec( dllimport )
#define VABASE_IMPL_TEMPLATE
#endif
#else
// Static library
#define VABASE_API
#define VABASE_IMPL_TEMPLATE
#define VABASE_IMPL_TEMPLATE
#endif
// Disable STL template-instantiation warning with DLLs for Visual C++
#if defined( _MSC_VER ) || defined( WIN32 )
#pragma warning(disable: 4251)
#pragma warning( disable: 4251 )
#endif
// Define necessary typedef from stdint.h for Microsoft compilers before Visual C++ 2010
......@@ -500,4 +488,4 @@ public:
};
#endif // __VABASE_DEFINITIONS_H__
#endif // VA_INCLUDE_GUARD_VABASE_DEFINITIONS
......@@ -10,8 +10,6 @@
*
* --------------------------------------------------------------------------------------------
*/
// $Id: VASamples.h 2199 2011-11-23 21:30:53Z stienen $
#ifndef VA_INCLUDE_GUARD_VABASE_SAMPLES
#define VA_INCLUDE_GUARD_VABASE_SAMPLES
......
......@@ -10,7 +10,10 @@ endif()
vista_use_package( VABase REQUIRED FIND_DEPENDENCIES )
add_definitions( -DVABASE_DLL )
if( ITA_VA_BUILD_STATIC AND DEFINED ITA_VA_BUILD_STATIC )
add_definitions( -DVABASE_STATIC )
endif( ITA_VA_BUILD_STATIC AND DEFINED ITA_VA_BUILD_STATIC )
add_executable( ObjectTest ObjectTest.cpp )
......
Markdown is supported
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