Merge pull request #577 from g-pechorin/patch-4

not-git (and "nested" builds)
pull/580/merge
Alexander Gessler 2015-06-04 23:46:05 +02:00
commit 36a9f2be1a
6 changed files with 49 additions and 37 deletions

View File

@ -23,7 +23,7 @@ add_definitions( -DOPENDDL_NO_USE_CPP11 )
# Get the current working branch
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
@ -31,7 +31,7 @@ execute_process(
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)

View File

@ -30,6 +30,13 @@ endif()
set(GTEST_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/gtest")
# try to find git - if found, setup gtest
find_package(Git)
if(NOT GIT_FOUND)
set(AddGTest_FOUND false CACHE BOOL "Was gtest setup correctly?")
else(NOT GIT_FOUND)
set(AddGTest_FOUND true CACHE BOOL "Was gtest setup correctly?")
ExternalProject_Add(gtest
GIT_REPOSITORY https://chromium.googlesource.com/external/googletest
TIMEOUT 10
@ -62,3 +69,4 @@ include_directories(${source_dir}/gtest/include)
ExternalProject_Get_Property(gtest binary_dir)
link_directories(${binary_dir})
endif(NOT GIT_FOUND)

View File

@ -155,11 +155,11 @@ void BaseImporter::GetExtensionList(std::set<std::string>& extensions)
boost::scoped_array<char> _buffer (new char[searchBytes+1 /* for the '\0' */]);
char* buffer = _buffer.get();
const unsigned int read = pStream->Read(buffer,1,searchBytes);
const size_t read = pStream->Read(buffer,1,searchBytes);
if (!read)
return false;
for (unsigned int i = 0; i < read;++i)
for (size_t i = 0; i < read; ++i)
buffer[i] = ::tolower(buffer[i]);
// It is not a proper handling of unicode files here ...
@ -392,11 +392,11 @@ void BaseImporter::ConvertToUTF8(std::vector<char>& data)
// Convert to UTF8 data to ISO-8859-1
void BaseImporter::ConvertUTF8toISO8859_1(std::string& data)
{
unsigned int size = data.size();
unsigned int i = 0, j = 0;
size_t size = data.size();
size_t i = 0, j = 0;
while(i < size) {
if((unsigned char) data[i] < 0x80) {
if ((unsigned char) data[i] < (size_t) 0x80) {
data[j] = data[i];
} else if(i < size - 1) {
if((unsigned char) data[i] == 0xC2) {

View File

@ -80,7 +80,7 @@ void Value::setBool( bool value ) {
bool Value::getBool() {
assert( ddl_bool == m_type );
return ( bool ) ( *m_data );
return ( *m_data ) ? true : false;
}
void Value::setInt8( int8 value ) {

View File

@ -46,6 +46,7 @@ SET( TEST_SRCS
SOURCE_GROUP( tests FILES ${TEST_SRCS} )
if(AddGTest_FOUND)
add_executable( unit
unit/CCompilerTest.c
unit/Main.cpp
@ -60,5 +61,6 @@ target_link_libraries( unit assimp
debug ${GTEST_DEBUG_LIBRARIES}
optimized ${GTEST_RELEASE_LIBRARIES}
)
endif(AddGTest_FOUND)
add_subdirectory(headercheck)

View File

@ -46,7 +46,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AICMD_MAIN_INCLUDED
#define AICMD_MAIN_INCLUDED
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdio.h>
#include <string.h>