From cc768c86c62aa5c6ea9dfe5c215bfe19dd991e3a Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 27 Sep 2001 14:58:14 -0400 Subject: ENH: pass prefix from configure into cmake --- Source/CMakeLists.txt | 5 +++++ Source/InitialConfigureFlags.cmake.in | 1 + configure | 4 ++-- configure.in | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 Source/InitialConfigureFlags.cmake.in diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 9f87e80..a3e2d59 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -1,4 +1,8 @@ INCLUDE (${CMAKE_ROOT}/Modules/FindFLTK.cmake) +INCLUDE (${CMAKE_BINARY_DIR}/Source/InitialConfigureFlags.cmake) +IF(CMAKE_CONFIGURE_INSTALL_PREFIX) + SET(CMAKE_INSTALL_PREFIX ${CMAKE_CONFIGURE_INSTALL_PREFIX} ) +ENDIF(CMAKE_CONFIGURE_INSTALL_PREFIX) IF(FLTK_LIBRARY) IF(FLTK_INCLUDE_PATH) @@ -84,6 +88,7 @@ IF(BUILD_TESTING) ENDIF(BUILD_TESTING) + INSTALL_TARGETS(/bin cmake) INSTALL_TARGETS(/bin ctest) diff --git a/Source/InitialConfigureFlags.cmake.in b/Source/InitialConfigureFlags.cmake.in new file mode 100644 index 0000000..6f800f4 --- /dev/null +++ b/Source/InitialConfigureFlags.cmake.in @@ -0,0 +1 @@ +SET (CMAKE_CONFIGURE_INSTALL_PREFIX @prefix@ CACHE PATH "Install path prefix, prepended onto install directories, For CMake this will always override CMAKE_INSTALL_PREFIX in the cache.") diff --git a/configure b/configure index 3d91d2a..2f99346 100755 --- a/configure +++ b/configure @@ -1182,7 +1182,7 @@ done ac_given_srcdir=$srcdir -trap 'rm -fr `echo "Makefile Source/Makefile Source/cmConfigure.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "Source/InitialConfigureFlags.cmake Makefile Source/Makefile Source/cmConfigure.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then diff --git a/configure.in b/configure.in index 027a341..bea1f96 100644 --- a/configure.in +++ b/configure.in @@ -146,7 +146,7 @@ fi # find make to use to build cmake, prefer gmake AC_PATH_PROGS(RUNMAKE, gmake make) -AC_OUTPUT(Makefile Source/Makefile) +AC_OUTPUT(Source/InitialConfigureFlags.cmake Makefile Source/Makefile) # build cmake $RUNMAKE # run cmake -- cgit v0.12