Make workaround fix for ticket #1299.
Since lib does not work when built as an static library, compile lib code as part of cli/gui code.
This commit is contained in:
parent
1a59e1bc68
commit
116772da7e
|
@ -14,7 +14,12 @@ cmake_minimum_required (VERSION 2.6)
|
|||
|
||||
PROJECT(CPPCHECK)
|
||||
|
||||
ADD_SUBDIRECTORY(lib)
|
||||
# Building lib as static library is disabled due to bug
|
||||
# #1299 CMake: The CheckClass is not used
|
||||
# https://sourceforge.net/apps/trac/cppcheck/ticket/1299
|
||||
# Instead lib code is included directly into cli and gui targets
|
||||
# ADD_SUBDIRECTORY(lib)
|
||||
|
||||
ADD_SUBDIRECTORY(cli)
|
||||
|
||||
# Exclude tests from command line targets but include them to VS IDE targets.
|
||||
|
|
|
@ -25,9 +25,11 @@ if (WIN32)
|
|||
endif (WIN32)
|
||||
|
||||
# Libraries to link
|
||||
set(CHECK_LIBS
|
||||
checklib
|
||||
)
|
||||
#set(CHECK_LIBS
|
||||
# checklib
|
||||
#)
|
||||
|
||||
aux_source_directory(${CPPCHECK_SOURCE_DIR}/lib LIB_SRCS)
|
||||
|
||||
# Windows needs additional shlwapi library
|
||||
if (WIN32 AND NOT CYGWIN)
|
||||
|
@ -45,6 +47,6 @@ if (CMAKE_COMPILER_IS_GNUCXX)
|
|||
endif (CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
include_directories (${CPPCHECK_SOURCE_DIR}/lib)
|
||||
ADD_EXECUTABLE(cppcheck ${CHECKCLI_SRCS} ${CHECKCLI_HDRS})
|
||||
ADD_EXECUTABLE(cppcheck ${CHECKCLI_SRCS} ${CHECKCLI_HDRS} ${LIB_SRCS})
|
||||
TARGET_LINK_LIBRARIES(cppcheck ${CHECK_LIBS})
|
||||
|
||||
|
|
|
@ -89,10 +89,12 @@ SET(CHECK_TRANS
|
|||
|
||||
SET(CHECK_RCCS gui.qrc)
|
||||
|
||||
aux_source_directory(${CPPCHECK_SOURCE_DIR}/lib LIB_SRCS)
|
||||
|
||||
# Libraries to link
|
||||
set(CHECK_LIBS
|
||||
checklib
|
||||
)
|
||||
#set(CHECK_LIBS
|
||||
# checklib
|
||||
#)
|
||||
|
||||
# Windows needs additional shlwapi library
|
||||
if (WIN32 AND NOT CYGWIN)
|
||||
|
@ -130,7 +132,7 @@ SOURCE_GROUP("Moc Files" "moc_.*cxx$")
|
|||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
ADD_EXECUTABLE(gui WIN32 ${CHECKGUI_SRCS} ${CHECK_MOC_SRCS} ${CHECK_HEADERS}
|
||||
${CHECK_UIS_H} ${CHECK_RCC_SRCS})
|
||||
${CHECK_UIS_H} ${CHECK_RCC_SRCS} ${LIB_SRCS})
|
||||
TARGET_LINK_LIBRARIES(gui ${CHECK_LIBS} ${QT_LIBRARIES})
|
||||
|
||||
ELSE(QT4_FOUND)
|
||||
|
|
Loading…
Reference in New Issue