CMake - Fix Windows build.
This commit is contained in:
parent
b619538aa3
commit
d70c60b702
|
@ -6,7 +6,19 @@ SET(CHECKCLI_SRCS
|
|||
main.cpp
|
||||
)
|
||||
|
||||
# Windows needs additional shlwapi library
|
||||
if (WIN32 AND NOT CYGWIN)
|
||||
set(CHECK_LIBS
|
||||
checklib
|
||||
shlwapi
|
||||
)
|
||||
else (WIN32 AND NOT CYGWIN)
|
||||
set(CHECK_LIBS
|
||||
checklib
|
||||
)
|
||||
endif (WIN32 AND NOT CYGWIN)
|
||||
|
||||
include_directories (${CPPCHECK_SOURCE_DIR}/lib)
|
||||
ADD_EXECUTABLE(cppcheck ${CHECKCLI_SRCS})
|
||||
TARGET_LINK_LIBRARIES(cppcheck checklib)
|
||||
TARGET_LINK_LIBRARIES(cppcheck ${CHECK_LIBS})
|
||||
|
||||
|
|
|
@ -75,6 +75,18 @@ SET(CHECK_TRANS
|
|||
|
||||
SET(CHECK_RCCS gui.qrc)
|
||||
|
||||
# Windows needs additional shlwapi library
|
||||
if (WIN32 AND NOT CYGWIN)
|
||||
set(CHECK_LIBS
|
||||
checklib
|
||||
shlwapi
|
||||
)
|
||||
else (WIN32 AND NOT CYGWIN)
|
||||
set(CHECK_LIBS
|
||||
checklib
|
||||
)
|
||||
endif (WIN32 AND NOT CYGWIN)
|
||||
|
||||
# Generate rules for building source files from the resources
|
||||
QT4_ADD_RESOURCES(CHECK_RCC_SRCS ${CHECK_RCCS})
|
||||
|
||||
|
@ -94,5 +106,5 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|||
|
||||
ADD_EXECUTABLE(gui ${CHECKGUI_SRCS} ${CHECK_MOC_SRCS} ${CHECK_UIS_H}
|
||||
${CHECK_RCC_SRCS} ${CHECK_QM})
|
||||
TARGET_LINK_LIBRARIES(gui checklib ${QT_LIBRARIES})
|
||||
TARGET_LINK_LIBRARIES(gui ${CHECK_LIBS} ${QT_LIBRARIES})
|
||||
|
||||
|
|
|
@ -28,7 +28,19 @@ SET(CHECKTEST_SRCS
|
|||
testmathlib.cpp
|
||||
)
|
||||
|
||||
# Windows needs additional shlwapi library
|
||||
if (WIN32 AND NOT CYGWIN)
|
||||
set(CHECK_LIBS
|
||||
checklib
|
||||
shlwapi
|
||||
)
|
||||
else (WIN32 AND NOT CYGWIN)
|
||||
set(CHECK_LIBS
|
||||
checklib
|
||||
)
|
||||
endif (WIN32 AND NOT CYGWIN)
|
||||
|
||||
include_directories (${CPPCHECK_SOURCE_DIR}/lib)
|
||||
ADD_EXECUTABLE(test ${CHECKTEST_SRCS})
|
||||
TARGET_LINK_LIBRARIES(test checklib)
|
||||
TARGET_LINK_LIBRARIES(test ${CHECK_LIBS})
|
||||
|
||||
|
|
Loading…
Reference in New Issue