From 62ea6f316f334b3d0f77e26f87398f75e054115c Mon Sep 17 00:00:00 2001 From: Kuba Serafinowski Date: Mon, 2 Jun 2014 18:36:42 +0300 Subject: don't look for CMocka if we're not building unit tests --- csync/CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'csync/CMakeLists.txt') diff --git a/csync/CMakeLists.txt b/csync/CMakeLists.txt index 86b0d98c7..a80504449 100644 --- a/csync/CMakeLists.txt +++ b/csync/CMakeLists.txt @@ -27,10 +27,14 @@ include(MacroCopyFile) if (NOT WIN32) find_package(Iconv) endif (NOT WIN32) -find_package(CMocka) -if (CMOCKA_FOUND AND UNIT_TESTING) - include(AddCMockaTest) -endif (CMOCKA_FOUND AND UNIT_TESTING) + +if (UNIT_TESTING) + find_package(CMocka) + if (CMOCKA_FOUND) + include(AddCMockaTest) + add_subdirectory(tests) + endif (CMOCKA_FOUND) +endif (UNIT_TESTING) include(ConfigureChecks.cmake) @@ -47,10 +51,6 @@ endif (MEM_NULL_TESTS) add_subdirectory(src) -if (CMOCKA_FOUND AND UNIT_TESTING) - add_subdirectory(tests) -endif (CMOCKA_FOUND AND UNIT_TESTING) - configure_file(config_csync.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_csync.h) configure_file(config_test.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_test.h) -- cgit v1.2.3