mirror of
https://github.com/reactos/CMake.git
synced 2025-02-01 01:22:58 +00:00
Eclipse: Add option to set the resource encoding
This commit is contained in:
parent
5f2f16319a
commit
09c1991895
@ -915,6 +915,7 @@ syn keyword cmakeVariable contained
|
||||
\ CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES
|
||||
\ CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT
|
||||
\ CMAKE_ECLIPSE_MAKE_ARGUMENTS
|
||||
\ CMAKE_ECLIPSE_RESOURCE_ENCODING
|
||||
\ CMAKE_ECLIPSE_VERSION
|
||||
\ CMAKE_EDIT_COMMAND
|
||||
\ CMAKE_ENABLE_EXPORTS
|
||||
|
@ -157,6 +157,7 @@ Variables that Change Behavior
|
||||
/variable/CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES
|
||||
/variable/CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT
|
||||
/variable/CMAKE_ECLIPSE_MAKE_ARGUMENTS
|
||||
/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING
|
||||
/variable/CMAKE_ECLIPSE_VERSION
|
||||
/variable/CMAKE_ERROR_DEPRECATED
|
||||
/variable/CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
|
||||
|
6
Help/release/dev/eclipse-resource-encoding.rst
Normal file
6
Help/release/dev/eclipse-resource-encoding.rst
Normal file
@ -0,0 +1,6 @@
|
||||
eclipse-resource-encoding
|
||||
-------------------------
|
||||
|
||||
* The :generator:`Eclipse CDT4` extra generator gained a new
|
||||
:variable:`CMAKE_ECLIPSE_RESOURCE_ENCODING` option to specify
|
||||
the resource encoding.
|
6
Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst
Normal file
6
Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst
Normal file
@ -0,0 +1,6 @@
|
||||
CMAKE_ECLIPSE_RESOURCE_ENCODING
|
||||
-------------------------------
|
||||
|
||||
This cache variable tells the :generator:`Eclipse CDT4` project generator
|
||||
to set the resource encoding to the given value in generated project files.
|
||||
If no value is given, no encoding will be set.
|
@ -164,6 +164,29 @@ void cmExtraEclipseCDT4Generator::Generate()
|
||||
|
||||
// create a .cproject file
|
||||
this->CreateCProjectFile();
|
||||
|
||||
// create resource settings
|
||||
this->CreateSettingsResourcePrefsFile();
|
||||
}
|
||||
|
||||
void cmExtraEclipseCDT4Generator::CreateSettingsResourcePrefsFile()
|
||||
{
|
||||
cmLocalGenerator* lg = this->GlobalGenerator->GetLocalGenerators()[0];
|
||||
cmMakefile* mf = lg->GetMakefile();
|
||||
|
||||
const std::string filename =
|
||||
this->HomeOutputDirectory + "/.settings/org.eclipse.core.resources.prefs";
|
||||
|
||||
cmGeneratedFileStream fout(filename);
|
||||
if (!fout) {
|
||||
return;
|
||||
}
|
||||
|
||||
fout << "eclipse.preferences.version=1" << std::endl;
|
||||
const char* encoding = mf->GetDefinition("CMAKE_ECLIPSE_RESOURCE_ENCODING");
|
||||
if (encoding) {
|
||||
fout << "encoding/<project>=" << encoding << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void cmExtraEclipseCDT4Generator::CreateSourceProjectFile()
|
||||
|
@ -43,6 +43,9 @@ private:
|
||||
// create .project file in the source tree
|
||||
void CreateSourceProjectFile();
|
||||
|
||||
// create .settings/org.eclipse.core.resources.prefs
|
||||
void CreateSettingsResourcePrefsFile();
|
||||
|
||||
// create .project file
|
||||
void CreateProjectFile();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user