Skip to content
Snippets Groups Projects
Select Git revision
  • 7b739ab892cc7e63dae3d444620e9704ae93e11f
  • master default protected
  • developement_1 protected
  • Version_1.2.4
  • Version_1.2.3
  • Version_1.2.2
  • Version_1.2.1
  • Version_1.2.0
  • Version_1.0.1
  • Version_1.0.0
  • Version_0.1.0
  • Version_0.0.6
  • Version_0.0.5
  • Version_0.0.4
  • Version_0.0.3
  • Version_0.0.2
  • Version_0.0.1
17 results

OutputDevice.h

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    CMakeLists.txt 3.68 KiB
    cmake_minimum_required (VERSION 3.20 FATAL_ERROR)
    
    init_project ()
    
    project (
    	ITABase
    	VERSION 2024.0
    	LANGUAGES CXX C
    )
    
    # ---Options---
    option (ITA_BASE_WITH_FASTMATH_IPP
    		"Build with IPP implementation of fast math ops (requires license for redistribution)" OFF
    )
    option (ITA_BASE_WITH_FASTMATH_ASSEMBLER "Build with assembler implementation of fast math ops" OFF)
    option (ITA_BASE_WITH_SNDFILE "Build with libsndfile to read/write audio samples for ITASampleFrame" ON)
    option (ITA_BASE_WITH_SAMPLERATE "Build with libsamplerate to auto-convert between samplerates" ON)
    option (ITA_BASE_WITH_OLD_ATOMICS "Build with old atomic code for non-C++11 compatible compilers" OFF)
    option (ITA_BASE_WITH_REGULAR_EXPRESSIONS "Build with old regular expressions code for string manipulation" OFF)
    option (ITA_BASE_WITH_CONFIG_OLD_IMPL
    		"Build with old INI file configuration implementation (uses legacy regular expressions)" OFF
    )
    option (ITA_BASE_WITH_CONFIG_SIMPLE_INI "Build with new INI file configuration implementation (uses simpleINI lib)" ON)
    option (
    	ITA_BASE_WITH_OLD_RAVEN_OPS
    	"Build with old ITAOps helper functions implementation (legacy code for RAVEN compatibility, adds GPL-licensed libs!)"
    	OFF
    )
    option (ITA_BASE_WITH_TESTS "Build the tests for the library" OFF)
    # ---END: Options---
    
    # External libs
    add_subdirectory (external_libs)
    
    # Use source file handling as described in:
    # https://crascit.com/2016/01/31/enhanced-source-file-handling-with-target_sources/
    
    # Library
    ihta_add_library (
    	NAME ${PROJECT_NAME}
    	SOURCES ""
    	NAMESPACE ${PROJECT_NAME}
    	IDE_FOLDER "ITACoreLibs"
    	OUT_LIB LIB_TARGET
    	OUT_TEST TEST_TARGET
    	TEST_SOURCES tests/UnitTest/ITABaseTestUtils.h tests/UnitTest/ITABaseUnitTestISO9613.cpp tests/UnitTest/ITABaseUnitTestPiesewisePolynomials.cpp
    	ADD_UNIT_TEST ${ITA_BASE_WITH_TESTS}
    )
    add_subdirectory ("include")
    add_subdirectory ("src")
    
    # Linking
    target_link_libraries (
    	${LIB_TARGET}
    	PRIVATE SndFile::sndfile SampleRate::samplerate Spline::spline
    	PUBLIC vista::vista_base vista::vista_tools
    )
    
    if (ITA_BASE_WITH_REGULAR_EXPRESSIONS)
    	target_link_libraries (${LIB_TARGET} PRIVATE pcrecpp)
    endif ()
    
    option (ITA_BASE_WITH_JSON_SUPPORT "Build ITA Base with JSON support" ON)
    
    if (ITA_BASE_WITH_JSON_SUPPORT)
    	target_compile_definitions (${LIB_TARGET} PUBLIC WITH_JSON_SUPPORT)
    	target_link_libraries (${LIB_TARGET} PRIVATE nlohmann_json::nlohmann_json)
    endif ()
    
    # Check for targets
    if (ITA_BASE_WITH_OLD_RAVEN_OPS)
    	if (NOT ITA_BASE_WITH_CONFIG_OLD_IMPL)
    		message (
    			FATAL_ERROR
    				"ITABase old RAVEN ops requires regular expressions and old config implementation. Please activate."
    		)
    	endif ()
    	if (NOT TARGET Spline::spline)
    		message (FATAL_ERROR "ITABase old RAVEN ops requires SPLINE, which was not found. Please provide.")
    	endif ()
    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 ()
    endif ()
    
    # Definitions for Shared/Static
    target_compile_definitions (${LIB_TARGET} PUBLIC $<IF:$<BOOL:${BUILD_SHARED_LIBS}>,ITA_BASE_EXPORT,ITA_BASE_STATIC>)
    
    target_add_instrumentation (${LIB_TARGET})
    
    # Install & export
    packageProject (
    	NAME ${PROJECT_NAME}
    	VERSION ${PROJECT_VERSION}
    	BINARY_DIR ${PROJECT_BINARY_DIR}
    	INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include
    	INCLUDE_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ITABase
    	DEPENDENCIES
    		"sndfile;samplerate;spline;vista_base;vista_tools;$<IF:$<BOOL:${ITA_BASE_WITH_REGULAR_EXPRESSIONS}>,pcrecpp>"
    	COMPATIBILITY ExactVersion
    	NAMESPACE ${PROJECT_NAME}
    	DISABLE_VERSION_SUFFIX YES
    )
    
    # Tests
    if (ITA_BASE_WITH_TESTS)
    	set (ITABASE_COMMON_BUILD TRUE)
    	add_subdirectory (tests)
    endif ()