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)
|
2019-01-18 21:13:35 +01:00
|
|
|
find_library(PCRE_LIBRARY pcre)
|
|
|
|
target_link_libraries(cppcheck ${PCRE_LIBRARY})
|
|
|
|
find_path(PCRE_INCLUDE pcre.h)
|
|
|
|
target_include_directories(cppcheck PUBLIC ${PCRE_INCLUDE})
|
2015-11-26 20:25:09 +01:00
|
|
|
endif()
|
2018-07-15 22:26:02 +02:00
|
|
|
if (WIN32 AND NOT BORLAND)
|
2017-10-18 17:38:15 +02:00
|
|
|
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)
|
|
|
|
|
2019-08-17 10:53:07 +02:00
|
|
|
install(FILES ${addons}
|
|
|
|
DESTINATION ${FILESDIR}/addons
|
|
|
|
COMPONENT headers)
|
|
|
|
|
2015-02-13 19:00:14 +01:00
|
|
|
install(FILES ${cfgs}
|
2019-08-17 10:53:07 +02:00
|
|
|
DESTINATION ${FILESDIR}/cfg
|
2015-02-13 19:00:14 +01:00
|
|
|
COMPONENT headers)
|
2019-08-17 10:53:07 +02:00
|
|
|
|
|
|
|
install(FILES ${platforms}
|
|
|
|
DESTINATION ${FILESDIR}/platforms
|
|
|
|
COMPONENT headers)
|
|
|
|
|