Skip to content

Commit 7be31bf

Browse files
committed
migrate to CMake build
1 parent ea37185 commit 7be31bf

33 files changed

+311
-259
lines changed

Diff for: CMakeLists.txt

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
cmake_minimum_required( VERSION 3.1.0 )
2+
# 3.1.0 for FindThreads with namespace Threads::Threads
3+
4+
project( lzopfs )
5+
6+
set( CMAKE_CXX_STANDARD 11 )
7+
8+
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake" )
9+
10+
include( TestBigEndian )
11+
TEST_BIG_ENDIAN( IS_BIG_ENDIAN )
12+
if ( IS_BIG_ENDIAN )
13+
add_definitions( -DUSE_BIG_ENDIAN=1 )
14+
else()
15+
add_definitions( -DUSE_BIG_ENDIAN=0 )
16+
endif()
17+
18+
find_package( Threads REQUIRED )
19+
find_package( LibLZMA REQUIRED )
20+
find_package( ZLIB REQUIRED )
21+
find_package( BZip2 REQUIRED )
22+
find_package( Lzo REQUIRED )
23+
find_package( fuse REQUIRED )
24+
25+
add_definitions( ${FUSE_DEFINITIONS} )
26+
27+
file( GLOB SOURCE_FILES src/*.cpp )
28+
29+
include_directories( ${LIBLZMA_INCLUDE_DIR} ${BZIP2_INCLUDE_DIR} ${LZO_INCLUDE_DIR} ${FUSE_INCLUDE_DIRS} )
30+
31+
message(STATUS "Lzo Library ${LZO_LIB}")
32+
message(STATUS "Lzo Include Found in ${LZO_INCLUDE_DIR}")
33+
34+
add_executable( lzopfs ${SOURCE_FILES} )
35+
target_link_libraries( lzopfs Threads::Threads ZLIB::ZLIB ${LIBLZMA_LIBRARIES} ${BZIP2_LIBRARIES} ${LZO_LIB} ${FUSE_LIBRARIES} )

Diff for: SConsUtil.py

-103
This file was deleted.

Diff for: SConstruct

-52
This file was deleted.

Diff for: TR1.h

-27
This file was deleted.

Diff for: cmake/FindLzo.cmake

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# - Find LZO (lzo.h, liblzo2.a)
2+
# This module defines
3+
# LZO_INCLUDE_DIR, directory containing headers
4+
# LZO_STATIC_LIB, path to libslzo2.a
5+
# LZO_FOUND, whether lzo has been found
6+
7+
find_path(LZO_INCLUDE_DIR NAMES lzo/lzoconf.h)
8+
9+
find_library(LZO_LIB NAMES liblzo2.so)
10+
11+
if (LZO_LIB)
12+
if (LZO_INCLUDE_DIR)
13+
set(LZO_FOUND TRUE)
14+
else ()
15+
set(LZO_FOUND FALSE)
16+
endif()
17+
else ()
18+
set(LZO_FOUND FALSE)
19+
endif ()
20+
21+
if (LZO_FOUND)
22+
if (NOT LZO_FIND_QUIETLY)
23+
message(STATUS "Lzo Library ${LZO_LIB}")
24+
message(STATUS "Lzo Include Found in ${LZO_INCLUDE_DIR}")
25+
endif ()
26+
else ()
27+
message(STATUS "Lzo includes and libraries NOT found. ")
28+
endif ()
29+
30+
mark_as_advanced(
31+
LZO_INCLUDE_DIR
32+
LZO_LIBS
33+
)

0 commit comments

Comments
 (0)