From b550f9b3d0c5f29474ab16d44f109d3c9dd8c8d3 Mon Sep 17 00:00:00 2001 From: Jonas Stienen Date: Thu, 29 Sep 2016 14:54:03 +0200 Subject: [PATCH] Introducing a core libs wide definition (CMake configuration switch) to enable static linking for all projects/libs/tests/apps --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 32303e5..444a749 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,10 @@ vista_use_package( IPP QUIET ) vista_use_package( PCRE QUIET ) vista_use_package( SimpleIni QUIET ) +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_BASE_WITH_FASTMATH_IPP ) set( ITA_BASE_WITH_FASTMATH_IPP OFF CACHE BOOL "Build with IPP implementation of fast math ops" ) endif( NOT DEFINED ITA_BASE_WITH_FASTMATH_IPP ) @@ -173,13 +177,13 @@ endif( ITA_BASE_WITH_CONFIG_OLD_IMPL AND NOT ITA_BASE_WITH_CONFIG_SIMPLE_INI ) # ITA defaults to shared library build mode, so extra definition is required if you want to build against a static library -if( NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS ) +if( NOT ITA_CORE_LIBS_BUILD_STATIC ) add_definitions( -DITA_BASE_EXPORT ) message( "Building shared ITABase library" ) -else( NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS ) +else( NOT ITA_CORE_LIBS_BUILD_STATIC ) add_definitions( -DITA_BASE_STATIC ) message( "Building static ITABase library" ) -endif( NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS ) +endif( NOT ITA_CORE_LIBS_BUILD_STATIC ) # linker -- GitLab