Skip to content
Snippets Groups Projects
Select Git revision
  • master
  • develop protected
  • feature/triangulation-qhull
  • jst
  • ti_lab_build
  • features/splines_and_piecewise_polynomials
  • ma_2018/erraji
  • fabian
  • ITABase_v2024a
  • VA_v2023b
  • VA_v2023a
  • VA_v2022a
  • before_cmake_rework
  • v2021.a
  • v2020.a
  • v2019.a
  • v2018.b
  • v2018.a
  • v2017.d
  • v2017.c
  • v2017.b
  • v2017.a
  • v2016.a
23 results

CMakeLists.txt

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