Commit Graph

25 Commits

Author SHA1 Message Date
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