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}) +