aboutsummaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt19
1 files changed, 14 insertions, 5 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 4671329..86f2b1b 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,7 +1,11 @@
find_package(Boost COMPONENTS log regex unit_test_framework REQUIRED QUIET)
+find_header_and_lib(LOG4CPLUS log4cplus/logger.h log4cplus REQUIRED QUIET)
# If we can change directory here add_definition and test-specific stuff could be moved to the test directory
-file(GLOB TEST_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *Test.cpp)
+set(TEST_SRCS
+ ByteBufferTest.cpp
+ MacTest.cpp
+ UuidTest.cpp)
add_definitions(-DBOOST_TEST_DYN_LINK)
foreach(testSrc ${TEST_SRCS})
@@ -11,14 +15,19 @@ foreach(testSrc ${TEST_SRCS})
#Add compile target
add_executable(${testName} ${testSrc})
- include_directories("${PROJECT_SOURCE_DIR}/ble")
- include_directories("${PROJECT_SOURCE_DIR}/include")
+ target_include_directories(${testName} PUBLIC "${PROJECT_SOURCE_DIR}/ble")
+ target_include_directories(${testName} PUBLIC "${PROJECT_SOURCE_DIR}/include")
+
add_dependencies(${testName} ble)
target_link_libraries(${testName} ble)
+ target_link_libraries(${testName} bluetooth)
+
+ target_include_directories(${testName} PUBLIC "${PROJECT_SOURCE_DIR}/apps")
+
target_link_libraries(${testName} pthread)
target_link_libraries(${testName} ${Boost_LIBRARIES})
-
- include_directories("${PROJECT_SOURCE_DIR}/apps")
+ target_include_directories(${testName} PUBLIC "${LOG4CPLUS_INCLUDE_DIRECTORY}")
+ target_link_libraries(${testName} "${LOG4CPLUS_LIBRARY}")
#I like to move testing binaries into a testBin directory
set_target_properties(${testName} PROPERTIES