Fixed #7660 (cmake build does not handle simplecpp)

This commit is contained in:
Frank Zingsheim 2016-08-06 18:21:54 +02:00
parent a8df08f22b
commit 47c063e13f
6 changed files with 13 additions and 3 deletions

View File

@ -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

View File

@ -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} $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:tinyxml_objs>)
add_executable(cppcheck ${hdrs} ${mainfile} $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:tinyxml_objs> $<TARGET_OBJECTS:simplecpp_objs>)
if (HAVE_RULES)
target_link_libraries(cppcheck pcre)
endif()

6
externals/simplecpp/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,6 @@
file(GLOB hdrs "*.h")
file(GLOB srcs "*.cpp")
add_library(simplecpp_objs OBJECT ${srcs} ${hdrs})

View File

@ -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} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:tinyxml_objs>)
add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:tinyxml_objs> $<TARGET_OBJECTS:simplecpp_objs>)
target_link_libraries(cppcheck-gui ${QT_LIBRARIES})
if (HAVE_RULES)
target_link_libraries(cppcheck-gui pcre)

View File

@ -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")

View File

@ -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} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:tinyxml_objs>)
add_executable(testrunner ${hdrs} ${srcs} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:tinyxml_objs> $<TARGET_OBJECTS:simplecpp_objs>)
if (HAVE_RULES)
target_link_libraries(testrunner pcre)
endif()