Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ cmake_minimum_required(VERSION 3.4.0)

project(mathx CXX)

# Force out-of-tree builds
if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
message(SEND_ERROR "In-source builds are not allowed.")
endif("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")

# Include header files
include_directories(mathx)

Expand Down
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ We require the following packages before you try installing the package.

- A c++ compiler (g++/clang++/msvc++)
- Cmake (upwards of version 3.4)
- pkg-config (optional)

### Instructions

Expand All @@ -21,15 +22,16 @@ We require the following packages before you try installing the package.
```

- Use the cmake command with CMAKE_INSTALL_PREFIX to select the directory to install to (not using this command will defaul to install directories)
We do not support in tree builds.

```
$ cmake -DCMAKE_INSTALL_PREFIX=/path/to/install
$ cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install
```

For example, one can type:

```
$ cmake -DCMAKE_INSTALL_PREFIX=/home/user/mathx_build/
$ cmake -DCMAKE_INSTALL_PREFIX=/home/user/opt/build
```

- If cmake runs successfully, you should now be able to see a `Makefile` in the build directory. We currently support `clean` and `all` only. We will add more targets with future upgrades to cmake. Run:
Expand All @@ -44,18 +46,19 @@ We require the following packages before you try installing the package.
$ make install
```

- To build mathx based applications using terminal/makefile, we highly recommend using pkg-config. To use pkg-config, you will have
to `export` pkg-config path. Run:

```
$ export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/path/to/install/lib/pkgconfig
```

__NOTE__: If you fail to provide the CMAKE_INSTALL_PREFIX, install location will be set to default (For example: /usr/local/ in case of Linux users.)

## Usage Instructions

Currently we do not support pkg-config so users will have to manually add the `includes` and `lib` using their respective flags.
The user can simply build applications using pkg-config. A simple example is given as:

Manually building:

```
(CXX_COMPILER) -o exec_name (CXX_FILES) -I/path/to/include -L/path/to/lib
```

__NOTE__: You dont need to provide the last two flags if library is installed in the default location.

We are updating our CMakelists to provide more functionality to the users.
(CXX_COMPILER) -o exec_name (CXX_FILES) `pkg-config --cflags --libs mathx`
```