From 6f47f779779c3f9d5bc96e34a4d461febd31290a Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Mon, 1 Feb 2010 20:16:30 +0200 Subject: [PATCH] CMake - fix building tests for Visual Studio. Need to include lib sources directly to test project also. --- test/CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5f8d59caa..87a0906ab 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -32,10 +32,12 @@ SET(CHECKTEST_SRCS testmathlib.cpp ) +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) @@ -53,11 +55,11 @@ if (CMAKE_COMPILER_IS_GNUCXX) endif (CMAKE_COMPILER_IS_GNUCXX) include_directories (${CPPCHECK_SOURCE_DIR}/lib) -ADD_EXECUTABLE(test ${CHECKTEST_SRCS} ${CHECKTEST_HDRS}) +ADD_EXECUTABLE(test ${CHECKTEST_SRCS} ${CHECKTEST_HDRS} ${LIB_SRCS}) TARGET_LINK_LIBRARIES(test ${CHECK_LIBS}) # Add custom 'make check' -target # It compiles and runs tests add_custom_target(check COMMAND test) -add_dependencies(check test checklib) +add_dependencies(check test)