From 49ed11667e018ef5a481d70e101a9ac7fb805a41 Mon Sep 17 00:00:00 2001 From: Jonas Stienen Date: Fri, 6 Jan 2017 20:57:15 +0100 Subject: [PATCH] Improving and testing new cmake configuration, also adding ignores --- .gitignore | 27 ++++++++++++++++++ CMakeLists.txt | 74 +++++++++++++++++++++----------------------------- 2 files changed, 58 insertions(+), 43 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a0cf2d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +HTML +*.bat +*.mat +*.pdf +*.dll +*.exe +*.so* +Thumbs.db +.DS_Store +*.asv +*.wav +*.xlsx +*.docx +*.dll +*.csv +*.h5 +*.ita +*.fig +*.png +*.jpeg +*.sofa +*.spk +*.unv +*.stl +svnaccess +*.lib +*.exp diff --git a/CMakeLists.txt b/CMakeLists.txt index 45bc33a..428b5f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,41 +12,33 @@ 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_VISTA_BUILD_STATIC ) - set( ITA_VISTA_BUILD_STATIC OFF CACHE BOOL "Build against static ViSTA libraries" ) -endif( NOT DEFINED ITA_VISTA_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 ) +endif() if( NOT DEFINED ITA_BASE_WITH_FASTMATH_ASSEMBLER ) set( ITA_BASE_WITH_FASTMATH_ASSEMBLER OFF CACHE BOOL "Build with assembler implementation of fast math ops" ) -endif( NOT DEFINED ITA_BASE_WITH_FASTMATH_ASSEMBLER ) +endif() if( NOT DEFINED ITA_BASE_WITH_SNDFILE ) set( ITA_BASE_WITH_SNDFILE ON CACHE BOOL "Build with libsndfile to read/write audio samples for ITASampleFrame" ) -endif( NOT DEFINED ITA_BASE_WITH_SNDFILE ) +endif() if( NOT DEFINED ITA_BASE_WITH_OLD_ATOMICS ) set( ITA_BASE_WITH_OLD_ATOMICS OFF CACHE BOOL "Build with old atomic code for non-C++11 compatible compilers" ) -endif( NOT DEFINED ITA_BASE_WITH_OLD_ATOMICS ) +endif() if( NOT DEFINED ITA_BASE_WITH_REGULAR_EXPRESSIONS ) set( ITA_BASE_WITH_REGULAR_EXPRESSIONS OFF CACHE BOOL "Build with old regular expressions code for string manipulation" ) -endif( NOT DEFINED ITA_BASE_WITH_REGULAR_EXPRESSIONS ) +endif() if( NOT DEFINED ITA_BASE_WITH_CONFIG_OLD_IMPL ) set( ITA_BASE_WITH_CONFIG_OLD_IMPL OFF CACHE BOOL "Build with old INI file configuration implementation (uses legacy regular expressions)" ) -endif( NOT DEFINED ITA_BASE_WITH_CONFIG_OLD_IMPL ) +endif() if( NOT DEFINED ITA_BASE_WITH_OLD_RAVEN_OPS ) set( ITA_BASE_WITH_OLD_RAVEN_OPS OFF CACHE BOOL "Build with old ITAOps helper functions implementation (legacy code for RAVEN compatibility)" ) -endif( NOT DEFINED ITA_BASE_WITH_OLD_RAVEN_OPS ) +endif() # includes @@ -118,11 +110,11 @@ set( ITABaseSources if( WIN32 ) list( APPEND ITABaseHeader "include/ITAHPT.h" "include/ITAMutex.h" "include/ITATimer.h" ) list( APPEND ITABaseSources "src/ITAHPT.cpp" "src/ITAMutex.cpp" "src/ITATimer.cpp" ) -else( WIN32) +else() add_definitions( -DUSE_SIMPLEINI ) list( APPEND ITABaseSources "src/ITAPosixRealtimeClock.cpp" "src/simpleini/SimpleIni.h" "src/simpleini/ConvertUTF.h" "src/simpleini/ConvertUTF.c" ) list( APPEND ITABaseSources "src/ITAConfigUtilsSimpleIniImpl.cpp" ) -endif( WIN32 ) +endif() if( VSNDFILE_FOUND AND ITA_BASE_WITH_SNDFILE ) @@ -139,16 +131,16 @@ if( VSNDFILE_FOUND AND ITA_BASE_WITH_SNDFILE ) "src/libsndfileAudiofileWriter.cpp" ) add_definitions( -DITABASE_WITH_SNDFILE ) -endif( VSNDFILE_FOUND AND ITA_BASE_WITH_SNDFILE ) +endif() if( VIPP_FOUND AND ITA_BASE_WITH_FASTMATH_IPP ) set( ITABaseSources "${ITABaseSources}" "src/ITAFastMathImplIPP.cpp" ) elseif( ITA_BASE_WITH_FASTMATH_ASSEMBLER ) set( ITABaseSources "${ITABaseSources}" "src/ITAFastMathImplAssembler.cpp" ) # not recommended -else( VIPP_FOUND AND ITA_BASE_WITH_FASTMATH_IPP ) +else() set( ITABaseSources "${ITABaseSources}" "src/ITAFastMathImpl.cpp" ) -endif( VIPP_FOUND AND ITA_BASE_WITH_FASTMATH_IPP ) +endif() if( ITA_BASE_WITH_OLD_ATOMICS ) set( ITABaseHeader "${ITABaseHeader}" "include/ITAAtomicOps.h" "include/ITAAtomicPrimitives.h" ) @@ -157,46 +149,42 @@ if( ITA_BASE_WITH_OLD_ATOMICS ) else( WIN32 ) set( ITABaseSources "${ITABaseSources}" "src/ITAAtomicOpsGCCBuiltinsImpl.cpp" ) endif( WIN32 ) -endif( ITA_BASE_WITH_OLD_ATOMICS ) +endif() if( ITA_BASE_WITH_OLD_RAVEN_OPS ) set( ITABaseHeader "${ITABaseHeader}" "include/ITAOps.h" ) set( ITABaseSources "${ITABaseSources}" "src/ITAOps.cpp" ) -endif( ITA_BASE_WITH_OLD_RAVEN_OPS ) +endif() if( VPCRE_FOUND AND ITA_BASE_WITH_REGULAR_EXPRESSIONS ) - list( APPEND ITABaseHeader "include/ITAConfigUtils.h" ) - list( APPEND ITABaseSources "src/ITAConfigUtils.cpp" "src/ITAStringUtilsPCRE.cpp" ) add_definitions( -DPCRE_STATIC ) -else( VPCRE_FOUND AND ITA_BASE_WITH_REGULAR_EXPRESSIONS ) - list( APPEND ITABaseSources "src/ITAConfigUtils.cpp" "src/ITAStringUtils.cpp" ) -endif( VPCRE_FOUND AND ITA_BASE_WITH_REGULAR_EXPRESSIONS ) + list( APPEND ITABaseHeader "include/ITAConfigUtils.h" ) + list( APPEND ITABaseSources "src/ITAStringUtilsPCRE.cpp" "src/ITAConfigUtils.cpp" ) +else() + list( APPEND ITABaseSources "src/ITAStringUtils.cpp" ) +endif() if( ITA_BASE_WITH_CONFIG_OLD_IMPL AND NOT ITA_BASE_WITH_CONFIG_SIMPLE_INI ) if( NOT ITA_BASE_WITH_REGULAR_EXPRESSIONS ) message( FATAL_ERROR "ITABase old config implementation requires regular expressions. Please activate." ) - endif( NOT ITA_BASE_WITH_REGULAR_EXPRESSIONS ) + endif() list( APPEND ITABaseSources "src/ITAConfigUtilsWin32Impl.cpp" ) -endif( ITA_BASE_WITH_CONFIG_OLD_IMPL AND NOT ITA_BASE_WITH_CONFIG_SIMPLE_INI ) +endif() -if( ITA_VISTA_BUILD_STATIC ) - add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC ) -endif( ITA_VISTA_BUILD_STATIC ) +# jst: necessary? +#if( ITA_VISTA_BUILD_STATIC ) +# add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC ) +#endif() # ITA defaults to shared library build mode, so extra definition is required if you want to build against a static library if( NOT ITA_CORE_LIBS_BUILD_STATIC ) add_definitions( -DITA_BASE_EXPORT ) -else( NOT ITA_CORE_LIBS_BUILD_STATIC ) +else() add_definitions( -DITA_BASE_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 ) +endif() if( NOT WIN32 ) @@ -207,8 +195,6 @@ endif() add_library( ITABase ${ITABaseHeader} ${ITABaseSources} ) target_link_libraries( ITABase ${VISTA_USE_PACKAGE_LIBRARIES} ) -set( BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_TEMP} ) - # configure vista_configure_lib( ITABase ) @@ -221,5 +207,7 @@ set_property( TARGET ITABase PROPERTY FOLDER "ITACoreLibs" ) # tests -set( ITABASE_COMMON_BUILD TRUE ) -add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/tests" ) +if( ITA_CORE_LIBS_WITH_TESTS ) + set( ITABASE_COMMON_BUILD TRUE ) + add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/tests" ) +endif() -- GitLab