2009-12-12 19:38:49 +01:00
|
|
|
# Minimal CMake build file to build cppcheck command line executable
|
|
|
|
|
2010-01-03 20:13:30 +01:00
|
|
|
SET(CHECKCLI_HDRS
|
|
|
|
cppcheckexecutor.h
|
|
|
|
threadexecutor.h
|
|
|
|
)
|
|
|
|
|
2009-12-12 19:38:49 +01:00
|
|
|
SET(CHECKCLI_SRCS
|
|
|
|
cppcheckexecutor.cpp
|
|
|
|
threadexecutor.cpp
|
|
|
|
main.cpp
|
|
|
|
)
|
|
|
|
|
2009-12-19 15:54:38 +01:00
|
|
|
# Add Windows resource file
|
|
|
|
if (WIN32)
|
2010-01-03 20:13:30 +01:00
|
|
|
SET(CHECKCLI_HDRS
|
|
|
|
${CHECKCLI_HDRS}
|
|
|
|
resource.h
|
|
|
|
)
|
|
|
|
|
2009-12-19 15:54:38 +01:00
|
|
|
SET(CHECKCLI_SRCS
|
|
|
|
${CHECKCLI_SRCS}
|
|
|
|
cppcheck.rc
|
|
|
|
)
|
|
|
|
endif (WIN32)
|
|
|
|
|
2009-12-19 15:21:46 +01:00
|
|
|
# Libraries to link
|
2010-01-31 11:36:56 +01:00
|
|
|
#set(CHECK_LIBS
|
|
|
|
# checklib
|
|
|
|
#)
|
|
|
|
|
|
|
|
aux_source_directory(${CPPCHECK_SOURCE_DIR}/lib LIB_SRCS)
|
2009-12-19 15:21:46 +01:00
|
|
|
|
|
|
|
# Windows needs additional shlwapi library
|
|
|
|
if (WIN32 AND NOT CYGWIN)
|
2009-12-17 21:31:13 +01:00
|
|
|
set(CHECK_LIBS
|
2009-12-19 15:21:46 +01:00
|
|
|
${CHECK_LIBS}
|
|
|
|
shlwapi
|
2009-12-17 21:31:13 +01:00
|
|
|
)
|
|
|
|
endif (WIN32 AND NOT CYGWIN)
|
|
|
|
|
2009-12-20 09:45:57 +01:00
|
|
|
if (CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
set(CMAKE_CXX_FLAGS
|
|
|
|
${CMAKE_CXX_FLAGS}
|
|
|
|
"-Wall -Wextra -pedantic"
|
|
|
|
)
|
|
|
|
endif (CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
|
2009-12-12 19:38:49 +01:00
|
|
|
include_directories (${CPPCHECK_SOURCE_DIR}/lib)
|
2010-02-14 08:26:55 +01:00
|
|
|
ADD_EXECUTABLE(../cppcheck ${CHECKCLI_SRCS} ${CHECKCLI_HDRS} ${LIB_SRCS})
|
2009-12-17 21:31:13 +01:00
|
|
|
TARGET_LINK_LIBRARIES(cppcheck ${CHECK_LIBS})
|
2009-12-12 19:38:49 +01:00
|
|
|
|