cppcheck/lib/CMakeLists.txt
Markus Elfring 8cde24597f Determination of rule support in CMake scripts (bug #2679, #2524)
The support for check rules will be automatically included in the generated
software if build settings were accordingly selected for PCRE.
https://sourceforge.net/apps/trac/cppcheck/ticket/2679

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
2011-04-02 13:25:18 +02:00

24 lines
616 B
CMake

# Minimal CMake build file to build static cppcheck library
# This static library is used to build executables:
# - cli
# - tests
# - Qt GUI
if(PCRE_FOUND)
add_definitions(-DHAVE_RULES)
include_directories("${PCRE_INCLUDE_DIR}")
endif()
set(CPPCHECK_LIB_DIR "")
include("library_sources.cmake")
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wshadow -Wno-long-long -Wfloat-equal -Wcast-qual")
endif (CMAKE_COMPILER_IS_GNUCXX)
add_library(checklib STATIC ${CPPCHECK_LIB_SOURCES})
if(PCRE_FOUND)
target_link_libraries(checklib ${PCRE_LIBRARIES})
endif()