1 # cmake file for debase 2 3 if (NOT DE_DEFS) 4 message(FATAL_ERROR "Include Defs.cmake") 5 endif () 6 7 set(DEBASE_SRCS 8 deDefs.c 9 deDefs.h 10 deFloat16.c 11 deFloat16.h 12 deInt32.c 13 deInt32.h 14 deInt32Test.c 15 deMath.c 16 deMath.h 17 deMemory.c 18 deMemory.h 19 deRandom.c 20 deRandom.h 21 deString.c 22 deString.h 23 ) 24 25 add_library(debase STATIC ${DEBASE_SRCS}) 26 27 # link debase to libm on unix systems 28 if (DE_OS_IS_UNIX) 29 find_library(MATH_LIBRARY NAMES libm m PATHS /usr/lib /lib) 30 if (NOT MATH_LIBRARY) 31 message(FATAL_ERROR "Can't find libm.") 32 endif (NOT MATH_LIBRARY) 33 target_link_libraries(debase ${MATH_LIBRARY}) 34 35 add_definitions(-D_XOPEN_SOURCE=600) 36 endif () 37 38 if (DE_OS_IS_ANDROID) 39 find_library(C_LIBRARY NAMES c PATHS /usr/lib /lib) 40 find_library(M_LIBRARY NAMES m PATHS /usr/lib /lib) 41 find_library(LOG_LIBRARY NAMES log PATHS /usr/lib) 42 target_link_libraries(debase ${C_LIBRARY} ${M_LIBRARY} ${LOG_LIBRARY} gcc) 43 endif () 44 45 if (DE_OS_IS_SYMBIAN) 46 target_link_libraries(debase gcc) 47 endif() 48