Commit Graph

40 Commits

Author SHA1 Message Date
Oliver Stöneberg a0b1285f4a
added CMake option `BUILD_CORE_DLL` to build lib as `cppcheck-core.dll` with Visual Studio (#4733) 2023-01-26 22:13:07 +01:00
Oliver Stöneberg e5572835c0
fixed `platforms` lookup / set proper platform type for `unix32-unsigned` and `unix64-unsigned` / copy `platforms` in CMake (#4464) 2023-01-26 22:05:40 +01:00
Oliver Stöneberg b3762cd76a
actually perform system tinyxml2 build on macos / fixed system tinyxml2 include (#4445)
* lib/CMakeLists.txt: removed unnecessary external include

* look up tinyxml2 include dir when using system one and specify it

* lib/CMakeLists.txt: do not treat bundled headers as system ones

* CI-unixish.yml: actually perform system tinyxml2 build on macos
2022-09-06 18:30:59 +02:00
Oliver Stöneberg b2f15fdbb1
reduced padding in some classes/structs (#4295) 2022-07-24 10:17:11 +02:00
Oliver Stöneberg b51aea5531
separated process execution code into `ProcessExecutor` (#4249) 2022-07-08 16:42:57 +02:00
Daniel Marjamäki 8f386e15fd Remove bug hunting. This feature will be provided in Cppcheck premium. 2022-04-11 07:31:33 +02:00
Georgi D. Sotirov 33315b0ae5
Replace tinyxml2_LIBRARY with tinyxml2_LIBRARIES (#3897) 2022-03-15 21:17:03 +01:00
Oliver Stöneberg 0d336b868c
avoid some Clang compiler warnings (#3896) 2022-03-13 20:07:58 +01:00
Oliver Stöneberg 51371f7929
added CMake option USE_THREADS to be able to use threads instead of fork() / cleanups (#3852) 2022-02-23 09:04:35 +01:00
Oliver Stöneberg 12c1c081dc
run dmake and update Qt translation files on CMake build (#3820) 2022-02-16 07:06:59 +01:00
Oliver Stöneberg 974dd5d49f
only use bundled tinyxml2 in CMake when configured to do so (#3806) 2022-02-06 13:02:52 +01:00
Oliver Stöneberg b4704ba065
use target-specific configuration instead of global ones in CMake (#3534) 2021-10-30 09:08:07 +02:00
Paul Fultz II 2a3657154b
Dont require __main__ for an addon (#3363) 2021-08-12 20:17:51 +02:00
DGarry82 77716ee398
fix w64-mingw32-ld linking error (#3184)
* fix w64-mingw32-ld linking error

use shlwapi instead of Shlwapi.lib in mingw-w64 build environment
(prevents "/usr/bin/x86_64-w64-mingw32-ld: cannot find -lShlwapi" error)

* same MinGW shlwapi fix for {tests,tools}/CMakeLists.txt

Co-authored-by: Igor Rondarev <igor.rondarev@gmail.com>
2021-03-29 17:04:42 +02:00
Wolfgang Stöggl 8ac55a8534
Add find_package(tinyxml2) to CMake builds (#2691)
So far, the cmake files of Cppcheck needed to be patched in order to
use installed tinyxml2 instead of the bundled version of tinyxml2.
- Introduce the CMake option USE_BUNDLED_TINYXML2 with a default value
  of ON. This preserves the behavior as in the past and uses the
  bundled version under externals/tinyxml2 by default.
- Usage of the installed tinyxml2 version of a system can be enabled
  now using -DUSE_BUNDLED_TINYXML2=OFF as a cmake parameter.
- Some Linux distros do not install tinyxml2*.cmake files, which are
  required to find tinyxml2 using find_package().
  Try first using find_package(tinyxml2 QUIET) and if this fails, try
  again using find_library(tinyxml2_LIBRARY tinyxml2)
2020-11-22 08:57:07 +01:00
Daniel Marjamäki c7cbe7f2d3 rename externals/tinyxml to externals/tinyxml2 2020-11-16 09:11:53 +01:00
Oliver Stöneberg 3a90341961
some CMake cleanups and additions (#2639) 2020-05-27 05:15:46 +02:00
Daniel Marjamäki a17f2a6f05 Compiling/Installing : The CFGDIR parameter was removed. Use FILESDIR instead. 2019-08-17 10:53:07 +02:00
Paul Fultz II 9e4b605fca Properly find pcre (#1607) 2019-01-18 21:13:35 +01:00
Paul Fultz II 800076f9b8 Install to the correct cfgdir (#1593) 2019-01-12 08:05:03 +01:00
Olivier Croquette b05ae44edb Fix link error when building with MinGW about __imp_PathFileExistsA (#1310)
Following error occurs when building with MinGW 7.2.0 and Ninja on Windows:

  cli/CMakeFiles/cli_objs.dir/filelister.cpp.obj: In function `MyIsDirectory':
  cppcheck-1.84\build/../cli/filelister.cpp:49: undefined reference to `__imp_PathIsDirectoryA'
  cli/CMakeFiles/cli_objs.dir/filelister.cpp.obj: In function `MyFileExists':
  cppcheck-1.84\build/../cli/filelister.cpp:67: undefined reference to `__imp_PathFileExistsA'
  collect2.exe: error: ld returned 1 exit status

This is the corresponding code in filelister.cpp:

  #ifdef _WIN32

  // snip

  static BOOL MyIsDirectory(const std::string& path)
  {
  #ifdef __BORLANDC__
      return (GetFileAttributes(path.c_str()) & FILE_ATTRIBUTE_DIRECTORY);
  #else
  // See http://msdn.microsoft.com/en-us/library/bb773621(VS.85).aspx
      return PathIsDirectoryA(path.c_str());
  #endif
  }

  static BOOL MyFileExists(const std::string& path)
  {
  #ifdef __BORLANDC__
      DWORD fa = GetFileAttributes(path.c_str());
      BOOL result = FALSE;
      if (fa != INVALID_FILE_ATTRIBUTES && !(fa & FILE_ATTRIBUTE_DIRECTORY))
	  result = TRUE;
  #else
      const BOOL result = PathFileExistsA(path.c_str());
  #endif
      return result;
  }

The else blocks assume that Shlwapi.lib is available on Windows except with Borland,
so the patch set ensures that the library is linked on the same condition.
2018-07-15 22:26:02 +02:00
Ali Can Demiralp bf174f583b Link to Shlwapi.lib on MSVC to get rid of missing symbol issues. (#978) 2017-10-18 17:38:15 +02:00
Frank Zingsheim 47c063e13f Fixed #7660 (cmake build does not handle simplecpp) 2016-08-06 18:21:54 +02:00
Frank Zingsheim 70c20515a9 Cmake object linkage. Fix #7128: (cppcheck 1.70 doesn't report any warnings) 2015-11-26 20:25:09 +01:00
Luis Díaz Más 22424ba54a Add CMake files 2015-02-13 19:00:14 +01:00
Daniel Marjamäki c971fa0d4b cmake: cleanup unmaintained cmake files 2011-05-19 17:16:04 +02:00
Markus Elfring 796761d582 Conditional inclusion of TinyXML source files in the CLI CMake script (bug #2679, #2524)
The source files for the class library "TinyXML" will only be included into
the build of the command line interface if the library "PCRE" was found before.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
2011-04-06 16:30:23 +02:00
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
Daniel Marjamaki c6b176014b cmake: removed the non-working pcre. ticket: #2679 2011-03-26 19:03:11 +01:00
Sebastien Debrard 29b7d4b9c3 sync cmake files with the master branch 2011-03-26 02:03:52 +01:00
Markus Elfring 9301ee28a8 Added CMake files 2011-03-25 07:14:53 +01:00
Daniel Marjamäki 40bb5144e1 removed some more cmake files 2010-02-23 20:12:53 +01:00
Daniel Marjamäki 2ad812d2de Output the cppcheck program in the base folder 2010-02-14 08:26:55 +01:00
Kimmo Varis 116772da7e Make workaround fix for ticket #1299.
Since lib does not work when built as an static library, compile lib
code as part of cli/gui code.
2010-01-31 12:36:56 +02:00
Kimmo Varis 5912035696 CMake - add header files to CLI project and VS project. 2010-01-03 21:13:30 +02:00
Kimmo Varis 9e2a42ebf9 CMake - use more strict compiler flags. 2009-12-20 10:45:57 +02:00
Kimmo Varis d51520d656 CMake - add Windows resource files to build. 2009-12-19 16:54:38 +02:00
Kimmo Varis 41eb141e61 CMake - cleaner way to set additional library for Windows. 2009-12-19 16:21:46 +02:00
Kimmo Varis d70c60b702 CMake - Fix Windows build. 2009-12-17 22:31:13 +02:00
Kimmo Varis c85c0fbabc 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.
2009-12-15 22:27:17 +02:00