~tatokis/unity/gcc-72-errors

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Marco Trevisan (Treviño)
  • Date: 2016-11-29 14:41:43 UTC
  • mto: This revision was merged to the branch mainline in revision 4210.
  • Revision ID: mail@3v1n0.net-20161129144143-oce04wt8p12xyg3h
CMakeLists.txt: add support to compile with GTest 1.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
304
304
add_subdirectory(gnome)
305
305
 
306
306
if (ENABLE_UNIT_TESTS)
307
 
  # Check for google test and build it locally
308
 
  set (
309
 
    GMOCK_ROOT_DIR
310
 
    "/usr/src/gmock"
311
 
    CACHE
312
 
    PATH
313
 
    "Path to Google mock srcs"
314
 
  )
315
 
 
316
 
  set (
317
 
    GMOCK_INCLUDE_DIR
318
 
    "/usr/include/gmock/include"
319
 
    CACHE
320
 
    PATH
321
 
    "Path to Google mock include"
322
 
  )
323
 
 
324
 
  set(
325
 
    GTEST_ROOT_DIR
326
 
    "${GMOCK_ROOT_DIR}/gtest" # Default value, adjustable by user with e.g., ccmake
327
 
    CACHE
328
 
    PATH
329
 
    "Path to Google test srcs"
330
 
  )
331
 
 
332
 
  set(
333
 
    GTEST_INCLUDE_DIR
334
 
    "${GMOCK_ROOT_DIR}/gtest/include"
335
 
    CACHE
336
 
    PATH
337
 
    "Path to Google tests include"
338
 
  )
339
 
 
340
 
  if (GTEST_INCLUDE_DIR AND GMOCK_INCLUDE_DIR)
341
 
    include_directories (
342
 
      ${GMOCK_INCLUDE_DIR}
343
 
      ${GTEST_INCLUDE_DIR}
344
 
    )
345
 
    add_subdirectory(
346
 
      ${GMOCK_ROOT_DIR}
347
 
      "${CMAKE_CURRENT_BINARY_DIR}/gmock"
348
 
    )
349
 
  elseif (GTEST_INCLUDE_DIR AND NOT GMOCK_INCLUDE_DIR)
350
 
    include_directories (
351
 
      ${GTEST_INCLUDE_DIR}
352
 
    )
353
 
  endif(GTEST_INCLUDE_DIR AND GMOCK_INCLUDE_DIR)
354
 
 
355
307
  add_subdirectory(tests)
356
 
 
357
308
else (ENABLE_UNIT_TESTS)
358
309
  set (MISSING_TESTS_MSG "-- Tests disabled, compile with -DENABLE_UNIT_TESTS=ON")
359
310
  add_custom_target (check COMMAND echo ${MISSING_TESTS_MSG})
390
341
         ADDITIONAL_MAKE_CLEAN_FILES api-doc)
391
342
 
392
343
endif (DOXYGEN_FOUND STREQUAL "YES")
 
344