summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-01-23 14:35:38 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-01-23 14:35:43 (GMT)
commitce863c17d08e6631c4a194fc3f9fb3f63ea65d11 (patch)
tree4a1a209d589300f2647bdf14c2c001d42cd0bfbd
parent2c6f5baaa7e101cdd3e5769a3fd8d49d0501b8e6 (diff)
parent51caac6958c9adb31dae4c2a61bd0bfce9e45a23 (diff)
downloadCMake-ce863c17d08e6631c4a194fc3f9fb3f63ea65d11.zip
CMake-ce863c17d08e6631c4a194fc3f9fb3f63ea65d11.tar.gz
CMake-ce863c17d08e6631c4a194fc3f9fb3f63ea65d11.tar.bz2
Merge topic 'feature-codelite-fortran'
51caac69 CodeLite: Better support for Fortran and Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1678
-rw-r--r--Source/cmExtraCodeLiteGenerator.cxx31
1 files changed, 16 insertions, 15 deletions
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 4958007..fad0723 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -198,8 +198,6 @@ std::string cmExtraCodeLiteGenerator::CollectSourceFiles(
std::map<std::string, cmSourceFile*>& cFiles,
std::set<std::string>& otherFiles)
{
- auto cm = this->GlobalGenerator->GetCMakeInstance();
-
std::string projectType;
switch (gt->GetType()) {
case cmStateEnums::EXECUTABLE: {
@@ -227,19 +225,18 @@ std::string cmExtraCodeLiteGenerator::CollectSourceFiles(
gt->GetSourceFiles(sources,
makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
for (cmSourceFile* s : sources) {
- // check whether it is a C/C++/CUDA implementation file
- bool isCFile = false;
- std::string lang = s->GetLanguage();
- if (lang == "C" || lang == "CXX" || lang == "CUDA") {
- std::string const& srcext = s->GetExtension();
- isCFile = cm->IsSourceExtension(srcext);
- }
-
+ // check whether it is a source or a include file
// then put it accordingly into one of the two containers
- if (isCFile) {
- cFiles[s->GetFullPath()] = s;
- } else {
- otherFiles.insert(s->GetFullPath());
+ switch (cmSystemTools::GetFileFormat(s->GetExtension().c_str())) {
+ case cmSystemTools::C_FILE_FORMAT:
+ case cmSystemTools::CXX_FILE_FORMAT:
+ case cmSystemTools::CUDA_FILE_FORMAT:
+ case cmSystemTools::FORTRAN_FILE_FORMAT: {
+ cFiles[s->GetFullPath()] = s;
+ } break;
+ default: {
+ otherFiles.insert(s->GetFullPath());
+ }
}
}
}
@@ -679,7 +676,11 @@ std::string cmExtraCodeLiteGenerator::GetSingleFileBuildCommand(
std::string generator = mf->GetSafeDefinition("CMAKE_GENERATOR");
if (generator == "Unix Makefiles" || generator == "MinGW Makefiles") {
std::ostringstream ss;
- ss << make << " -f$(ProjectPath)/Makefile $(CurrentFileName).cpp.o";
+#if defined(_WIN32)
+ ss << make << " -f$(ProjectPath)/Makefile -B $(CurrentFileFullName).obj";
+#else
+ ss << make << " -f$(ProjectPath)/Makefile -B $(CurrentFileFullName).o";
+#endif
buildCommand = ss.str();
}
return buildCommand;