Skip to content

Commit 392def8

Browse files
committed
Adding CMake
1 parent f312c0c commit 392def8

File tree

2 files changed

+40
-4
lines changed

2 files changed

+40
-4
lines changed

CMakeLists.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
cmake_minimum_required(VERSION 2.8.7)
3+
if (NOT CMAKE_BUILD_TYPE)
4+
message(STATUS "No build type selected, default to Release")
5+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
6+
endif()
7+
MESSAGE( STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} )
8+
9+
project(FrameOfReference CXX C)
10+
set(PROJECT_URL "https://github.com/lemire/FrameOfReference")
11+
set(PROJECT_DESCRIPTION "C++ library to pack and unpack vectors of integers having a small range of values using a technique called Frame of Reference")
12+
13+
14+
15+
# library target
16+
include_directories(include)
17+
add_library(FrameOfReference STATIC ./src/bpacking.cpp
18+
${HEADERS}
19+
)
20+
enable_testing()
21+
22+
23+
add_executable(unit src/test)
24+
target_link_libraries(unit FrameOfReference)
25+
add_test(unit unit ${PROJECT_SOURCE_DIR}/sampledata.txt )

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## What is this?
55

66
C++ library to pack and unpack vectors of integers having a small
7-
range of values using a technique called Frame of Reference (Goldstein et al. 1998).
7+
range of values using a technique called Frame of Reference (Goldstein et al. 1998).
88
It should run fast even though it is written in simple C++.
99

1010
## Code usage :
@@ -61,10 +61,10 @@ turbouncompress64(compresseddata, recoverydata, nvalue);
6161
// nvalue will be equal to length
6262
```
6363
64-
## Usage:
64+
## Usage (with Makefile)
65+
66+
To run a simple benchmark, do
6567
66-
To run a simple benchmark, do
67-
6868
make
6969
./test sampledata.txt
7070
@@ -77,6 +77,17 @@ For a parallelized version, type
7777
7878
This requires OpenMP support however.
7979
80+
81+
## Usage (with CMake under macOS and Linux)
82+
83+
You need to have ``cmake`` installed and available as a command.
84+
85+
make release
86+
cd release
87+
cmake ..
88+
make
89+
make test
90+
8091
## Requirements:
8192
8293
This was tested with GNU G++ and clang++ After suitable adjustments, it should

0 commit comments

Comments
 (0)