Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ PROJECT(CPPCHECK)

set(CMAKE_MODULE_PATH "${CPPCHECK_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})

option(CPPCHECK_BUILD_USE_RULES "Would you like to use customised check rules?
See also:
http://sourceforge.net/projects/cppcheck/files/Articles/writing-rules-1.pdf/download
(Software components which support the processing of Perl-compatible regular
expressions will be required for the build system if this feature is enabled.)"
ON)

# Building lib as static library is disabled due to bug
# #1299 CMake: The CheckClass is not used
# https://sourceforge.net/apps/trac/cppcheck/ticket/1299
Expand Down
7 changes: 7 additions & 0 deletions cli/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Minimal CMake build file to build cppcheck command line executable

if(CPPCHECK_BUILD_USE_RULES)
find_package(PCRE REQUIRED)
add_definitions(-DHAVE_RULES)
include_directories("${PCRE_INCLUDE_DIR}")
set(CHECK_LIBS ${PCRE_LIBRARIES})
endif()

set(TINYXML_INCLUDE_DIR "${CPPCHECK_SOURCE_DIR}/externals/tinyxml/")

SET(CHECKCLI_SRCS
Expand Down
10 changes: 10 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
# - tests
# - Qt GUI

if(CPPCHECK_BUILD_USE_RULES)
find_package(PCRE REQUIRED)
add_definitions(-DHAVE_RULES)
include_directories("${PCRE_INCLUDE_DIR}")
endif()

set(CPPCHECK_LIB_DIR "")
include("library_sources.cmake")

Expand All @@ -12,3 +18,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
endif (CMAKE_COMPILER_IS_GNUCXX)

add_library(checklib STATIC ${CPPCHECK_LIB_SOURCES})

if(CPPCHECK_BUILD_USE_RULES)
target_link_libraries(checklib ${PCRE_LIBRARIES})
endif()
7 changes: 7 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Minimal CMake build file to build cppcheck test suite

if(CPPCHECK_BUILD_USE_RULES)
find_package(PCRE REQUIRED)
add_definitions(-DHAVE_RULES)
include_directories("${PCRE_INCLUDE_DIR}")
set(CHECK_LIBS ${PCRE_LIBRARIES})
endif()

set(TINYXML_INCLUDE_DIR "${CPPCHECK_SOURCE_DIR}/externals/tinyxml/")

SET(CHECKTEST_SRCS
Expand Down