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:
Kimmo Varis 2010-01-31 12:36:56 +02:00
parent 1a59e1bc68
commit 116772da7e
3 changed files with 18 additions and 9 deletions

View File

@ -14,7 +14,12 @@ cmake_minimum_required (VERSION 2.6)
PROJECT(CPPCHECK) 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) ADD_SUBDIRECTORY(cli)
# Exclude tests from command line targets but include them to VS IDE targets. # Exclude tests from command line targets but include them to VS IDE targets.

View File

@ -25,9 +25,11 @@ if (WIN32)
endif (WIN32) endif (WIN32)
# Libraries to link # Libraries to link
set(CHECK_LIBS #set(CHECK_LIBS
checklib # checklib
) #)
aux_source_directory(${CPPCHECK_SOURCE_DIR}/lib LIB_SRCS)
# Windows needs additional shlwapi library # Windows needs additional shlwapi library
if (WIN32 AND NOT CYGWIN) if (WIN32 AND NOT CYGWIN)
@ -45,6 +47,6 @@ if (CMAKE_COMPILER_IS_GNUCXX)
endif (CMAKE_COMPILER_IS_GNUCXX) endif (CMAKE_COMPILER_IS_GNUCXX)
include_directories (${CPPCHECK_SOURCE_DIR}/lib) 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}) TARGET_LINK_LIBRARIES(cppcheck ${CHECK_LIBS})

View File

@ -89,10 +89,12 @@ SET(CHECK_TRANS
SET(CHECK_RCCS gui.qrc) SET(CHECK_RCCS gui.qrc)
aux_source_directory(${CPPCHECK_SOURCE_DIR}/lib LIB_SRCS)
# Libraries to link # Libraries to link
set(CHECK_LIBS #set(CHECK_LIBS
checklib # checklib
) #)
# Windows needs additional shlwapi library # Windows needs additional shlwapi library
if (WIN32 AND NOT CYGWIN) if (WIN32 AND NOT CYGWIN)
@ -130,7 +132,7 @@ SOURCE_GROUP("Moc Files" "moc_.*cxx$")
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
ADD_EXECUTABLE(gui WIN32 ${CHECKGUI_SRCS} ${CHECK_MOC_SRCS} ${CHECK_HEADERS} 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}) TARGET_LINK_LIBRARIES(gui ${CHECK_LIBS} ${QT_LIBRARIES})
ELSE(QT4_FOUND) ELSE(QT4_FOUND)