Renewing cmake config v2

parent 9961c341
......@@ -10,14 +10,6 @@ vista_use_package( ITABase REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITADataSources REQUIRED FIND_DEPENDENCIES )
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_VISTA_BUILD_STATIC )
set( ITA_VISTA_BUILD_STATIC OFF CACHE BOOL "Build against static ViSTA libraries" )
endif( NOT DEFINED ITA_VISTA_BUILD_STATIC )
# includes
include_directories( "include" )
......@@ -51,27 +43,21 @@ set( ITASamplerSources
# compiler settings
if( NOT ITA_CORE_LIBS_BUILD_STATIC )
add_definitions( -DITA_SAMPLER_EXPORT )
else( NOT ITA_CORE_LIBS_BUILD_STATIC )
add_definitions( -DITA_BASE_STATIC -ITA_DATA_SOURCES_STATIC -DITA_SAMPLER_STATIC )
set( BUILD_SHARED_LIBS_TEMP ${BUILD_SHARED_LIBS} )
if( BUILD_SHARED_LIBS )
set( BUILD_SHARED_LIBS OFF )
message( "Ignoring activated BUILD_SHARED_LIBS temporary because static ITA core libs requested" )
endif( BUILD_SHARED_LIBS )
endif( NOT ITA_CORE_LIBS_BUILD_STATIC )
if( ITA_VISTA_BUILD_STATIC )
add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC )
endif( ITA_VISTA_BUILD_STATIC )
endif( )
if( BUILD_SHARED_LIBS )
add_definitions( -DITA_SAMPLER_EXPORT )
else( )
add_definitions( -DITA_SAMPLER_STATIC -DITA_CTC_STATIC -DITA_CONVOLUTION_STATIC -DITA_FFT_STATIC -DITA_BASE_STATIC -DITA_DATA_SOURCES_STATIC )
endif( )
# linker
add_library( ITASampler ${ITASamplerHeader} ${ITASamplerSources} )
target_link_libraries( ITASampler ${VISTA_USE_PACKAGE_LIBRARIES} )
set( BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_TEMP} )
# config
vista_configure_lib( ITASampler )
......@@ -84,5 +70,7 @@ set_property( TARGET ITASampler PROPERTY FOLDER "ITACoreLibs" )
# tests
set( ITASAMPLER_COMMON_BUILD TRUE )
add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/tests" )
if( ITA_CORE_LIBS_WITH_TESTS )
set( ITASAMPLER_COMMON_BUILD TRUE )
add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/tests" )
endif( )
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