# This file is copyrighted under the GPL2+ license # copyright 2012, Jean-Philippe Meuret project(qatsh) cmake_minimum_required(VERSION 3.13.5) # CMake Build options. if(NOT DEFINED CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) endif() # Requirement checks. #include(ConfigureChecks.cmake) # Compile options. if(CMAKE_COMPILER_IS_GNUCXX) # GCC warnings (at least for the 4.x series, there are none by default). # Add useful warnings / checks. set(_WOPTS "-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers") elseif(MSVC) # MSVC warnings (default warning level 3 is not exactly what we want). # Suppress bothering MSVC warnings and add useful warnings / checks. set(_WOPTS "/W4") # Better warning level (default seems to be 3). # Level 3 useless/boring warnings. set(_WOPTS "${_WOPTS} /wd4251") # class XXX needs a DLL interface set(_WOPTS "${_WOPTS} /wd4996") # std::_Copy_opt disaproved because unsafe # Level 4 useless/boring warnings. set(_WOPTS "${_WOPTS} /wd4100") # unreferenced formal parameter set(_WOPTS "${_WOPTS} /wd4127") # conditional expression is constant set(_WOPTS "${_WOPTS} /wd4201") # nonstandard extension used : nameless struct/union set(_WOPTS "${_WOPTS} /wd4706") # assignment within conditional expression # Other useless warnings. add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS) endif(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_WOPTS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_WOPTS}") # config.h generation. #configure_file(include/config.h.in.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) # Add our own modules to the CMake search path (useful for FindLibSndFile). set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) # Sub-directories. add_subdirectory(mathexpr) add_subdirectory(atsa) add_subdirectory(qatsh)