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 50f05fd2
......@@ -10,6 +10,11 @@ vista_use_package( ITABASE REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITAFFT REQUIRED FIND_DEPENDENCIES )
vista_use_package( TBB REQUIRED )
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 )
# includes
include_directories( "include" )
......@@ -33,12 +38,16 @@ set( ITAConvolutionSources
)
# compiler
add_definitions( -DITA_BASE_DLL -DITA_FFT_DLL -DITA_CONVOLUTION_DLL -DITA_CONVOLUTION_EXPORT )
# compiler settings
if( NOT ITA_CORE_LIBS_BUILD_STATIC )
add_definitions( -DITA_CONVOLUTION_EXPORT )
else( NOT ITA_CORE_LIBS_BUILD_STATIC )
add_definitions( -DITA_FFT_STATIC -DITA_BASE_STATIC -DITA_CONVOLUTION_STATIC )
endif( NOT ITA_CORE_LIBS_BUILD_STATIC )
# linker
add_library( ITAConvolution SHARED ${ITAConvolutionHeader} ${ITAConvolutionSources} )
add_library( ITAConvolution ${ITAConvolutionHeader} ${ITAConvolutionSources} )
target_link_libraries( ITAConvolution ${VISTA_USE_PACKAGE_LIBRARIES} )
......
......@@ -20,14 +20,14 @@
#ifndef INCLUDE_WATCHER_ITA_CONVOLUTION_DEFINITIONS
#define INCLUDE_WATCHER_ITA_CONVOLUTION_DEFINITIONS
#ifdef ITA_CONVOLUTION_DLL
#ifdef ITA_CONVOLUTION_EXPORT
#define ITA_CONVOLUTION_API __declspec(dllexport)
#if ( defined WIN32 ) && !( defined ITA_CONVOLUTION_STATIC )
#ifdef ITA_CONVOLUTION_EXPORT
#define ITA_CONVOLUTION_API __declspec( dllexport )
#else
#define ITA_CONVOLUTION_API __declspec( dllimport )
#endif
#else
#define ITA_CONVOLUTION_API __declspec(dllimport)
#endif
#else
#define ITA_CONVOLUTION_API
#define ITA_CONVOLUTION_API
#endif
#endif // INCLUDE_WATCHER_ITA_CONVOLUTION_DEFINITIONS
......@@ -10,7 +10,9 @@ endif()
vista_use_package( ITAConvolution REQUIRED FIND_DEPENDENCIES )
add_definitions( -DITA_BASE_DLL -DITA_FFT_DLL -DITA_CONVOLUTION_DLL )
if( NOT ITA_CORE_LIBS_BUILD_STATIC )
add_definitions( -DITA_BASE_STATIC -DITA_FFT_STATIC -DITA_CONVOLUTION_STATIC )
endif( NOT ITA_CORE_LIBS_BUILD_STATIC )
add_executable( ITAConvolutionTest "ITAConvolutionTest.cpp" )
target_link_libraries( ITAConvolutionTest ${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