project(lzotools)
if(MSVC)
# use pre-built 2.03
get_filename_component(LZO_PATH ${SDKROOT}/lzo/2.03 ABSOLUTE)
link_directories(${LZO_PATH}/LZO_lib/)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(PREFIX _64)
endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
else()
set(LZO_PATH ${LZO_INCLUDE_DIR})
endif()
include_directories(${LZO_PATH} ${LZO_PATH}/include)
add_definitions(-DLZO_USE_ASM)
add_executable(lzocompress lzocompress.c)
add_executable(lzodecompress lzodecompress.c)
if(MSVC)
target_link_libraries(lzocompress lzo2${PREFIX} ${LZO_LIBRARY})
target_link_libraries(lzodecompress lzo2${PREFIX} ${LZO_LIBRARY})
else()
target_link_libraries(lzocompress ${LZO_LIBRARY})
target_link_libraries(lzodecompress ${LZO_LIBRARY})
endif()
set(LZODRIVER_FOUND true PARENT_SCOPE)