forked from assimp/assimp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace cppunit with the googletest framework
The GTest framework has a more active support base, and natively supports CMake. Introduce it as an external dependency (using CMake's ExternalProject_Add), replacing cppunit and porting the associated unit tests.
- Loading branch information
Showing
272 changed files
with
909 additions
and
81,850 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
find_package(Threads REQUIRED) | ||
include(ExternalProject) | ||
|
||
if(MSYS OR MINGW) | ||
set(DISABLE_PTHREADS ON) | ||
else() | ||
set(DISABLE_PTHREADS OFF) | ||
endif() | ||
|
||
if (MSVC) | ||
set(RELEASE_LIB_DIR ReleaseLibs) | ||
set(DEBUG_LIB_DIR DebugLibs) | ||
else() | ||
set(RELEASE_LIB_DIR "") | ||
set(DEBUG_LIB_DIR "") | ||
endif() | ||
|
||
set(GTEST_CMAKE_ARGS | ||
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" | ||
"-Dgtest_force_shared_crt=ON" | ||
"-Dgtest_disable_pthreads:BOOL=${DISABLE_PTHREADS}") | ||
set(GTEST_RELEASE_LIB_DIR "") | ||
set(GTEST_DEBUGLIB_DIR "") | ||
if (MSVC) | ||
set(GTEST_CMAKE_ARGS ${GTEST_CMAKE_ARGS} | ||
"-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=${DEBUG_LIB_DIR}" | ||
"-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=${RELEASE_LIB_DIR}") | ||
set(GTEST_LIB_DIR) | ||
endif() | ||
|
||
set(GTEST_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/gtest") | ||
|
||
ExternalProject_Add(gtest | ||
GIT_REPOSITORY https://chromium.googlesource.com/external/googletest | ||
TIMEOUT 10 | ||
PREFIX "${GTEST_PREFIX}" | ||
CMAKE_ARGS "${GTEST_CMAKE_ARGS}" | ||
LOG_DOWNLOAD ON | ||
LOG_CONFIGURE ON | ||
LOG_BUILD ON | ||
# Disable install | ||
INSTALL_COMMAND "" | ||
) | ||
|
||
set(LIB_PREFIX "${CMAKE_STATIC_LIBRARY_PREFIX}") | ||
set(LIB_SUFFIX "${CMAKE_STATIC_LIBRARY_SUFFIX}") | ||
set(GTEST_LOCATION "${GTEST_PREFIX}/src/gtest-build") | ||
set(GTEST_DEBUG_LIBRARIES | ||
"${GTEST_LOCATION}/${DEBUG_LIB_DIR}/${LIB_PREFIX}gtest${LIB_SUFFIX}" | ||
"${CMAKE_THREAD_LIBS_INIT}") | ||
SET(GTEST_RELEASE_LIBRARIES | ||
"${GTEST_LOCATION}/${RELEASE_LIB_DIR}/${LIB_PREFIX}gtest${LIB_SUFFIX}" | ||
"${CMAKE_THREAD_LIBS_INIT}") | ||
|
||
if(MSVC_VERSION EQUAL 1700) | ||
add_definitions(-D_VARIADIC_MAX=10) | ||
endif() | ||
|
||
ExternalProject_Get_Property(gtest source_dir) | ||
include_directories(${source_dir}/include) | ||
include_directories(${source_dir}/gtest/include) | ||
|
||
ExternalProject_Get_Property(gtest binary_dir) | ||
link_directories(${binary_dir}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.