cppcheck/cmake/options.cmake

60 lines
3.1 KiB
CMake
Raw Normal View History

2015-02-13 19:00:14 +01:00
#------------------------------------------------------
# Build type
#------------------------------------------------------
set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;MinSizeRel" CACHE STRING "Configs" FORCE)
2015-02-13 19:00:14 +01:00
if(DEFINED CMAKE_BUILD_TYPE)
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES})
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()
# ----------------------------------------------------------------------------
# PROJECT CONFIGURATION
# ----------------------------------------------------------------------------
option(ANALYZE_MEMORY "Clang dynamic analyzer: detector of uninitialized reads." OFF)
option(ANALYZE_ADDRESS "Clang dynamic analyzer: fast memory error detector. " OFF)
option(ANALYZE_THREAD "Clang dynamic analyzer: tool that detects data races. " OFF)
option(ANALYZE_UNDEFINED "Clang dynamic analyzer: undefined behavior checker. " OFF)
option(ANALYZE_DATAFLOW "Clang dynamic analyzer: general dynamic dataflow analysis." OFF)
option(WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF)
2019-01-06 17:15:57 +01:00
set(USE_MATCHCOMPILER "Auto" CACHE STRING "Usage of match compiler")
2015-07-23 10:49:53 +02:00
set_property(CACHE USE_MATCHCOMPILER PROPERTY STRINGS Auto Off On Verify)
if (USE_MATCHCOMPILER MATCHES "Auto")
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
2015-07-23 10:49:53 +02:00
set(USE_MATCHCOMPILER_OPT "On")
else()
set(USE_MATCHCOMPILER_OPT "Off")
endif()
else()
set(USE_MATCHCOMPILER_OPT ${USE_MATCHCOMPILER})
endif()
2015-02-13 19:00:14 +01:00
option(BUILD_TESTS "Build tests" OFF)
option(ENABLE_CHECK_INTERNAL "Enable internal checks" OFF)
option(ENABLE_OSS_FUZZ "Enable the OSS-Fuzz related targets" ON)
2015-02-13 19:00:14 +01:00
option(BUILD_GUI "Build the qt application" OFF)
option(WITH_QCHART "When building GUI(need BUILD_GUI=ON), use Qt5 Charts" OFF)
2015-02-13 19:00:14 +01:00
option(HAVE_RULES "Usage of rules (needs PCRE library and headers)" OFF)
option(USE_Z3 "Usage of z3 library" OFF)
2015-02-13 19:00:14 +01:00
# precompiled headers do not emit compiler warnings so we cannot use them right now
#if (CMAKE_VERSION VERSION_EQUAL "3.16" OR CMAKE_VERSION VERSION_GREATER "3.16")
# set(CMAKE_DISABLE_PRECOMPILE_HEADERS Off CACHE BOOL "Disable precompiled headers")
#else()
set(CMAKE_DISABLE_PRECOMPILE_HEADERS On CACHE BOOL "Disable precompiled headers")
#endif()
2015-02-13 19:00:14 +01:00
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE ${CMAKE_INSTALL_PREFIX}/include CACHE PATH "Output directory for headers")
set(CMAKE_LIB_DIRS_CONFIGCMAKE ${CMAKE_INSTALL_PREFIX}/lib CACHE PATH "Output directory for libraries")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(FILESDIR ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME} CACHE STRING "Cppcheck files directory")