From 47c063e13f9a7ea79d9ba29481ba1fb6f3708b52 Mon Sep 17 00:00:00 2001 From: Frank Zingsheim Date: Sat, 6 Aug 2016 18:21:54 +0200 Subject: [PATCH] Fixed #7660 (cmake build does not handle simplecpp) --- CMakeLists.txt | 1 + cli/CMakeLists.txt | 3 ++- externals/simplecpp/CMakeLists.txt | 6 ++++++ gui/CMakeLists.txt | 2 +- lib/CMakeLists.txt | 1 + test/CMakeLists.txt | 3 ++- 6 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 externals/simplecpp/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 4de3c06e5..215993bcf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ if (BUILD_TESTS) endif() add_subdirectory(externals/tinyxml) +add_subdirectory(externals/simplecpp) add_subdirectory(lib) # CppCheck Library add_subdirectory(cli) # Client application add_subdirectory(test) # Tests diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index a7fc54fcc..ca61b6550 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -1,5 +1,6 @@ include_directories(${PROJECT_SOURCE_DIR}/lib/) include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml/) +include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/) file(GLOB hdrs "*.h") file(GLOB srcs "*.cpp") @@ -7,7 +8,7 @@ file(GLOB mainfile "main.cpp") list(REMOVE_ITEM srcs ${mainfile}) add_library(cli_objs OBJECT ${hdrs} ${srcs}) -add_executable(cppcheck ${hdrs} ${mainfile} $ $ $) +add_executable(cppcheck ${hdrs} ${mainfile} $ $ $ $) if (HAVE_RULES) target_link_libraries(cppcheck pcre) endif() diff --git a/externals/simplecpp/CMakeLists.txt b/externals/simplecpp/CMakeLists.txt new file mode 100644 index 000000000..90d22f77f --- /dev/null +++ b/externals/simplecpp/CMakeLists.txt @@ -0,0 +1,6 @@ +file(GLOB hdrs "*.h") +file(GLOB srcs "*.cpp") + +add_library(simplecpp_objs OBJECT ${srcs} ${hdrs}) + + diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 2d07d7ace..774f42267 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -21,7 +21,7 @@ if (BUILD_GUI) QT4_ADD_RESOURCES(resources "gui.qrc") QT4_ADD_TRANSLATION(qms ${tss}) - add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $ $) + add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $ $ $) target_link_libraries(cppcheck-gui ${QT_LIBRARIES}) if (HAVE_RULES) target_link_libraries(cppcheck-gui pcre) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 3d5949baa..11c762678 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,4 +1,5 @@ include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml/) +include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/) file(GLOB_RECURSE hdrs "*.h") file(GLOB_RECURSE srcs "*.cpp") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 01ec1a28b..e773769b5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,11 +2,12 @@ if (BUILD_TESTS) include_directories(${PROJECT_SOURCE_DIR}/lib/ ${PROJECT_SOURCE_DIR}/cli/) include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml) + include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/) file(GLOB hdrs "*.h") file(GLOB srcs "*.cpp") - add_executable(testrunner ${hdrs} ${srcs} $ $ $) + add_executable(testrunner ${hdrs} ${srcs} $ $ $ $) if (HAVE_RULES) target_link_libraries(testrunner pcre) endif()