CMakeLists.txt 2.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( VABase )

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

include( VistaCommon )

8 9 10
if( NOT DEFINED ITA_VABASE_WITH_TESTS )
	set( ITA_VABASE_WITH_TESTS OFF CACHE BOOL "Build VABase with tests" )
endif( NOT DEFINED ITA_VABASE_WITH_TESTS )
11

12 13 14 15
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 )

16 17 18 19
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 )

20 21 22 23
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 )

24

Jonas Stienen's avatar
Jonas Stienen committed
25 26 27 28 29 30 31 32 33
vista_use_package( VistaCoreLibs REQUIRED COMPONENTS VistaInterProcComm )


# Including the source files of all source subfolders recursively
include( "include/_SourceFiles.cmake" )
include( "src/_SourceFiles.cmake" )

include_directories( "include" )

34 35 36 37
if( NOT ITA_VA_BUILD_STATIC )
	add_definitions( -DVABASE_EXPORT )
else( NOT ITA_VA_BUILD_STATIC )
	add_definitions( -VABASE_STATIC )
38 39 40 41 42
	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 )
43
endif( NOT ITA_VA_BUILD_STATIC )
Jonas Stienen's avatar
Jonas Stienen committed
44

45 46 47 48
if( ITA_VISTA_BUILD_STATIC )
	add_definitions( -DVISTAINTERPROCCOMM_STATIC )
endif( ITA_VISTA_BUILD_STATIC )

Jonas Stienen's avatar
Jonas Stienen committed
49 50 51
add_library( VABase "${ProjectSources}" )
target_link_libraries( VABase ${VISTA_USE_PACKAGE_LIBRARIES} )

52 53
set( BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_TEMP} )

Jonas Stienen's avatar
Jonas Stienen committed
54 55 56 57 58 59 60 61 62 63

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

set_property( TARGET VABase PROPERTY FOLDER "VA" )

64 65 66 67
if( ITA_VABASE_INSTALL_WITH_DLLS OR ITA_VA_INSTALL_WITH_DLLS )
	vista_install_all_dlls( bin )
endif()

Jonas Stienen's avatar
Jonas Stienen committed
68 69

# tests
70
if( ITA_VA_WITH_TESTS OR ITA_VABASE_WITH_TESTS )
Dipl.-Ing. Jonas Stienen's avatar
Style  
Dipl.-Ing. Jonas Stienen committed
71
	set( VABASE_COMMON_BUILD TRUE )
72 73
	add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/tests" )
endif()