From 991ea4532d62bfb65b4216eb6786934e04e42693 Mon Sep 17 00:00:00 2001 From: Vladimir Timofeev Date: Sun, 21 Dec 2014 16:41:45 +0300 Subject: [PATCH] cmake: fix using of external/xxhash for msvc generated project --- CMakeLists.txt | 6 +++--- cocos/CMakeLists.txt | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bc906701a48..56031ede6653 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -265,10 +265,10 @@ set(FLATBUFFERS_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/external) message(STATUS "Flatbuffers include dirs: ${FLATBUFFERS_INCLUDE_DIRS}") -# build for 3rd party libraries -if(LINUX OR APPLE) +# build xxhash add_subdirectory(external/xxhash) -endif() +set(XXHASH_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/external/xxhash) +set(XXHASH_LIBRARIES xxhash) # libcocos2d.a add_subdirectory(cocos) diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index aceedb2d8cb6..2f337551f1fb 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -79,9 +79,7 @@ set(COCOS_SRC cocos2d.cpp ) #todo: provide prebuild versions of the xx libs for all platforms - include_directories( - ../external/xxhash - ../external/xxtea) + include_directories(../external/xxtea) add_library(cocos2d ${COCOS_SRC}) @@ -127,11 +125,11 @@ else() message( FATAL_ERROR "Unsupported platform, CMake will exit" ) endif() -foreach(pkg ZLIB MINIZIP JPEG PNG TIFF TinyXML2 FREETYPE WEBSOCKETS CURL FLATBUFFERS) +foreach(pkg ZLIB MINIZIP JPEG PNG TIFF TinyXML2 FREETYPE WEBSOCKETS CURL FLATBUFFERS XXHASH) cocos_use_pkg(cocos2d ${pkg}) endforeach() -target_link_libraries(cocos2d xxhash ${PLATFORM_SPECIFIC_LIBS}) +target_link_libraries(cocos2d ${PLATFORM_SPECIFIC_LIBS}) if(USE_WEBP) add_definitions(-DCC_USE_WEBP=1)