cmake: cleanup unmaintained cmake files
This commit is contained in:
parent
ab1b293f23
commit
c971fa0d4b
|
@ -1,42 +0,0 @@
|
|||
# Minimal CMake build file
|
||||
# Builds:
|
||||
# - static library from lib directory
|
||||
# - commandline executable
|
||||
# - test suite
|
||||
# - Qt GUI
|
||||
|
||||
# To build with CMake:
|
||||
# - install CMake 2.6 or later
|
||||
# - $ cmake .
|
||||
# - $ make
|
||||
|
||||
cmake_minimum_required (VERSION 2.6)
|
||||
|
||||
PROJECT(CPPCHECK)
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CPPCHECK_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
|
||||
find_package(PCRE)
|
||||
|
||||
if(NOT PCRE_FOUND)
|
||||
message("User-defined rules are disabled since PCRE libraries were not found.
|
||||
The PCRE paths can be configured by 'cmake-gui'.")
|
||||
endif()
|
||||
|
||||
# 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
|
||||
# Instead lib code is included directly into cli and gui targets
|
||||
# ADD_SUBDIRECTORY(lib)
|
||||
|
||||
ADD_SUBDIRECTORY(cli)
|
||||
|
||||
# Exclude tests from command line targets but include them to VS IDE targets.
|
||||
# There is 'make check' -target for compiling and running tests from
|
||||
# command line.
|
||||
IF (MSVC_IDE)
|
||||
ADD_SUBDIRECTORY(test)
|
||||
ELSE (MSVC_IDE)
|
||||
ADD_SUBDIRECTORY(test EXCLUDE_FROM_ALL)
|
||||
ENDIF (MSVC_IDE)
|
||||
|
||||
ADD_SUBDIRECTORY(gui)
|
|
@ -1,46 +0,0 @@
|
|||
# Minimal CMake build file to build cppcheck command line executable
|
||||
|
||||
include_directories("${CPPCHECK_SOURCE_DIR}/lib")
|
||||
|
||||
if(PCRE_FOUND)
|
||||
add_definitions(-DHAVE_RULES)
|
||||
set(TINYXML_INCLUDE_DIR "${CPPCHECK_SOURCE_DIR}/externals/tinyxml/")
|
||||
include_directories("${PCRE_INCLUDE_DIR}" "${TINYXML_INCLUDE_DIR}")
|
||||
set(CHECK_LIBS ${PCRE_LIBRARIES})
|
||||
endif()
|
||||
|
||||
SET(CHECKCLI_SRCS
|
||||
cmdlineparser.cpp
|
||||
cppcheckexecutor.cpp
|
||||
filelister.cpp
|
||||
main.cpp
|
||||
pathmatch.cpp
|
||||
threadexecutor.cpp)
|
||||
|
||||
if(PCRE_FOUND)
|
||||
set(CHECKCLI_SRCS ${CHECKCLI_SRCS}
|
||||
"${TINYXML_INCLUDE_DIR}tinystr.cpp"
|
||||
"${TINYXML_INCLUDE_DIR}tinyxml.cpp"
|
||||
"${TINYXML_INCLUDE_DIR}tinyxmlerror.cpp"
|
||||
"${TINYXML_INCLUDE_DIR}tinyxmlparser.cpp")
|
||||
endif()
|
||||
|
||||
set(CPPCHECK_LIB_DIR "${CPPCHECK_SOURCE_DIR}/lib/")
|
||||
include("${CPPCHECK_LIB_DIR}library_sources.cmake")
|
||||
|
||||
if(WIN32)
|
||||
# Add Windows resource file
|
||||
set(CHECKCLI_SRCS ${CHECKCLI_SRCS} cppcheck.rc)
|
||||
|
||||
if(NOT CYGWIN)
|
||||
# Windows needs additional shlwapi library.
|
||||
set(CHECK_LIBS ${CHECK_LIBS} shlwapi)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
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_executable(cppcheck ${CHECKCLI_SRCS} ${CPPCHECK_LIB_SOURCES})
|
||||
TARGET_LINK_LIBRARIES(cppcheck ${CHECK_LIBS})
|
|
@ -1,42 +0,0 @@
|
|||
# - Try to find the PCRE regular expression library
|
||||
# Once done this will define
|
||||
#
|
||||
# PCRE_FOUND - system has the PCRE library
|
||||
# PCRE_INCLUDE_DIR - the PCRE include directory
|
||||
# PCRE_LIBRARIES - The libraries needed to use PCRE
|
||||
|
||||
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
|
||||
if (PCRE_INCLUDE_DIR AND PCRE_PCREPOSIX_LIBRARY AND PCRE_PCRE_LIBRARY)
|
||||
# Already in cache, be silent
|
||||
set(PCRE_FIND_QUIETLY TRUE)
|
||||
endif (PCRE_INCLUDE_DIR AND PCRE_PCREPOSIX_LIBRARY AND PCRE_PCRE_LIBRARY)
|
||||
|
||||
|
||||
if (NOT WIN32)
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig)
|
||||
|
||||
pkg_check_modules(PC_PCRE QUIET libpcre)
|
||||
|
||||
set(PCRE_DEFINITIONS ${PC_PCRE_CFLAGS_OTHER})
|
||||
endif (NOT WIN32)
|
||||
|
||||
find_path(PCRE_INCLUDE_DIR pcre.h
|
||||
HINTS "${PC_PCRE_INCLUDEDIR}" ${PC_PCRE_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES pcre)
|
||||
|
||||
find_library(PCRE_PCRE_LIBRARY NAMES pcre pcred HINTS "${PC_PCRE_LIBDIR}" ${PC_PCRE_LIBRARY_DIRS})
|
||||
find_library(PCRE_PCREPOSIX_LIBRARY NAMES pcreposix pcreposixd HINTS "${PC_PCRE_LIBDIR}" ${PC_PCRE_LIBRARY_DIRS})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(PCRE DEFAULT_MSG PCRE_INCLUDE_DIR PCRE_PCRE_LIBRARY PCRE_PCREPOSIX_LIBRARY )
|
||||
|
||||
set(PCRE_LIBRARIES "${PCRE_PCRE_LIBRARY}" "${PCRE_PCREPOSIX_LIBRARY}")
|
||||
|
||||
mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARIES PCRE_PCREPOSIX_LIBRARY PCRE_PCRE_LIBRARY)
|
|
@ -1,152 +0,0 @@
|
|||
# Minimal CMake build file to build cppcheck Qt GUI
|
||||
|
||||
# find and setup Qt4 for this project
|
||||
find_package(Qt4)
|
||||
|
||||
IF(QT4_FOUND)
|
||||
|
||||
# Add needed Qt modules
|
||||
set(QT_USE_QTMAIN TRUE)
|
||||
include(${QT_USE_FILE})
|
||||
|
||||
include_directories("${CPPCHECK_SOURCE_DIR}/lib"
|
||||
# Generated files (in build directory) need to know gui directory
|
||||
"${CPPCHECK_SOURCE_DIR}/gui"
|
||||
# Include binary directory where code from UI files gets created
|
||||
"${CMAKE_CURRENT_BINARY_DIR}")
|
||||
|
||||
# Header files - listed for mocking
|
||||
SET(CHECK_HEADERS
|
||||
aboutdialog.h
|
||||
application.h
|
||||
applicationdialog.h
|
||||
applicationlist.h
|
||||
checkstatistics.h
|
||||
checkthread.h
|
||||
common.h
|
||||
csvreport.h
|
||||
erroritem.h
|
||||
filelist.h
|
||||
fileviewdialog.h
|
||||
logview.h
|
||||
mainwindow.h
|
||||
project.h
|
||||
projectfile.h
|
||||
projectfiledialog.h
|
||||
report.h
|
||||
resultstree.h
|
||||
resultsview.h
|
||||
settingsdialog.h
|
||||
statsdialog.h
|
||||
threadhandler.h
|
||||
threadresult.h
|
||||
translationhandler.h
|
||||
txtreport.h
|
||||
xmlreport.h
|
||||
xmlreportv1.h
|
||||
xmlreportv2.h
|
||||
)
|
||||
|
||||
# Source files
|
||||
SET(CHECKGUI_SRCS
|
||||
aboutdialog.cpp
|
||||
application.cpp
|
||||
applicationdialog.cpp
|
||||
applicationlist.cpp
|
||||
checkstatistics.cpp
|
||||
checkthread.cpp
|
||||
csvreport.cpp
|
||||
erroritem.cpp
|
||||
filelist.cpp
|
||||
fileviewdialog.cpp
|
||||
logview.cpp
|
||||
main.cpp
|
||||
mainwindow.cpp
|
||||
project.cpp
|
||||
projectfile.cpp
|
||||
projectfiledialog.cpp
|
||||
report.cpp
|
||||
resultstree.cpp
|
||||
resultsview.cpp
|
||||
settingsdialog.cpp
|
||||
statsdialog.cpp
|
||||
threadhandler.cpp
|
||||
threadresult.cpp
|
||||
translationhandler.cpp
|
||||
txtreport.cpp
|
||||
xmlreport.cpp
|
||||
xmlreportv1.cpp
|
||||
xmlreportv2.cpp
|
||||
)
|
||||
|
||||
# UI files
|
||||
SET(CHECK_UIS
|
||||
about.ui
|
||||
application.ui
|
||||
file.ui
|
||||
logview.ui
|
||||
main.ui
|
||||
projectfile.ui
|
||||
resultsview.ui
|
||||
settings.ui
|
||||
stats.ui
|
||||
)
|
||||
|
||||
# Translation files
|
||||
SET(CHECK_TRANS
|
||||
cppcheck_de.ts
|
||||
cppcheck_en.ts
|
||||
cppcheck_es.ts
|
||||
cppcheck_fi.ts
|
||||
cppcheck_fr.ts
|
||||
cppcheck_ja.ts
|
||||
cppcheck_nl.ts
|
||||
cppcheck_pl.ts
|
||||
cppcheck_ru.ts
|
||||
cppcheck_sr.ts
|
||||
cppcheck_sv.ts
|
||||
)
|
||||
|
||||
SET(CHECK_RCCS gui.qrc)
|
||||
|
||||
set(CPPCHECK_LIB_DIR "${CPPCHECK_SOURCE_DIR}/lib/")
|
||||
include("${CPPCHECK_LIB_DIR}library_sources.cmake")
|
||||
|
||||
if(WIN32)
|
||||
# Add Windows resource file
|
||||
set(CHECKGUI_SRCS ${CHECKGUI_SRCS} cppcheck-gui.rc)
|
||||
|
||||
if(NOT CYGWIN)
|
||||
# Windows needs additional shlwapi library.
|
||||
set(CHECK_LIBS ${CHECK_LIBS} shlwapi)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||
endif (CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
# Generate rules for building source files from the resources
|
||||
QT4_ADD_RESOURCES(CHECK_RCC_SRCS ${CHECK_RCCS})
|
||||
|
||||
# Process UI files
|
||||
QT4_WRAP_UI(CHECK_UIS_H ${CHECK_UIS})
|
||||
|
||||
# Mock header files
|
||||
QT4_WRAP_CPP(CHECK_MOC_SRCS ${CHECK_HEADERS})
|
||||
|
||||
# add translations ...
|
||||
QT4_ADD_TRANSLATION(CHECK_QM ${CHECK_TRANS})
|
||||
|
||||
# Create folders for Visual Studio IDE
|
||||
SOURCE_GROUP("Header Files" FILES ${CHECK_HEADERS})
|
||||
SOURCE_GROUP("Ui Files" ".ui$")
|
||||
SOURCE_GROUP("Moc Files" "moc_.*cxx$")
|
||||
|
||||
ADD_EXECUTABLE(cppcheck-gui WIN32 ${CHECKGUI_SRCS} ${CHECK_MOC_SRCS} ${CHECK_HEADERS}
|
||||
${CHECK_UIS_H} ${CHECK_RCC_SRCS} ${CPPCHECK_LIB_SOURCES})
|
||||
TARGET_LINK_LIBRARIES(cppcheck-gui ${CHECK_LIBS} ${QT_LIBRARIES})
|
||||
|
||||
ELSE(QT4_FOUND)
|
||||
message("GUI not built since QT4 not found.")
|
||||
ENDIF(QT4_FOUND)
|
|
@ -1,23 +0,0 @@
|
|||
# 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()
|
|
@ -1,24 +0,0 @@
|
|||
set(CPPCHECK_LIB_SOURCES
|
||||
"${CPPCHECK_LIB_DIR}checkautovariables.cpp"
|
||||
"${CPPCHECK_LIB_DIR}checkbufferoverrun.cpp"
|
||||
"${CPPCHECK_LIB_DIR}checkclass.cpp"
|
||||
"${CPPCHECK_LIB_DIR}checkexceptionsafety.cpp"
|
||||
"${CPPCHECK_LIB_DIR}checkmemoryleak.cpp"
|
||||
"${CPPCHECK_LIB_DIR}checknullpointer.cpp"
|
||||
"${CPPCHECK_LIB_DIR}checkobsoletefunctions.cpp"
|
||||
"${CPPCHECK_LIB_DIR}checkother.cpp"
|
||||
"${CPPCHECK_LIB_DIR}checkpostfixoperator.cpp"
|
||||
"${CPPCHECK_LIB_DIR}checkstl.cpp"
|
||||
"${CPPCHECK_LIB_DIR}checkuninitvar.cpp"
|
||||
"${CPPCHECK_LIB_DIR}checkunusedfunctions.cpp"
|
||||
"${CPPCHECK_LIB_DIR}cppcheck.cpp"
|
||||
"${CPPCHECK_LIB_DIR}errorlogger.cpp"
|
||||
"${CPPCHECK_LIB_DIR}executionpath.cpp"
|
||||
"${CPPCHECK_LIB_DIR}mathlib.cpp"
|
||||
"${CPPCHECK_LIB_DIR}path.cpp"
|
||||
"${CPPCHECK_LIB_DIR}preprocessor.cpp"
|
||||
"${CPPCHECK_LIB_DIR}settings.cpp"
|
||||
"${CPPCHECK_LIB_DIR}symboldatabase.cpp"
|
||||
"${CPPCHECK_LIB_DIR}timer.cpp"
|
||||
"${CPPCHECK_LIB_DIR}token.cpp"
|
||||
"${CPPCHECK_LIB_DIR}tokenize.cpp")
|
|
@ -1,75 +0,0 @@
|
|||
# Minimal CMake build file to build cppcheck test suite
|
||||
|
||||
set(TINYXML_INCLUDE_DIR "${CPPCHECK_SOURCE_DIR}/externals/tinyxml/")
|
||||
|
||||
SET(CHECKTEST_SRCS
|
||||
"${CPPCHECK_SOURCE_DIR}/cli/cmdlineparser.cpp"
|
||||
"${CPPCHECK_SOURCE_DIR}/cli/cppcheckexecutor.cpp"
|
||||
"${CPPCHECK_SOURCE_DIR}/cli/filelister.cpp"
|
||||
"${CPPCHECK_SOURCE_DIR}/cli/threadexecutor.cpp"
|
||||
"${CPPCHECK_SOURCE_DIR}/cli/pathmatch.cpp"
|
||||
options.cpp
|
||||
testautovariables.cpp
|
||||
testbufferoverrun.cpp
|
||||
testcharvar.cpp
|
||||
testclass.cpp
|
||||
testcmdlineparser.cpp
|
||||
testconstructors.cpp
|
||||
testcppcheck.cpp
|
||||
testdivision.cpp
|
||||
testerrorlogger.cpp
|
||||
testexceptionsafety.cpp
|
||||
testfilelister.cpp
|
||||
testincompletestatement.cpp
|
||||
testmathlib.cpp
|
||||
testmemleak.cpp
|
||||
testnullpointer.cpp
|
||||
testobsoletefunctions.cpp
|
||||
testoptions.cpp
|
||||
testother.cpp
|
||||
testpath.cpp
|
||||
testpathmatch.cpp
|
||||
testpostfixoperator.cpp
|
||||
testpreprocessor.cpp
|
||||
testrunner.cpp
|
||||
testsettings.cpp
|
||||
testsimplifytokens.cpp
|
||||
teststl.cpp
|
||||
testsuite.cpp
|
||||
testsymboldatabase.cpp
|
||||
testthreadexecutor.cpp
|
||||
testtoken.cpp
|
||||
testtokenize.cpp
|
||||
testuninitvar.cpp
|
||||
testunusedfunctions.cpp
|
||||
testunusedprivfunc.cpp
|
||||
testunusedvar.cpp
|
||||
"${TINYXML_INCLUDE_DIR}tinystr.cpp"
|
||||
"${TINYXML_INCLUDE_DIR}tinyxml.cpp"
|
||||
"${TINYXML_INCLUDE_DIR}tinyxmlerror.cpp"
|
||||
"${TINYXML_INCLUDE_DIR}tinyxmlparser.cpp")
|
||||
|
||||
set(CPPCHECK_LIB_DIR "${CPPCHECK_SOURCE_DIR}/lib/")
|
||||
include("${CPPCHECK_LIB_DIR}library_sources.cmake")
|
||||
|
||||
if(WIN32)
|
||||
if(NOT CYGWIN)
|
||||
# Windows needs additional shlwapi library.
|
||||
set(CHECK_LIBS ${CHECK_LIBS} shlwapi)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
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)
|
||||
|
||||
include_directories("${CPPCHECK_SOURCE_DIR}/lib"
|
||||
"${CPPCHECK_SOURCE_DIR}/cli"
|
||||
"${TINYXML_INCLUDE_DIR}")
|
||||
add_executable(test ${CHECKTEST_SRCS} ${CPPCHECK_LIB_SOURCES})
|
||||
TARGET_LINK_LIBRARIES(test ${CHECK_LIBS})
|
||||
|
||||
# Add custom 'make check' -target
|
||||
# It compiles and runs tests
|
||||
add_custom_target(check COMMAND test)
|
||||
add_dependencies(check test)
|
Loading…
Reference in New Issue