2015-02-13 19:00:14 +01:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/lib/)
|
2015-11-26 20:25:09 +01:00
|
|
|
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml/)
|
2016-08-06 18:21:54 +02:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/)
|
2015-02-13 19:00:14 +01:00
|
|
|
|
|
|
|
file(GLOB hdrs "*.h")
|
|
|
|
file(GLOB srcs "*.cpp")
|
|
|
|
file(GLOB mainfile "main.cpp")
|
|
|
|
list(REMOVE_ITEM srcs ${mainfile})
|
|
|
|
|
2015-11-26 20:25:09 +01:00
|
|
|
add_library(cli_objs OBJECT ${hdrs} ${srcs})
|
2016-08-06 18:21:54 +02:00
|
|
|
add_executable(cppcheck ${hdrs} ${mainfile} $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:tinyxml_objs> $<TARGET_OBJECTS:simplecpp_objs>)
|
2015-11-26 20:25:09 +01:00
|
|
|
if (HAVE_RULES)
|
|
|
|
target_link_libraries(cppcheck pcre)
|
|
|
|
endif()
|
2017-10-18 17:38:15 +02:00
|
|
|
if (MSVC)
|
|
|
|
target_link_libraries(cppcheck Shlwapi.lib)
|
|
|
|
endif()
|
2015-02-13 19:00:14 +01:00
|
|
|
|
|
|
|
install(TARGETS cppcheck
|
2015-11-26 20:25:09 +01:00
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
|
2015-02-13 19:00:14 +01:00
|
|
|
COMPONENT applications)
|
|
|
|
|
|
|
|
install(FILES ${cfgs}
|
2015-11-26 20:25:09 +01:00
|
|
|
DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/${PROJECT_NAME}/
|
2015-02-13 19:00:14 +01:00
|
|
|
COMPONENT headers)
|