CMakeLists.txt 3.22 KB
Newer Older
Jonas Stienen's avatar
Jonas Stienen committed
1 2 3 4 5 6 7
cmake_minimum_required( VERSION 2.8 )

project( ITAConvolution )

list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )

8 9 10 11
if( NOT DEFINED ITA_CONVOLUTION_UPCONV_WITH_POWER_SAVER )
	set( ITA_CONVOLUTION_UPCONV_WITH_POWER_SAVER ON CACHE BOOL "Use power saving mode for uniform partitioned convolution (do not convolve blocks with zeros)" )
endif( )

12 13 14 15 16 17 18 19 20 21 22 23
if( NOT DEFINED ITA_CONVOLUTION_WITH_NUPCONV )
	set( ITA_CONVOLUTION_WITH_NUPCONV OFF CACHE BOOL "Build with non-uniform partitioned convolution engine" )
endif( )

if( NOT DEFINED ITA_CONVOLUTION_NUPCONV_WITH_PERFORMANCE_LOGGER )
	set( ITA_CONVOLUTION_NUPCONV_WITH_PERFORMANCE_LOGGER OFF CACHE BOOL "Include performance logger for non-uniform partitioned convolution" )
endif( )

if( NOT DEFINED ITA_CONVOLUTION_NUPCONV_WITH_XML_READER )
	set( ITA_CONVOLUTION_NUPCONV_WITH_XML_READER OFF CACHE BOOL "Include XML read/write file format for non-uniform partitioned convolution filter segmentation" )
endif( )

Jonas Stienen's avatar
Jonas Stienen committed
24
# dependencies
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
25
vista_use_package( ITABase REQUIRED FIND_DEPENDENCIES )
Jonas Stienen's avatar
Jonas Stienen committed
26 27 28 29 30 31 32 33 34
vista_use_package( ITAFFT REQUIRED FIND_DEPENDENCIES )
vista_use_package( TBB REQUIRED )

# includes
include_directories( "include" )


# sources
set( ITAConvolutionHeader
35 36 37 38 39 40
	"include/ITAUPConvolution.h"
	"include/ITAUPFilter.h"
	"include/ITAUPFilterPool.h"
	"include/ITAUPTrigger.h"
	"include/ITADirectConvolution.h"
	"include/ITAConvolutionDefinitions.h"
Jonas Stienen's avatar
Jonas Stienen committed
41 42
	)
set( ITAConvolutionSources
43 44 45 46 47 48
	"src/ITAUPConvolution.cpp"
	"src/ITAUPFilter.cpp"
	"src/ITAUPFilterPool.cpp"
	"src/ITADirectConvolution.cpp"
	"src/ITADirectConvolutionImpl.cpp"
	"src/ITADirectConvolutionImpl.h"
49
	)
Jonas Stienen's avatar
Jonas Stienen committed
50

51 52 53 54
if( ITA_CONVOLUTION_WITH_NUPCONV )
	list( APPEND ITAConvolutionHeader "include/LLC.h" "include/LLCDefinitions.h" "include/LLCFilter.h" )
	include( "src/LLC/_SourceFiles.cmake" )
endif( )
Jonas Stienen's avatar
Jonas Stienen committed
55

56
# compiler settings
57 58 59 60
if( ITA_VISTA_BUILD_STATIC )
	add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC )
endif( )
if( BUILD_SHARED_LIBS )
61
	add_definitions( -DITA_CONVOLUTION_EXPORT )
62 63 64
else( )
	add_definitions( -DITA_CONVOLUTION_STATIC -DITA_FFT_STATIC -DITA_BASE_STATIC -DITA_DATA_SOURCES_STATIC )
endif( )
Jonas Stienen's avatar
Jonas Stienen committed
65

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
66 67 68 69
if( NOT WIN32 )
	add_definitions( -std=gnu++11)
endif( )

70 71 72 73 74 75
if( ITA_CONVOLUTION_NUPCONV_WITH_PERFORMANCE_LOGGER )
	add_definitions( -DITA_CONVOLUTION_NUPCONV_WITH_PERFORMANCE_LOGGER )
endif( )

if( ITA_CONVOLUTION_NUPCONV_WITH_XML_READER )
	add_definitions( -DITA_CONVOLUTION_NUPCONV_WITH_XML_READER )
76 77
endif( )

Jonas Stienen's avatar
Jonas Stienen committed
78 79

# linker
80
add_library( ITAConvolution ${ITAConvolutionHeader} ${ITAConvolutionSources} ${ProjectSources} )
Jonas Stienen's avatar
Jonas Stienen committed
81 82 83 84 85 86 87 88 89 90 91 92 93
target_link_libraries( ITAConvolution ${VISTA_USE_PACKAGE_LIBRARIES} )


# configure
vista_configure_lib( ITAConvolution )
vista_install( ITAConvolution )
set( ITACONVOLUTION_INCLUDE_OUTDIR "${CMAKE_CURRENT_SOURCE_DIR}/include" )
vista_create_cmake_configs( ITAConvolution )
vista_create_default_info_file( ITAConvolution )

set_property( TARGET ITAConvolution PROPERTY FOLDER "ITACoreLibs" )


94 95 96 97 98 99 100
# apps
if( ITA_CORE_LIBS_WITH_APPS )
	set( ITACONVOLUTION_COMMON_BUILD TRUE )
	add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/apps" )
endif( )


Jonas Stienen's avatar
Jonas Stienen committed
101
# tests
102 103 104 105
if( ITA_CORE_LIBS_WITH_TESTS )
	set( ITACONVOLUTION_COMMON_BUILD TRUE )
	add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/tests" )
endif( )