Skip to content

Commit 47c063e

Browse files
committed
Fixed #7660 (cmake build does not handle simplecpp)
1 parent a8df08f commit 47c063e

6 files changed

Lines changed: 13 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ if (BUILD_TESTS)
1717
endif()
1818

1919
add_subdirectory(externals/tinyxml)
20+
add_subdirectory(externals/simplecpp)
2021
add_subdirectory(lib) # CppCheck Library
2122
add_subdirectory(cli) # Client application
2223
add_subdirectory(test) # Tests

cli/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
include_directories(${PROJECT_SOURCE_DIR}/lib/)
22
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml/)
3+
include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/)
34

45
file(GLOB hdrs "*.h")
56
file(GLOB srcs "*.cpp")
67
file(GLOB mainfile "main.cpp")
78
list(REMOVE_ITEM srcs ${mainfile})
89

910
add_library(cli_objs OBJECT ${hdrs} ${srcs})
10-
add_executable(cppcheck ${hdrs} ${mainfile} $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:tinyxml_objs>)
11+
add_executable(cppcheck ${hdrs} ${mainfile} $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:tinyxml_objs> $<TARGET_OBJECTS:simplecpp_objs>)
1112
if (HAVE_RULES)
1213
target_link_libraries(cppcheck pcre)
1314
endif()

externals/simplecpp/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
file(GLOB hdrs "*.h")
2+
file(GLOB srcs "*.cpp")
3+
4+
add_library(simplecpp_objs OBJECT ${srcs} ${hdrs})
5+
6+

gui/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if (BUILD_GUI)
2121
QT4_ADD_RESOURCES(resources "gui.qrc")
2222
QT4_ADD_TRANSLATION(qms ${tss})
2323

24-
add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:tinyxml_objs>)
24+
add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:tinyxml_objs> $<TARGET_OBJECTS:simplecpp_objs>)
2525
target_link_libraries(cppcheck-gui ${QT_LIBRARIES})
2626
if (HAVE_RULES)
2727
target_link_libraries(cppcheck-gui pcre)

lib/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml/)
2+
include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/)
23

34
file(GLOB_RECURSE hdrs "*.h")
45
file(GLOB_RECURSE srcs "*.cpp")

test/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ if (BUILD_TESTS)
22

33
include_directories(${PROJECT_SOURCE_DIR}/lib/ ${PROJECT_SOURCE_DIR}/cli/)
44
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml)
5+
include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/)
56

67
file(GLOB hdrs "*.h")
78
file(GLOB srcs "*.cpp")
89

9-
add_executable(testrunner ${hdrs} ${srcs} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:tinyxml_objs>)
10+
add_executable(testrunner ${hdrs} ${srcs} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:tinyxml_objs> $<TARGET_OBJECTS:simplecpp_objs>)
1011
if (HAVE_RULES)
1112
target_link_libraries(testrunner pcre)
1213
endif()

0 commit comments

Comments
 (0)