Skip to content

Commit 0478390

Browse files
committed
Switch to cmake
1 parent d1366a6 commit 0478390

File tree

11 files changed

+67
-57
lines changed

11 files changed

+67
-57
lines changed

.gitignore

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,5 @@
11
# Editors
22
*.swp
33

4-
# Autotools/build artifacts
5-
.deps
6-
.libs
7-
8-
Makefile
9-
Makefile.in
10-
11-
aclocal.m4
12-
ar-lib
13-
autom4te.cache
14-
compile
15-
config.*
16-
configure
17-
depcomp
18-
install-sh
19-
libtool
20-
ltmain.sh
21-
m4
22-
missing
23-
stamp-h1
24-
test-driver
25-
26-
*.la
27-
*.lo
28-
*.o
4+
# Out-of-source build
5+
build

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ addons:
44
apt:
55
packages:
66
- check
7-
script:
8-
# Not sure why this is needed ... works OK locally.
9-
- mkdir m4
10-
- autoreconf --install
11-
- ./configure
7+
install:
8+
- mkdir build
9+
- cd build
10+
- cmake ..
1211
- make
13-
- make check
12+
script:
13+
- ctest

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
cmake_minimum_required(VERSION 2.8)
2+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
3+
project(libmo_unpack)
4+
enable_testing()
5+
add_subdirectory(src)
6+
add_subdirectory(tests)

CMakeModules/FindCheck.cmake

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
IF (CHECK_INCLUDE_DIR)
3+
# Already in cache, be silent
4+
SET(CHECK_FIND_QUIETLY TRUE)
5+
ENDIF (CHECK_INCLUDE_DIR)
6+
7+
FIND_PATH(CHECK_INCLUDE_DIR NAMES check.h)
8+
9+
# Look for the library.
10+
FIND_LIBRARY(CHECK_LIBRARY NAMES check)
11+
12+
IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
13+
# handle the QUIETLY and REQUIRED arguments and set CHECK_FOUND to TRUE if
14+
# all listed variables are TRUE
15+
INCLUDE(FindPackageHandleStandardArgs)
16+
17+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Check "Please install 'check' and 'check-devel' packages" CHECK_LIBRARY CHECK_INCLUDE_DIR)
18+
ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
19+
20+
IF(CHECK_FOUND)
21+
SET( CHECK_LIBRARIES ${CHECK_LIBRARY} )
22+
ELSE(CHECK_FOUND)
23+
SET( CHECK_LIBRARIES )
24+
ENDIF(CHECK_FOUND)
25+
26+
MARK_AS_ADVANCED(CHECK_INCLUDE_DIR)
27+
MARK_AS_ADVANCED(CHECK_LIBRARY)

Makefile.am

Lines changed: 0 additions & 2 deletions
This file was deleted.

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22

33
The first time you build from a clone of this repo you will need to execute:
44
```
5-
$ autoreconf --install
5+
$ mkdir build
6+
$ cd build
7+
$ cmake ..
68
```
79

8-
The build process itself is then the usual:
10+
The build process itself on Linux is then the usual:
911
```
10-
$ ./configure
1112
$ make
1213
$ make install
1314
```
15+
16+
To run the tests:
17+
```
18+
$ make test
19+
```

configure.ac

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
include_directories(.)
2+
3+
add_library(mo_unpack SHARED convert_float_ibm_to_ieee32.c convert_float_ieee32_to_ibm.c extract_bitmaps.c extract_nbit_words.c extract_wgdos_row.c logerrors.c pack_ppfield.c read_wgdos_bitmaps.ibm.c rlencode.c uascii.c unpack_ppfield.c wgdos_decode_field_parameters.c wgdos_decode_row_parameters.c wgdos_expand_row_to_data.c wgdos_pack.c wgdos_unpack.c)
4+
5+
set_target_properties(mo_unpack PROPERTIES SOVERSION 3)
6+
7+
install(TARGETS mo_unpack DESTINATION lib)
8+
install(FILES src/wgdosstuff.h DESTINATION include)
9+

src/Makefile.am

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
enable_testing()
2+
find_package(Check REQUIRED)
3+
include_directories(${CHECK_INCLUDE_DIRS})
4+
set(LIBS ${LIBS} ${CHECK_LIBRARIES} mo_unpack m rt pthread)
5+
include_directories(. ../src)
6+
add_executable(test_rle check_rle.c)
7+
target_link_libraries(test_rle ${LIBS})
8+
add_test(test_rle ${CMAKE_CURRENT_BINARY_DIR}/test_rle)

tests/Makefile.am

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)