Add option to compile using shared gtest library (thanks to Tobias Hansen).

This commit is contained in:
David Capello 2012-03-19 14:33:49 -03:00
parent c6ad4a94c1
commit be82a49f86
3 changed files with 9 additions and 3 deletions

View File

@ -36,6 +36,7 @@ option(USE_SHARED_JPEGLIB "Use your installed copy of jpeglib" off)
option(USE_SHARED_ZLIB "Use your installed copy of zlib" off)
option(USE_SHARED_LIBPNG "Use your installed copy of libpng" off)
option(USE_SHARED_TINYXML "Use your installed copy of tinyxml" off)
option(USE_SHARED_GTEST "Use your installed copy of gtest" off)
option(USE_SHARED_ALLEGRO4 "Use shared Allegro 4 library (without resize support)" off)
option(ENABLE_MEMLEAK "Enable memory-leaks detector (only for developers)" off)
option(ENABLE_UPDATER "Enable automatic check for updates" on)

View File

@ -417,8 +417,10 @@ function(find_unittests dir dependencies)
file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/*_unittest.cpp)
list(REMOVE_AT ARGV 0)
# Add gtest include directory so we can #include <gtest/gtest.h> in tests source code
include_directories(${CMAKE_SOURCE_DIR}/third_party/gtest/include)
if(NOT USE_SHARED_GTEST)
# Add gtest include directory so we can #include <gtest/gtest.h> in tests source code
include_directories(${CMAKE_SOURCE_DIR}/third_party/gtest/include)
endif()
foreach(testsourcefile ${tests})
get_filename_component(testname ${testsourcefile} NAME_WE)

View File

@ -28,9 +28,12 @@ if(NOT USE_SHARED_TINYXML)
add_subdirectory(tinyxml)
endif()
if(NOT USE_SHARED_GTEST)
add_subdirectory(gtest)
endif()
if(ENABLE_UPDATER AND NOT USE_SHARED_CURL)
add_subdirectory(curl)
endif()
add_subdirectory(gtest)
add_subdirectory(loadpng)