ENH: fix cmake so it can boot strap itself better
This commit is contained in:
parent
7715b382fe
commit
adbae91cb5
|
@ -9,25 +9,34 @@ ENDIF(FLTK_LIBRARY)
|
||||||
|
|
||||||
SOURCE_FILES(SRCS
|
SOURCE_FILES(SRCS
|
||||||
cmake
|
cmake
|
||||||
cmMakeDepend
|
cmMakeDepend.cxx
|
||||||
cmMakefile
|
cmMakefile.cxx
|
||||||
cmMakefileGenerator
|
cmMakefileGenerator.cxx
|
||||||
cmRegularExpression
|
cmRegularExpression.cxx
|
||||||
cmSourceFile
|
cmSourceFile.cxx
|
||||||
cmSystemTools
|
cmSystemTools.cxx
|
||||||
cmDirectory
|
cmDirectory.cxx
|
||||||
cmCommands
|
cmCommands.cxx
|
||||||
cmTarget
|
cmTarget.cxx
|
||||||
cmCustomCommand
|
cmCustomCommand.cxx
|
||||||
cmCacheManager
|
cmCacheManager.cxx
|
||||||
cmCableClassSet
|
cmCableClassSet.cxx
|
||||||
cmSourceGroup
|
cmSourceGroup.cxx
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# configure the .h file
|
||||||
|
CONFIGURE_FILE(
|
||||||
|
${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in
|
||||||
|
${CMake_BINARY_DIR}/Source/cmConfigure.cmake.h )
|
||||||
|
# add the include path to find the .h
|
||||||
|
INCLUDE_DIRECTORIES(${CMake_BINARY_DIR}/Source)
|
||||||
|
# let cmake know it is supposed to use it
|
||||||
|
ADD_DEFINITIONS(-DCMAKE_BUILD_WITH_CMAKE)
|
||||||
|
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
SOURCE_FILES(SRCS cmDSWWriter cmDSPWriter cmMSProjectGenerator)
|
SOURCE_FILES(SRCS cmDSWWriter.cxx cmDSPWriter.cxx cmMSProjectGenerator.cxx)
|
||||||
ELSE (WIN32)
|
ELSE (WIN32)
|
||||||
SOURCE_FILES(SRCS cmUnixMakefileGenerator)
|
SOURCE_FILES(SRCS cmUnixMakefileGenerator.cxx)
|
||||||
ENDIF (WIN32)
|
ENDIF (WIN32)
|
||||||
|
|
||||||
# create a library used by the command line and the GUI
|
# create a library used by the command line and the GUI
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
SOURCE_FILES(SRCS
|
SOURCE_FILES(SRCS
|
||||||
CMakeSetupGUI
|
CMakeSetupGUI.cxx
|
||||||
CMakeSetupGUIImplementation
|
CMakeSetupGUIImplementation.cxx
|
||||||
FLTKDialog
|
FLTKDialog.cxx
|
||||||
FLTKPropertyItemRow
|
FLTKPropertyItemRow.cxx
|
||||||
FLTKPropertyList
|
FLTKPropertyList.cxx
|
||||||
FLTKPropertyNameButtonWithHelp
|
FLTKPropertyNameButtonWithHelp.cxx
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ CMakeSetupGUIImplementation
|
||||||
m_PathToExecutable = absolutePath;
|
m_PathToExecutable = absolutePath;
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
m_PathToExecutable += "/CMake.exe";
|
m_PathToExecutable += "/Debug/CMake.exe";
|
||||||
#else
|
#else
|
||||||
m_PathToExecutable += "/cmake";
|
m_PathToExecutable += "/cmake";
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
#cmakedefine CMAKE_NO_STD_NAMESPACE
|
||||||
|
#cmakedefine CMAKE_NO_ANSI_STREAM_HEADERS
|
||||||
|
#define CMAKE_ROOT_DIR "${CMake_SOURCE_DIR}"
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,13 @@ void cmSourceFile::SetName(const char* name, const char* dir)
|
||||||
std::string hname = pathname;
|
std::string hname = pathname;
|
||||||
if(cmSystemTools::FileExists(hname.c_str()))
|
if(cmSystemTools::FileExists(hname.c_str()))
|
||||||
{
|
{
|
||||||
|
std::string::size_type pos = hname.rfind('.');
|
||||||
|
if(pos != std::string::npos)
|
||||||
|
{
|
||||||
|
m_SourceExtension = hname.substr(pos+1, hname.size()-pos);
|
||||||
|
m_SourceName = hname.substr(0, pos);
|
||||||
|
}
|
||||||
|
|
||||||
m_HeaderFileOnly = false;
|
m_HeaderFileOnly = false;
|
||||||
m_FullPath = hname;
|
m_FullPath = hname;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -50,6 +50,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifdef CMAKE_HAS_AUTOCONF
|
#ifdef CMAKE_HAS_AUTOCONF
|
||||||
#include "cmConfigure.h"
|
#include "cmConfigure.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CMAKE_BUILD_WITH_CMAKE
|
||||||
|
#include "cmConfigure.cmake.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning ( disable : 4786 )
|
#pragma warning ( disable : 4786 )
|
||||||
|
|
|
@ -164,7 +164,7 @@ void cmake::AddCMakePaths(const std::vector<std::string>& args)
|
||||||
modules = cMakeRoot + "/share/CMake/Modules";
|
modules = cMakeRoot + "/share/CMake/Modules";
|
||||||
if (!cmSystemTools::FileIsDirectory(modules.c_str()))
|
if (!cmSystemTools::FileIsDirectory(modules.c_str()))
|
||||||
{
|
{
|
||||||
#if !defined(_WIN32) || defined(__CYGWIN__)
|
#ifdef CMAKE_ROOT_DIR
|
||||||
// try compiled in value on UNIX
|
// try compiled in value on UNIX
|
||||||
cMakeRoot = CMAKE_ROOT_DIR;
|
cMakeRoot = CMAKE_ROOT_DIR;
|
||||||
modules = cMakeRoot + "/Modules";
|
modules = cMakeRoot + "/Modules";
|
||||||
|
|
|
@ -46,4 +46,5 @@ SET (CMAKE_SHLIB_RUNTIME_SEP "@CMAKE_SHLIB_RUNTIME_SEP@" CACHE STRING
|
||||||
SET (CMAKE_X_LIBS "@X_PRE_LIBS@ @X_LIBS@ -lX11 -lXext @X_EXTRA_LIBS@" CACHE STRING "Libraries and options used in X11 programs")
|
SET (CMAKE_X_LIBS "@X_PRE_LIBS@ @X_LIBS@ -lX11 -lXext @X_EXTRA_LIBS@" CACHE STRING "Libraries and options used in X11 programs")
|
||||||
SET (CMAKE_X_CFLAGS "@X_CFLAGS@" CACHE STRING "X11 extra flags")
|
SET (CMAKE_X_CFLAGS "@X_CFLAGS@" CACHE STRING "X11 extra flags")
|
||||||
SET (CMAKE_HAS_X "@CMAKE_HAS_X@" )
|
SET (CMAKE_HAS_X "@CMAKE_HAS_X@" )
|
||||||
|
SET (CMAKE_NO_ANSI_STREAM_HEADERS "@CMAKE_NO_ANSI_STREAM_HEADERS@" )
|
||||||
|
SET (CMAKE_NO_STD_NAMESPACE "@CMAKE_NO_STD_NAMESPACE@" )
|
||||||
|
|
|
@ -2944,19 +2944,17 @@ echo "configure:2939: checking ansi standard C++ stream headers " >&5
|
||||||
if test -z "`${CXX} -c conftest.cc 2>&1`"; then
|
if test -z "`${CXX} -c conftest.cc 2>&1`"; then
|
||||||
echo "$ac_t""yes" 1>&6
|
echo "$ac_t""yes" 1>&6
|
||||||
else
|
else
|
||||||
cat >> confdefs.h <<\EOF
|
CMAKE_NO_STD_NAMESPACE="1"
|
||||||
#define CMAKE_NO_STD_NAMESPACE 1
|
|
||||||
EOF
|
|
||||||
|
|
||||||
echo "$ac_t""no" 1>&6
|
echo "$ac_t""no" 1>&6
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# check to see if stl is in the std namespace
|
# check to see if stl is in the std namespace
|
||||||
if test $ac_cv_prog_gxx = no; then
|
if test $ac_cv_prog_gxx = no; then
|
||||||
echo "******"
|
echo "******"
|
||||||
echo $ac_n "checking ansi standard namespace support ""... $ac_c" 1>&6
|
echo $ac_n "checking ansi standard namespace support ""... $ac_c" 1>&6
|
||||||
echo "configure:2960: checking ansi standard namespace support " >&5
|
echo "configure:2958: checking ansi standard namespace support " >&5
|
||||||
rm -rf conftest.*
|
rm -rf conftest.*
|
||||||
cat > conftest.cc <<!
|
cat > conftest.cc <<!
|
||||||
#include <list>
|
#include <list>
|
||||||
|
@ -2965,15 +2963,13 @@ void foo() { std::list<int> l; }
|
||||||
if test -z "`${CXX} -c conftest.cc 2>&1`"; then
|
if test -z "`${CXX} -c conftest.cc 2>&1`"; then
|
||||||
echo "$ac_t""yes" 1>&6
|
echo "$ac_t""yes" 1>&6
|
||||||
else
|
else
|
||||||
cat >> confdefs.h <<\EOF
|
CMAKE_NO_ANSI_STREAM_HEADERS="1"
|
||||||
#define CMAKE_NO_ANSI_STREAM_HEADERS 1
|
|
||||||
EOF
|
|
||||||
|
|
||||||
echo "$ac_t""no" 1>&6
|
echo "$ac_t""no" 1>&6
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
|
if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
|
||||||
SHLIB_CFLAGS="-fPIC"
|
SHLIB_CFLAGS="-fPIC"
|
||||||
fi
|
fi
|
||||||
|
@ -2984,7 +2980,7 @@ do
|
||||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||||
set dummy $ac_prog; ac_word=$2
|
set dummy $ac_prog; ac_word=$2
|
||||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||||
echo "configure:2988: checking for $ac_word" >&5
|
echo "configure:2984: checking for $ac_word" >&5
|
||||||
if eval "test \"`echo '$''{'ac_cv_path_RUNMAKE'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'ac_cv_path_RUNMAKE'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
|
@ -3024,7 +3020,7 @@ do
|
||||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||||
set dummy $ac_prog; ac_word=$2
|
set dummy $ac_prog; ac_word=$2
|
||||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||||
echo "configure:3028: checking for $ac_word" >&5
|
echo "configure:3024: checking for $ac_word" >&5
|
||||||
if eval "test \"`echo '$''{'ac_cv_path_CMAKE_AR'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'ac_cv_path_CMAKE_AR'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
|
@ -3241,6 +3237,8 @@ s%@CMAKE_HP_PTHREADS@%$CMAKE_HP_PTHREADS%g
|
||||||
s%@CMAKE_THREAD_LIBS@%$CMAKE_THREAD_LIBS%g
|
s%@CMAKE_THREAD_LIBS@%$CMAKE_THREAD_LIBS%g
|
||||||
s%@CMAKE_ANSI_CFLAGS@%$CMAKE_ANSI_CFLAGS%g
|
s%@CMAKE_ANSI_CFLAGS@%$CMAKE_ANSI_CFLAGS%g
|
||||||
s%@CMAKE_TEMPLATE_FLAGS@%$CMAKE_TEMPLATE_FLAGS%g
|
s%@CMAKE_TEMPLATE_FLAGS@%$CMAKE_TEMPLATE_FLAGS%g
|
||||||
|
s%@CMAKE_NO_STD_NAMESPACE@%$CMAKE_NO_STD_NAMESPACE%g
|
||||||
|
s%@CMAKE_NO_ANSI_STREAM_HEADERS@%$CMAKE_NO_ANSI_STREAM_HEADERS%g
|
||||||
s%@RUNMAKE@%$RUNMAKE%g
|
s%@RUNMAKE@%$RUNMAKE%g
|
||||||
s%@CMAKE_AR@%$CMAKE_AR%g
|
s%@CMAKE_AR@%$CMAKE_AR%g
|
||||||
|
|
||||||
|
|
|
@ -520,10 +520,11 @@ if test $ac_cv_prog_gxx = no; then
|
||||||
if test -z "`${CXX} -c conftest.cc 2>&1`"; then
|
if test -z "`${CXX} -c conftest.cc 2>&1`"; then
|
||||||
echo "$ac_t""yes" 1>&6
|
echo "$ac_t""yes" 1>&6
|
||||||
else
|
else
|
||||||
AC_DEFINE(CMAKE_NO_STD_NAMESPACE)
|
CMAKE_NO_STD_NAMESPACE="1"
|
||||||
echo "$ac_t""no" 1>&6
|
echo "$ac_t""no" 1>&6
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
AC_SUBST(CMAKE_NO_STD_NAMESPACE)
|
||||||
|
|
||||||
# check to see if stl is in the std namespace
|
# check to see if stl is in the std namespace
|
||||||
if test $ac_cv_prog_gxx = no; then
|
if test $ac_cv_prog_gxx = no; then
|
||||||
|
@ -537,10 +538,11 @@ void foo() { std::list<int> l; }
|
||||||
if test -z "`${CXX} -c conftest.cc 2>&1`"; then
|
if test -z "`${CXX} -c conftest.cc 2>&1`"; then
|
||||||
echo "$ac_t""yes" 1>&6
|
echo "$ac_t""yes" 1>&6
|
||||||
else
|
else
|
||||||
AC_DEFINE(CMAKE_NO_ANSI_STREAM_HEADERS)
|
CMAKE_NO_ANSI_STREAM_HEADERS="1"
|
||||||
echo "$ac_t""no" 1>&6
|
echo "$ac_t""no" 1>&6
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
AC_SUBST(CMAKE_NO_ANSI_STREAM_HEADERS)
|
||||||
|
|
||||||
|
|
||||||
if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
|
if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
|
||||||
|
|
Loading…
Reference in New Issue