CMakeLists.txt 927 B

12345678910111213141516171819202122232425262728293031323334
  1. # This is an alternative CMakeLists.txt to the experimental one
  2. # shipped with the original package. It builds only the essential
  3. # for our tests. The WebKit version of gtest needs access to some
  4. # headers from WTF and JSC for configuration.
  5. include_directories(${THIRDPARTY_DIR}/gtest
  6. ${THIRDPARTY_DIR}/gtest/include
  7. ${JAVASCRIPTCORE_DIR}
  8. ${WTF_DIR}
  9. )
  10. set(GTEST_DIR "${THIRDPARTY_DIR}/gtest")
  11. add_library(gtest SHARED
  12. ${GTEST_DIR}/src/gtest.cc
  13. ${GTEST_DIR}/src/gtest-death-test.cc
  14. ${GTEST_DIR}/src/gtest-filepath.cc
  15. ${GTEST_DIR}/src/gtest_main.cc
  16. ${GTEST_DIR}/src/gtest-port.cc
  17. ${GTEST_DIR}/src/gtest-test-part.cc
  18. ${GTEST_DIR}/src/gtest-typed-test.cc
  19. )
  20. add_definitions(-DGTEST_CREATE_SHARED_LIBRARY=1)
  21. target_link_libraries(gtest
  22. WTF
  23. )
  24. if (CMAKE_USE_PTHREADS_INIT)
  25. target_link_libraries(gtest ${CMAKE_THREAD_LIBS_INIT})
  26. add_definitions(-DGTEST_HAS_PTHREAD=1)
  27. endif ()