Skip to content

Commit

Permalink
Switch to cmake for build
Browse files Browse the repository at this point in the history
  • Loading branch information
glesica committed Aug 27, 2021
1 parent 92f2cb2 commit b35df9c
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 218 deletions.
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
.idea
.DS_Store
dist
build

## CMake

CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps

## C

Expand Down
62 changes: 62 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
cmake_minimum_required(VERSION 3.12)
project(
Mirage
VERSION 1.0.0
HOMEPAGE_URL https://github.com/TravisWheelerLab/Mirage
)

set(CMAKE_C_STANDARD 17)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY build)

add_executable(
MultiSeqNW

src/MultiSeqNW.c
)
target_link_libraries(MultiSeqNW m)
install(TARGETS MultiSeqNW RUNTIME)

add_executable(
ExonWeaver

src/ExonWeaver.c
src/BasicBio.c
)
target_link_libraries(ExonWeaver m)
install(TARGETS ExonWeaver RUNTIME)

add_executable(
FastMap2

src/FastMap2.c
src/BasicBio.c
)
target_link_libraries(FastMap2 m)
install(TARGETS FastMap2 RUNTIME)

# Custom target for handling dependencies, Perl scripts, and shell scripts. We
# just move all these files to the build directory to aid in distribution and
# installation. These will be automatically run by the build.

add_custom_target(
build-perl ALL
COMMAND cp
${CMAKE_SOURCE_DIR}/src/*.pl
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
COMMAND cp
${CMAKE_SOURCE_DIR}/src/*.pm
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
)

add_custom_target(
build-shell ALL
COMMAND cp
${CMAKE_SOURCE_DIR}/src/*.sh
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
)

add_custom_target(
build-dependencies ALL
COMMAND ./install-dependencies.sh
VERBATIM
)
65 changes: 0 additions & 65 deletions Makefile

This file was deleted.

26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ Multiple-sequence IsofoRm Alignment tool Guided by Exon boundaries.
## Dependencies

Mirage has no build dependencies beyond the C standard library, but it does have
several runtime dependencies. These are described below. Executables should
exist somewhere in the user's `PATH`.
several runtime dependencies. These are listed below. The build process will
include suitable versions of each in the build output, so there is no need to
install them manually.

**blat** - <http://www.kentinformatics.com/index.html>

Expand All @@ -16,20 +17,21 @@ exist somewhere in the user's `PATH`.

**tblastn** - <https://blast.ncbi.nlm.nih.gov/Blast.cgi>

Appropriate versions of these are included in the `dependencies` directory of
the repository. The `SETUP.pl` script will build and install them.

## Build

Building Mirage requires a modern C compiler. Use the `CC` environment variable
to control the compiler used. Set the `WORK_DIR` environment variable to control
where the binaries end up, the default is `dist`.
We use CMake to build Mirage. The following commands will place everything
needed to run Mirage in the `build/` directory.

Then, building is as simple as running `make`.
```
cmake .
make
```

## Installation

Once the build is complete, run `make install` to copy binaries. Use the
`PREFIX` environment variable to control the install location. The default
location is `/usr/local`.
The software can be "installed" simply by adding the `build/` directory to the
`PATH`. Optionally, it can be relocated first (for example, to `/opt/`).

## Usage

TODO
140 changes: 0 additions & 140 deletions SETUP.pl

This file was deleted.

Loading

0 comments on commit b35df9c

Please sign in to comment.