Skip to content

Richard-W/cmake-configure-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMake configure wrapper

This shellscript provides CMake-projects with a configure-script similar to the one autoconf provides. It supports all options from the GNU Coding Guidelines and even takes generic arguments.

Usage

The basic functionality should work out of the box. Just adding the configure-script to you project enables simple functionality like the --prefix argument and --enable-debug. You will notice that CMake complains about a lot of unused variables. The function of these variables can be looked up here.

Enable and Disable features/packages

The script takes arguments of the form --enable-* and --disable-*. Passing an argument like --enable-foo-bar sets FEATURE_FOO_BAR=ON. --disable-foo-bar would set the same variable to "OFF".

The same applies to the arguments --with-* and --without-*. --with-foo-bar sets PACKAGE_FOO_BAR=ON. --without-foo-bar sets it to "OFF".

Integrating with CMake

All directory arguments (except --prefix) are not supported natively by CMake. The script sets variables like INSTALL_LIBDIR for --libdir for example, but you have to explicitly use them. You will need to specify

install (TARGETS some_shared_lib LIBRARY DESTINATION ${INSTALL_LIBDIR})

for libdir to have an effect.

This leads to a serious problem: The standard CMake Parameters are ignored and calls like cmake -DCMAKE_INSTALL_PREFIX=/usr will not work anymore.

This can be solved by moving the file ConfigureWrapper to your projects CMAKE_MODULE_PATH and issuing include (ConfigureWrapper) at the start of your projects CMakeLists.txt. If you build the project with configure nothing will change, but if you use cmake directly the variables the script sets normally will be set to their default location (relative to CMAKE_INSTALL_PREFIX).

License

This project is licensed under the BSD 2-Clause License.

About

A simple shell-script that imitates the behaviour of the autotools configure script.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published