From c85c0fbabcc59ac7e52ad6c16594dadbc7bf812b Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Sat, 12 Dec 2009 20:38:49 +0200 Subject: [PATCH] Add simple CMake build files to build lib and cli. Apparently not everybody wants to use QMake to build cppcheck. Which is understandable if you only want to hack on/build lib and cli. Qt and QMake are pretty lot to install for just that. So lets start using CMake. It is widely used and is "just" build system and not programming framework. CMake is also easy to use for building Qt software too so it can replace QMake. This first commit only builds lib and cli for Linux. --- CMakeLists.txt | 15 +++++++++++++++ cli/CMakeLists.txt | 12 ++++++++++++ lib/CMakeLists.txt | 27 +++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 cli/CMakeLists.txt create mode 100644 lib/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..03af14843 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,15 @@ +# Minimal CMake build file +# Builds static library from lib directory and commandline executable + +# To build with CMake: +# - install CMake 2.6 or later +# - $ cmake . +# - $ make + +cmake_minimum_required (VERSION 2.6) + +PROJECT(CPPCHECK) + +ADD_SUBDIRECTORY(lib) +ADD_SUBDIRECTORY(cli) + diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt new file mode 100644 index 000000000..29edd006b --- /dev/null +++ b/cli/CMakeLists.txt @@ -0,0 +1,12 @@ +# Minimal CMake build file to build cppcheck command line executable + +SET(CHECKCLI_SRCS + cppcheckexecutor.cpp + threadexecutor.cpp + main.cpp +) + +include_directories (${CPPCHECK_SOURCE_DIR}/lib) +ADD_EXECUTABLE(cppcheck ${CHECKCLI_SRCS}) +TARGET_LINK_LIBRARIES(cppcheck checklib) + diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt new file mode 100644 index 000000000..a734b7cb4 --- /dev/null +++ b/lib/CMakeLists.txt @@ -0,0 +1,27 @@ +# Minimal CMake build file to build static cppcheck library +# This static library is used to build executables: +# - cli + +SET(CHECKLIB_SRCS + checkautovariables.cpp + checkmemoryleak.cpp + filelister.cpp + checkbufferoverrun.cpp + checkother.cpp + mathlib.cpp + checkclass.cpp + checkstl.cpp + preprocessor.cpp + checkdangerousfunctions.cpp + checkunusedfunctions.cpp + settings.cpp + checkexceptionsafety.cpp + cppcheck.cpp + token.cpp + checkheaders.cpp + errorlogger.cpp + tokenize.cpp +) + +ADD_LIBRARY(checklib STATIC ${CHECKLIB_SRCS}) +