Browse Source

CMake: Allow for changing the bin install dir

Also, use the standard CMake option name for the man dir.
coverity_scan
Daniel Scharrer 13 years ago
parent
commit
6574198994
  1. 22
      CMakeLists.txt
  2. 11
      README.md

22
CMakeLists.txt

@ -14,8 +14,22 @@ option(USE_STATIC_LIBS "Statically link libraries" OFF)
option(ZLIB_USE_STATIC_LIBS "Statically link libz" OFF)
option(BZip2_USE_STATIC_LIBS "Statically link libbz2" OFF)
set(MAN_DIR "share/man" CACHE STRING "Install path for man pages (relative to prefix).")
mark_as_advanced(MAN_DIR)
# Install destinations
if(NOT WIN32)
if(CMAKE_VERSION VERSION_LESS 2.8.5)
set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE
STRING "read-only architecture-independent data root (share) (relative to prefix).")
mark_as_advanced(CMAKE_INSTALL_DATAROOTDIR)
set(CMAKE_INSTALL_BINDIR "bin" CACHE
STRING "user executables (bin) (relative to prefix).")
mark_as_advanced(CMAKE_INSTALL_BINDIR)
set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man" CACHE
STRING "man documentation (DATAROOTDIR/man) (relative to prefix).")
mark_as_advanced(CMAKE_INSTALL_MANDIR)
else()
include(GNUInstallDirs)
endif()
endif()
# Helper scrips
@ -288,9 +302,9 @@ list(APPEND INNOEXTRACT_SOURCES "${VERSION_FILE}")
add_executable(innoextract ${INNOEXTRACT_SOURCES} ${ALL_INCLUDES})
target_link_libraries(innoextract ${LIBRARIES})
install(TARGETS innoextract RUNTIME DESTINATION bin)
install(TARGETS innoextract RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES doc/innoextract.1 DESTINATION ${MAN_DIR}/man1 OPTIONAL)
install(FILES doc/innoextract.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 OPTIONAL)
# Additional targets.

11
README.md

@ -44,12 +44,10 @@ Build options:
|:------------------------ |:------------:|:----------- |
| `USE_LZMA` | `ON` | Use `liblzma` if available.
| `CMAKE_BUILD_TYPE` | `Release` | Set to `Debug` to enable debug output.
| `CMAKE_INSTALL_PREFIX` | `/usr/local` | Where to install innoextract.
| `SET_WARNING_FLAGS` | `ON` | Adjust compiler warning flags. This should not affect the produced binaries but is useful to catch potential problems.
| `SET_OPTIMIZATION_FLAGS` | `ON` | Adjust compiler optimization flags. For non-debug builds the only thing this does is instruct the linker to only link against libraries that are actually needed.
| `USE_CXX11` | `ON` | Try to compile in C++11 mode if available.
| `DEBUG_EXTRA` | `OFF` | Expensive debug options.
| `MAN_DIR` | `share/man` | Install location for man pages (relative to prefix). |
| `USE_STATIC_LIBS` | `OFF` | Turns on static linking for all libraries, including `-static-libgcc` and `-static-libstdc++`. You can also use the individual options below:
| `LZMA_USE_STATIC_LIBS` | `OFF` | Statically link `liblzma`.
| `Boost_USE_STATIC_LIBS` | `OFF` | Statically link Boost. See also `FindBoost.cmake`
@ -57,6 +55,15 @@ Build options:
| `BZip2_USE_STATIC_LIBS` | `OFF` | Statically link `libbz2`. (used via Boost)
| `iconv_USE_STATIC_LIBS` | `OFF` | Statically link `libiconv`.
Install options:
| Option | Default | Description |
|:--------------------------- |:--------------------:|:----------- |
| `CMAKE_INSTALL_PREFIX` | `/usr/local` | Where to install innoextract.
| `CMAKE_INSTALL_BINDIR` | `bin` | Location for binaries (relative to prefix).
| `CMAKE_INSTALL_DATAROOTDIR` | `share/man` | Location for data files (relative to prefix).
| `CMAKE_INSTALL_MANDIR` | `${DATAROOTDIR}/man` | Location for man pages (relative to prefix).
Set options by passing `-D<option>=<value>` to cmake.
## Run

Loading…
Cancel
Save