Fix: added missing statements in the makefile and split the sources variable.
authorGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Sat, 7 Jan 2012 16:20:58 +0000 (14:20 -0200)
committerGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Sat, 7 Jan 2012 16:20:58 +0000 (14:20 -0200)
test/CMakeLists.txt

index d8b3415..03b5fe9 100644 (file)
@@ -1,3 +1,6 @@
+# package: find external packages
+include(FindPkgConfig)
+
 # package: required boost libraries
 set(Boost_USE_STATIC_LIBS OFF)
 set(Boost_USE_MULTITHREADED ON)
@@ -17,14 +20,18 @@ include_directories(${CMAKE_SOURCE_DIR}/src)
 # compiler: include directories where the source code is located
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
 
-# compiler: source code files
+# compiler: source code from test cases
+set(TESTS_SOURCES
+    test_messagepayload.cpp
+)
+
+# compiler: source code to be tested
 set(SOURCES
-   test_messagepayload.cpp
-   ../src/host/messagepayload.cpp
+    ${CMAKE_SOURCE_DIR}/src/host/messagepayload.cpp
 )
 
 # compiler: creates the binary
-add_executable(test_${TARGET} ${SOURCES})
+add_executable(test_${TARGET} ${SOURCES} ${TESTS_SOURCES})
 
 # cmake: add a custom "make check" target which automatically builds the binary
 add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS test_${TARGET})