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 01c250d1
......@@ -11,6 +11,10 @@ vista_use_package( FFTW )
vista_use_package( MKL )
#vista_find_package( FFTS )
if( NOT DEFINED ITA_CORE_LIBS_BUILD_STATIC )
set( ITA_CORE_LIBS_BUILD_STATIC OFF CACHE BOOL "Build all ITA core libs in static mode" )
endif( NOT DEFINED ITA_CORE_LIBS_BUILD_STATIC )
if( NOT DEFINED ITA_FFT_WITH_FFTW3 )
set( ITA_FFT_WITH_FFTW3 ON CACHE BOOL "Build with FFTW3 for fast fourier transforms" )
endif( NOT DEFINED ITA_FFT_WITH_FFTW3 )
......@@ -55,12 +59,18 @@ if( ITA_FFT_WITH_INTEL_MKL10 )
endif( ITA_FFT_WITH_INTEL_MKL10 )
# compiler
add_definitions( -DITA_BASE_DLL -DITA_FFT_DLL -DITA_FFT_EXPORT )
# compiler settings
if( NOT ITA_CORE_LIBS_BUILD_STATIC )
add_definitions( -DITA_FFT_EXPORT )
message( "Building shared ITAFFT library" )
else( NOT ITA_CORE_LIBS_BUILD_STATIC )
add_definitions( -DITA_FFT_STATIC -DITA_BASE_STATIC )
message( "Building static ITAFFT library" )
endif( NOT ITA_CORE_LIBS_BUILD_STATIC )
# linker
add_library( ITAFFT SHARED ${ITAFFTHeader} ${ITAFFTSources} )
add_library( ITAFFT ${ITAFFTHeader} ${ITAFFTSources} )
target_link_libraries( ITAFFT ${VISTA_USE_PACKAGE_LIBRARIES} )
......
......@@ -20,14 +20,14 @@
#ifndef INCLUDE_WATCHER_ITA_FFT_DEFINITIONS
#define INCLUDE_WATCHER_ITA_FFT_DEFINITIONS
#ifdef ITA_FFT_DLL
#ifdef ITA_FFT_EXPORT
#define ITA_FFT_API __declspec(dllexport)
#if ( defined WIN32 ) && !( defined ITA_FFT_STATIC )
#ifdef ITA_FFT_EXPORT
#define ITA_FFT_API __declspec( dllexport )
#else
#define ITA_FFT_API __declspec( dllimport )
#endif
#else
#define ITA_FFT_API __declspec(dllimport)
#endif
#else
#define ITA_FFT_API
#define ITA_FFT_API
#endif
#endif // INCLUDE_WATCHER_ITA_FFT_DEFINITIONS
......@@ -10,7 +10,10 @@ endif()
vista_use_package( ITAFFT REQUIRED FIND_DEPENDENCIES )
add_definitions( -DITA_BASE_DLL -DITA_FFT_DLL )
if( NOT ITA_CORE_LIBS_BUILD_STATIC )
add_definitions( -DITA_BASE_STATIC -DITA_FFT_STATIC )
message( "Linking FFT tests against static ITA core libs" )
endif( NOT ITA_CORE_LIBS_BUILD_STATIC )
add_executable( ITAFFTTest test.cpp )
target_link_libraries( ITAFFTTest ${VISTA_USE_PACKAGE_LIBRARIES} )
......
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