mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
cleanup cmake config
This commit is contained in:
parent
12193e473c
commit
544758f3d2
7 changed files with 62 additions and 66 deletions
|
@ -1,30 +1,53 @@
|
|||
|
||||
include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
|
||||
|
||||
|
||||
########### next target ###############
|
||||
|
||||
set($(tests)_SRCS ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules (CHECK check)
|
||||
|
||||
if(KDE4_BUILD_TESTS)
|
||||
if(CHECK_FOUND)
|
||||
|
||||
kde4_add_executable($(tests) ${$(tests)_SRCS})
|
||||
set(test_rtsp_SOURCES test_common.h test_rtsp.c)
|
||||
add_executable(test_rtsp ${test_rtsp_SOURCES})
|
||||
target_link_libraries(test_rtsp miracle-shared)
|
||||
target_link_libraries(test_rtsp ${CHECK_LIBRARIES})
|
||||
target_link_libraries(test_rtsp ${UDEV_LIBRARIES})
|
||||
target_link_libraries(test_rtsp ${GLIB2_LIBRARIES})
|
||||
|
||||
target_link_libraries($(tests) ${KDE4_KDECORE_LIBS})
|
||||
set(test_wpas_SOURCES test_common.h test_wpas.c)
|
||||
add_executable(test_wpas ${test_wpas_SOURCES})
|
||||
target_link_libraries(test_wpas miracle-shared)
|
||||
target_link_libraries(test_wpas ${CHECK_LIBRARIES})
|
||||
target_link_libraries(test_wpas ${UDEV_LIBRARIES})
|
||||
target_link_libraries(test_wpas ${GLIB2_LIBRARIES})
|
||||
|
||||
endif(KDE4_BUILD_TESTS)
|
||||
set(test_valgrind_SOURCES test_common.h test_valgrind.c)
|
||||
add_executable(test_valgrind ${test_valgrind_SOURCES})
|
||||
target_link_libraries(test_valgrind miracle-shared)
|
||||
target_link_libraries(test_valgrind ${CHECK_LIBRARIES})
|
||||
target_link_libraries(test_valgrind ${UDEV_LIBRARIES})
|
||||
target_link_libraries(test_valgrind ${GLIB2_LIBRARIES})
|
||||
|
||||
########### next target ###############
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/shared)
|
||||
|
||||
set(test_valgrind_SRCS test_valgrind.c $(test_sources))
|
||||
set(VALGRIND CK_FORK=no valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --leak-resolution=high --error-exitcode=1 --suppressions=${CMAKE_SOURCE_DIR}/test.supp)
|
||||
|
||||
if(KDE4_BUILD_TESTS)
|
||||
add_custom_target(memcheck-verify
|
||||
DEPENDS test_rtsp test_wpas test_valgrind
|
||||
COMMAND ${VALGRIND} --log-file=/dev/null ./test_valgrind >/dev/null |
|
||||
test 1 = $$?
|
||||
COMMENT "verify memcheck")
|
||||
|
||||
kde4_add_executable(test_valgrind ${test_valgrind_SRCS})
|
||||
add_custom_target(memcheck
|
||||
DEPENDS memcheck-verify
|
||||
COMMAND for i in $(MEMTESTS) |
|
||||
do |
|
||||
${VALGRIND} --log-file=${CMAKE_SOURCE_DIR}/$$i.memlog |
|
||||
${CMAKE_SOURCE_DIR}/$$i >/dev/null || (echo "memcheck failed on: $$i" ; exit 1) ; |
|
||||
done
|
||||
SOURCES test_rtsp test_valgrind test_wpas
|
||||
COMMENT "verify memcheck")
|
||||
|
||||
target_link_libraries(test_valgrind ${KDE4_KDECORE_LIBS})
|
||||
|
||||
endif(KDE4_BUILD_TESTS)
|
||||
endif(CHECK_FOUND)
|
||||
|
||||
########### install files ###############
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue