style cleanup
[blender.git] / intern / ghost / test / CMakeLists.txt
index b8630427b71cfc46f7dfd2faeb36bccec64e8158..75f082fe83430976e915cd09c974f76304b6cbba 100644 (file)
@@ -34,6 +34,25 @@ macro(suffix_relpaths
 endmacro()
 
 
+# -----------------------------------------------------------------------------
+# Defines
+
+# set the endian define
+if(MSVC)
+       # for some reason this fails on msvc
+       add_definitions(-D__LITTLE_ENDIAN__)
+else()
+       include(TestBigEndian)
+       test_big_endian(_SYSTEM_BIG_ENDIAN)
+       if(_SYSTEM_BIG_ENDIAN)
+               add_definitions(-D__BIG_ENDIAN__)
+       else()
+               add_definitions(-D__LITTLE_ENDIAN__)
+       endif()
+       unset(_SYSTEM_BIG_ENDIAN)
+endif()
+
+
 # -----------------------------------------------------------------------------
 # Libraries
 
@@ -58,11 +77,42 @@ suffix_relpaths(SRC_NEW "${SRC}" "../../guardedalloc/")
 include_directories(${INC_NEW})
 add_library(guardedalloc_lib ${SRC_NEW})
 
+# blenfont 
+include(${CMAKE_SOURCE_DIR}/../../../source/blender/blenfont/CMakeLists.txt)
+suffix_relpaths(INC_NEW "${INC}" "../../../source/blender/blenfont/")
+suffix_relpaths(SRC_NEW "${SRC}" "../../../source/blender/blenfont/")
+include_directories(${INC_NEW})
+add_library(blenfont_lib ${SRC_NEW})
+
+# grr, blenfont needs BLI
+include_directories(
+               "../../../source/blender/blenlib"
+               "../../../source/blender/blenloader"
+               )
+add_library(bli_lib 
+               "../../../source/blender/blenlib/intern/fileops.c"
+               "../../../source/blender/blenlib/intern/rct.c"
+               "../../../source/blender/blenlib/intern/string.c"
+               "../../../source/blender/blenlib/intern/string_utf8.c"
+               "../../../source/blender/blenlib/intern/listbase.c"
+               "../../../source/blender/blenlib/intern/storage.c"
+               "../../../source/blender/blenlib/intern/path_util.c"
+               "../../../source/blender/blenlib/intern/BLI_dynstr.c"
+               "../../../source/blender/blenlib/intern/BLI_linklist.c"
+               "../../../source/blender/blenlib/intern/BLI_memarena.c"
+               )
+
 
 find_package(OpenGL REQUIRED)
 
+find_package(Freetype REQUIRED)
+
+find_package(ZLIB REQUIRED)
+
 include_directories(${CMAKE_SOURCE_DIR}/../)
 include_directories(${OPENGL_INCLUDE_DIR})
+include_directories(${FREETYPE_INCLUDE_DIRS})
+include_directories(${CMAKE_SOURCE_DIR}/../../../source/blender/blenfont)
 
 if(UNIX AND NOT APPLE)
        find_package(X11 REQUIRED)
@@ -105,6 +155,7 @@ target_link_libraries(gears_cpp
 
 # MultiTest (C)
 add_executable(multitest_c
+       ${CMAKE_SOURCE_DIR}/../../../source/blender/editors/datafiles/bfont.ttf.c
        ${CMAKE_SOURCE_DIR}/multitest/Basic.c
        ${CMAKE_SOURCE_DIR}/multitest/EventToBuf.c
        ${CMAKE_SOURCE_DIR}/multitest/MultiTest.c
@@ -114,10 +165,14 @@ add_executable(multitest_c
 )
 
 target_link_libraries(multitest_c
+               blenfont_lib
+               bli_lib
                ghost_lib
                string_lib
                guardedalloc_lib
                ${OPENGL_gl_LIBRARY}
                ${OPENGL_glu_LIBRARY}
+               ${FREETYPE_LIBRARY}
+               ${ZLIB_LIBRARIES}
                ${PLATFORM_LINKLIBS}
                )