The easiest way to install KScope is by using a ready-made package provided by your operating system. Several Linux- and *BSD-based operating systems provide such packages, including:
Please refer to the manual of the system's package manager for instructions on how to install the package.
Building KScope from source is fairly easy. Just follow these steps:
- Make sure you have the required development tools and libraries,
- Download the source code
- Build KScope
- Adjust envrionment variables
The source code is available from KScope's SourceForge page. Download the latest released tarball, called kscope-VER.tar.gz, where VER is KScope's version. Extract the code with
$ tar zxvf kscope-VER.tar.gz
This will create a directory named kscope-VER.
KScope does not come with the standard configure script. Instead, a file called config is located at the top level of KScope's source directory. Open the file with any text editor, and modify any variables as necessary for your environment. The two important values are
- INSTALL_PATH Where KScope will be installed
- QSCI_PATH Where QScintilla is currently installed
Note that each of these paths points to a top-level directory, under which sub-directories called bin, lib and (for Qscintilla) include are expected to be found. Thus, if INSTALL_PATH is set to /usr/local (the default), the KScope executable will be installed in /usr/local/bin and KScope's shared libraries will be installed in /usr/local/lib.
In Kscope's top-level source directory, execute the following commands:
$ qmake $ make
This step is optional, as KScope can run from the build directory (as long as the library paths are set correctly - see below). To install KScope in INSTALL_PATH, execute
$ make install
in KScope's top-level source directory. Make sure you have the right permissions to copy files into INSTALL_PATH/bin and INSTALL_PATH/lib. You may need to run make install as root.
The KScope application consists of an executable named kscopeapp and several shared libraries. The dynamic linker needs to be told where these libraries reside. If you installed KScope into a standard directory (such as /usr) this may not be an issue. Otherwise, make sure you add INSTALL_PATH/lib to the linker's library path. On most Unix-like systems, this is by settings an environment variable:
(replace /usr/local with whatever value you set in INSTALL_PATH). Make sure the variable is exported. If you want to run KScope from the source directory, execute the following command under the top-level directory (kscope-VER):
$ LD_LIBRARY_PATH=./core:./cscope:./editor ./app/kscopeapp