kusano 7d535a
project(lzotools)
kusano 7d535a
429ee8
if(MSVC)
kusano 7d535a
	# use pre-built 2.03
kusano 7d535a
	get_filename_component(LZO_PATH ${SDKROOT}/lzo/2.03 ABSOLUTE)
kusano 7d535a
	link_directories(${LZO_PATH}/LZO_lib/)
kusano 7d535a
	if (CMAKE_SIZEOF_VOID_P EQUAL 8) 
kusano 7d535a
		set(PREFIX _64)
kusano 7d535a
	endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
429ee8
else()
roentgen 3047bb
    set(LZO_PATH ${LZO_INCLUDE_DIR})
429ee8
endif()
kusano 7d535a
kusano 7d535a
include_directories(${LZO_PATH} ${LZO_PATH}/include)
kusano 7d535a
add_definitions(-DLZO_USE_ASM)
kusano 7d535a
add_executable(lzocompress  lzocompress.c)
Keisuke Ogaki 9cb85e
add_executable(lzodecompress lzodecompress.c)
429ee8
if(MSVC)
Keisuke Ogaki 9cb85e
	target_link_libraries(lzocompress lzo2${PREFIX} ${LZO_LIBRARY})
Keisuke Ogaki 9cb85e
	target_link_libraries(lzodecompress lzo2${PREFIX} ${LZO_LIBRARY})
429ee8
else()
Keisuke Ogaki 9cb85e
	target_link_libraries(lzocompress ${LZO_LIBRARY})
Keisuke Ogaki 9cb85e
	target_link_libraries(lzodecompress ${LZO_LIBRARY})
Keisuke Ogaki 9cb85e
endif()
Keisuke Ogaki 1a50d4
set(LZODRIVER_FOUND true PARENT_SCOPE)