From 41eb141e61e672775c94cdba831752f18250df54 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Sat, 19 Dec 2009 16:21:46 +0200 Subject: [PATCH] CMake - cleaner way to set additional library for Windows. --- cli/CMakeLists.txt | 11 ++++++----- gui/CMakeLists.txt | 11 ++++++----- test/CMakeLists.txt | 11 ++++++----- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index 10127b2ba..cfe7631e8 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -6,16 +6,17 @@ SET(CHECKCLI_SRCS main.cpp ) +# Libraries to link +set(CHECK_LIBS + checklib +) + # Windows needs additional shlwapi library if (WIN32 AND NOT CYGWIN) set(CHECK_LIBS - checklib + ${CHECK_LIBS} shlwapi ) -else (WIN32 AND NOT CYGWIN) -set(CHECK_LIBS - checklib -) endif (WIN32 AND NOT CYGWIN) include_directories (${CPPCHECK_SOURCE_DIR}/lib) diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 59d8fe010..8f01ccb7b 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -75,16 +75,17 @@ SET(CHECK_TRANS SET(CHECK_RCCS gui.qrc) +# Libraries to link +set(CHECK_LIBS + checklib +) + # Windows needs additional shlwapi library if (WIN32 AND NOT CYGWIN) set(CHECK_LIBS - checklib + ${CHECK_LIBS} shlwapi ) -else (WIN32 AND NOT CYGWIN) -set(CHECK_LIBS - checklib -) endif (WIN32 AND NOT CYGWIN) # Generate rules for building source files from the resources diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ee46dfeb8..c78eec661 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -28,16 +28,17 @@ SET(CHECKTEST_SRCS testmathlib.cpp ) +# Libraries to link +set(CHECK_LIBS + checklib +) + # Windows needs additional shlwapi library if (WIN32 AND NOT CYGWIN) set(CHECK_LIBS - checklib + ${CHECK_LIBS} shlwapi ) -else (WIN32 AND NOT CYGWIN) -set(CHECK_LIBS - checklib -) endif (WIN32 AND NOT CYGWIN) include_directories (${CPPCHECK_SOURCE_DIR}/lib)