Fixed #7660 (cmake build does not handle simplecpp)
This commit is contained in:
parent
a8df08f22b
commit
47c063e13f
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
file(GLOB hdrs "*.h")
|
||||
file(GLOB srcs "*.cpp")
|
||||
|
||||
add_library(simplecpp_objs OBJECT ${srcs} ${hdrs})
|
||||
|
||||
|
|
@ -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)
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue