Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jamshed committed Jul 1, 2021
2 parents 4eeb3a2 + 8fa1171 commit c01b84d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ To install Cuttlefish from the source, you may use the following:
```bash
git clone https://github.com/COMBINE-lab/cuttlefish.git
cd cuttlefish && mkdir build && cd build
cmake ..
cmake -DCMAKE_INSTALL_PREFIX=../ ..
make -j 8 install
cd ..
```

You may replace `8` in `make -j 8 install` with the preferred count for threads to use in the installation process.
You may replace `8` in `make -j 8` with the preferred count for threads to use in the installation process.

This compilation process installs Cuttlefish in a default sub-directory named `bin`, inside the project root directory. To specify a different installation directory, its path may be passed as the value of `-DCMAKE_INSTALL_PREFIX` with the `cmake` command, i.e. you may use `cmake -DCMAKE_INSTALL_PREFIX=custome-path/ ..` .
This compilation process installs Cuttlefish in a sub-directory named `bin`, inside the project root directory. To specify a different installation directory, its path may be passed as the value of `-DCMAKE_INSTALL_PREFIX` with the `cmake` command, i.e. you may use `cmake -DCMAKE_INSTALL_PREFIX=custom_path/ ..` . Then the installed Cuttlefish executable will be found in `custom_path/bin/`. Skipping `-DCMAKE_INSTALL_PREFIX` entirely will install Cuttlefish in `/usr/local/bin`, for which `sudo` access might be required (i.e. `sudo make -j 8 install`).

## Usage

Expand Down
18 changes: 4 additions & 14 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,11 @@ target_link_libraries(${PROJECT_NAME} PRIVATE core)
target_compile_options(${PROJECT_NAME} PRIVATE ${WARNING_FLAGS} ${SUPPRESS_WARNING_FLAGS} ${OPTIMIZE_FLAGS})


# Set the parent directory for the target binaries inside the "installation directory". The
# installation directory is set to `/usr/local` by default. If it's set there, i.e. the user
# have not passed any other value for such, then the parent installation directory is set to
# a default (`bin`) directory at the top level of the source tree. To specify a different parent
# installation directory, pass its path as the value of the `-DCMAKE_INSTALL_PREFIX` with the
# `cmake` command.

set(DEFAULT_INSTALL_DIR ${CMAKE_SOURCE_DIR}/bin) # Set our default installation directory as a `bin` directory inside the top level of the source tree.
set(INSTALL_DIR .) # Set the installation directory to what CMake has recieved, i.e. either the system default or the user-provided one.
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) # If it's set to the system default, then set it to our defined default directory.
set(INSTALL_DIR ${DEFAULT_INSTALL_DIR})
endif()

# Set the installation directory. The parent directory is `/usr/local/` by default, and the
# user may set it to a different path by passing a value for `CMAKE_INSTALL_PREFIX`. The target
# executable is installed inside a sub-directory named `bin` within the parent directory.
install(TARGETS ${PROJECT_NAME}
DESTINATION ${INSTALL_DIR}
DESTINATION bin
)


Expand Down

0 comments on commit c01b84d

Please sign in to comment.