Updates will be applied - 12:30pm EDT (UTC -400). Site will be down for around 30

Commit 1cd9ce6f authored by Bill Hoffman's avatar Bill Hoffman

ENH: unify make process on unix

parent a5480276
......@@ -2,10 +2,24 @@
# CMakeLocal.make.in should be in the directory where you run configure
# in, which need not be the source directory
#
SET (CMAKE_WORDS_BIGENDIAN @CMAKE_WORDS_BIGENDIAN@)
SET (CMAKE_USE_SPROC @CMAKE_USE_SPROC@)
SET (CMAKE_USE_PTHREADS @CMAKE_USE_PTHREADS@)
SET (CMAKE_HP_PTHREADS @CMAKE_HP_PTHREADS@)
SET (CXX @CXX@)
SET (CMAKE_THREAD_LIBS @CMAKE_THREAD_LIBS@)
SET (CMAKE_DL_LIBS @CMAKE_DL_LIBS@)
SET (CMAKE_WORDS_BIGENDIAN @CMAKE_WORDS_BIGENDIAN@ )
SET (CMAKE_USE_SPROC @CMAKE_USE_SPROC@ CACHE BOOL)
SET (CMAKE_USE_PTHREADS @CMAKE_USE_PTHREADS@ CACHE BOOL)
SET (CMAKE_HP_PTHREADS @CMAKE_HP_PTHREADS@ CACHE BOOL)
SET (CMAKE_CXX @CXX@ CACHE FILEPATH)
SET (CMAKE_CC @CC@ CACHE FILEPATH)
SET (CMAKE_RANLIB @RANLIB@ CACHE STRING)
SET (CMAKE_AR @CMAKE_AR@ CACHE STRING)
SET (CMAKE_THREAD_LIBS @CMAKE_THREAD_LIBS@ CACHE STRING)
SET (CMAKE_DL_LIBS @CMAKE_DL_LIBS@ CACHE STRING)
SET (CMAKE_CXX_FLAGS "@CXXFLAGS@" CACHE STRING)
SET (CMAKE_CC_FLAGS "@CFLAGS@" CACHE STRING)
SET (CMAKE_SHLIB_CFLAGS @CMAKE_SHLIB_CFLAGS@ CACHE STRING)
SET (CMAKE_SHLIB_BUILD_FLAGS @CMAKE_SHLIB_BUILD_FLAGS@ CACHE STRING)
SET (CMAKE_SHLIB_LD_LIBS @CMAKE_SHLIB_LD_LIBS@ CACHE STRING)
SET (CMAKE_SHLIB_SUFFIX @CMAKE_SHLIB_SUFFIX@ CACHE STRING)
SET (CMAKE_CPP_FLAGS @CPPFLAGS@ CACHE STRING)
SET (CMAKE_TEMPLATE_FLAGS @CMAKE_TEMPLATE_FLAGS@ CACHE STRING)
SET (CMAKE_C_COMPILER @CC@ CACHE FILEPATH)
SET (CMAKE_SHLIB_LINK_FLAGS @CMAKE_SHLIB_LINK_FLAGS@ CACHE STRING)
SET (CMAKE_LIB_EXT @CMAKE_LIB_EXT@ CACHE STRING)
......@@ -353,7 +353,16 @@ void CMakeSetupDialog::OnBuildProjects()
makefile.MakeStartDirectoriesCurrent();
CString makefileIn = m_WhereSource;
makefileIn += "/CMakeLists.txt";
makefile.ReadListFile(makefileIn);
makefile.ReadListFile(makefileIn);
if(!cmCacheManager::GetInstance()->GetCacheValue("CMAKE_CXX"))
{
if(!makefile.GetDefinition("CMAKE_CXX"))
{
makefile.AddDefinition("CMAKE_CXX", "VC60");
}
cmCacheManager::GetInstance()->AddCacheEntry("CMAKE_CXX", "VC60",
"Compiler used", cmCacheManager::STRING);
}
// Generate the project files
makefile.GenerateMakefile();
// Save the cache
......
srcdir = @srcdir@
VPATH = @srcdir@
# DO NOT INCLUDE CMakeMaster.make here!
# This will cause an infinite loop as it will add the
# command for changing into this directory
CMAKE_CONFIG_DIR = @CMAKE_CONFIG_DIR@
CXX = @CXX@
CXXFLAGS = @CXXFLAGS@ -DCMAKE_HAS_AUTOCONF -I${CMAKE_CONFIG_DIR}/CMake/Source
.SUFFIXES: .cxx .java .class
.cxx.o:
${CXX} ${CXXFLAGS} -c $< -o $@
# let cmake know that this was done with autoconf
KIT_FLAGS = -DCMAKE_HAS_AUTOCONF -I${CMAKE_CONFIG_DIR}/CMake/Source
include @CMAKE_CONFIG_DIR@/CMake/CMakeVariables.make
include @CMAKE_CONFIG_DIR@/CMake/CMakeSimpleRules.make
OBJS = \
CMakeBuildTargets.o \
......
......@@ -55,7 +55,7 @@ bool cmBuildNameCommand::Invoke(std::vector<std::string>& args)
m_Makefile->AddDefinition("BUILDNAME", cacheValue);
return true;
}
std::string buildname = "WinNT-VC60";
std::string buildname = "WinNT";
if(m_Makefile->GetDefinition("UNIX"))
{
buildname = "";
......@@ -70,10 +70,9 @@ bool cmBuildNameCommand::Invoke(std::vector<std::string>& args)
buildname = reg.match(1) + "-" + reg.match(2);
}
}
}
std::string compiler = "-${CXX}";
std::string compiler = "-${CMAKE_CXX}";
m_Makefile->ExpandVariablesInString ( compiler );
buildname += compiler;
......
......@@ -53,7 +53,10 @@ bool cmBuildSharedLibrariesCommand::Invoke(std::vector<std::string>& args)
AddCacheEntry("BUILD_SHARED_LIBS",
false,
"If ON, the resulting project or makefiles will "
"produce shared libraries.");
"produce shared libraries. WARNING! On some "
"UNIX platforms, changing this setting will require"
" removing all .o files, as they will have to be recompiled "
" with -fpic or some other flag.");
m_Makefile->AddDefinition("BUILD_SHARED_LIBS", false);
}
else
......
......@@ -51,6 +51,7 @@ const char* cmCacheManagerTypes[] =
"FILEPATH",
"STRING",
"INTERNAL",
"STATIC",
0
};
......
......@@ -53,7 +53,7 @@ class cmMakefile;
class cmCacheManager
{
public:
enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL };
enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC };
struct CacheEntry
{
std::string m_Value;
......
......@@ -163,8 +163,6 @@ void cmDSPMakefile::WriteDSPFile(std::ostream& fout,
const char *libName,
cmTarget &target)
{
target.GenerateSourceFilesFromSourceLists(*m_Makefile);
// Write the DSP file's header.
this->WriteDSPHeader(fout, libName, target);
......
......@@ -163,8 +163,6 @@ void cmDSPMakefile::WriteDSPFile(std::ostream& fout,
const char *libName,
cmTarget &target)
{
target.GenerateSourceFilesFromSourceLists(*m_Makefile);
// Write the DSP file's header.
this->WriteDSPHeader(fout, libName, target);
......
......@@ -85,7 +85,6 @@ void cmMakeDepend::SetMakefile(cmMakefile* makefile)
for(cmTargets::iterator l = tgts.begin();
l != tgts.end(); l++)
{
l->second.GenerateSourceFilesFromSourceLists(*m_Makefile);
std::vector<cmSourceFile> &classes = l->second.GetSourceFiles();
for(std::vector<cmSourceFile>::iterator i = classes.begin();
i != classes.end(); ++i)
......
......@@ -359,6 +359,7 @@ void cmMakefile::GenerateMakefile()
for (cmTargets::iterator l = m_Targets.begin();
l != m_Targets.end(); l++)
{
l->second.GenerateSourceFilesFromSourceLists(*this);
l->second.MergeLibraries(m_LinkLibraries);
}
// now do the generation
......
......@@ -60,13 +60,13 @@ bool cmProjectCommand::Invoke(std::vector<std::string>& args)
cmCacheManager::GetInstance()->
AddCacheEntry(bindir.c_str(),
m_Makefile->GetCurrentOutputDirectory(),
"Value Computed by CMake", cmCacheManager::PATH);
"Value Computed by CMake", cmCacheManager::STATIC);
m_Makefile->AddDefinition(srcdir.c_str(),
m_Makefile->GetCurrentDirectory());
cmCacheManager::GetInstance()->
AddCacheEntry(srcdir.c_str(),
m_Makefile->GetCurrentDirectory(),
"Value Computed by CMake", cmCacheManager::PATH);
"Value Computed by CMake", cmCacheManager::STATIC);
return true;
}
......
......@@ -52,6 +52,20 @@ bool cmSetCommand::Invoke(std::vector<std::string>& args)
{
return true;
}
if(args[1] == "CACHE")
{
const char* type = "STRING"; // default type is string
if(args.size() > 2)
{
type = args[2].c_str();
}
m_Makefile->AddDefinition(args[0].c_str(), "");
cmCacheManager::GetInstance()->AddCacheEntry(args[0].c_str(),
"",
"Value Computed by CMake",
cmCacheManager::StringToType(type));
return true;
}
// expand value
m_Makefile->ExpandVariablesInString(args[1]);
......@@ -60,10 +74,15 @@ bool cmSetCommand::Invoke(std::vector<std::string>& args)
// should we store the result in the cache ?
if (args.size() > 2 && args[2] == "CACHE")
{
const char* type = "STRING"; // default type is string
if(args.size() > 3)
{
type = args[3].c_str();
}
cmCacheManager::GetInstance()->AddCacheEntry(args[0].c_str(),
args[1].c_str(),
"Value Computed by CMake",
cmCacheManager::STRING);
cmCacheManager::StringToType(type));
}
return true;
}
......
This diff is collapsed.
......@@ -86,7 +86,6 @@ private:
void GenerateCacheOnly();
void OutputMakefile(const char* file);
void OutputMakeFlags(std::ostream&);
void OutputVerbatim(std::ostream&);
void OutputTargetRules(std::ostream& fout);
void OutputLinkLibraries(std::ostream&, const char*, const cmTarget &);
void OutputTargets(std::ostream&);
......@@ -94,6 +93,19 @@ private:
void OutputDependInformation(std::ostream&);
void OutputDependencies(std::ostream&);
void OutputCustomRules(std::ostream&);
void OutputMakeVariables(std::ostream&);
void OutputMakeRules(std::ostream&);
void OutputSubDirectoryVars(std::ostream& fout,
const char* var,
const char* target,
const char* target1,
const char* target2,
const std::vector<std::string>& SubDirectories);
void OutputMakeRule(std::ostream&,
const char* comment,
const char* target,
const char* depends,
const char* command);
private:
bool m_CacheOnly;
bool m_Recurse;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment