Skip to content

Commit aded557

Browse files
authored
fixes to allow PG command line to be compiled in Visual Studio (#357)
1 parent a63241b commit aded557

5 files changed

Lines changed: 24 additions & 22 deletions

File tree

commandLine/commandLine.vcxproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@
5656
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
5757
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
5858
<WarningLevel>Level3</WarningLevel>
59-
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);src;src\addons;src\projects;src\utils;src\uuidxx</AdditionalIncludeDirectories>
59+
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);src;src\addons;src\projects;src\utils;src\uuidxx;src\uuidxx\src</AdditionalIncludeDirectories>
6060
<CompileAs>CompileAsCpp</CompileAs>
6161
<ObjectFileName>$(IntDir)/%(RelativeDir)/</ObjectFileName>
6262
<MultiProcessorCompilation>true</MultiProcessorCompilation>
63-
<AdditionalOptions></AdditionalOptions>
63+
<AdditionalOptions>/Zc:__cplusplus</AdditionalOptions>
6464
</ClCompile>
6565
<Link>
6666
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -77,10 +77,10 @@
7777
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
7878
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
7979
<WarningLevel>Level3</WarningLevel>
80-
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);src;src\addons;src\projects;src\utils;src\uuidxx</AdditionalIncludeDirectories>
80+
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);src;src\addons;src\projects;src\utils;src\uuidxx;src\uuidxx\src</AdditionalIncludeDirectories>
8181
<CompileAs>CompileAsCpp</CompileAs>
8282
<ObjectFileName>$(IntDir)/%(RelativeDir)/</ObjectFileName>
83-
<AdditionalOptions></AdditionalOptions>
83+
<AdditionalOptions>/Zc:__cplusplus</AdditionalOptions>
8484
</ClCompile>
8585
<Link>
8686
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
@@ -120,7 +120,7 @@
120120
<ClInclude Include="src\projects\xcodeProject.h" />
121121
<ClInclude Include="src\utils\LibraryBinary.h" />
122122
<ClInclude Include="src\utils\Utils.h" />
123-
<ClCompile Include="src\uuidxx\src\uuidxx.cpp" />
123+
<ClCompile Include="src\uuidxx\src\uuidxx.h" />
124124
</ItemGroup>
125125
<ItemGroup>
126126
<ProjectReference Include="$(OF_ROOT)\libs\openFrameworksCompiled\project\vs\openframeworksLib.vcxproj">

commandLine/commandLine.vcxproj.filters

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
<ClCompile Include="src\utils\Utils.cpp">
4141
<Filter>src\utils</Filter>
4242
</ClCompile>
43+
<ClCompile Include="src\uuidxx\src\uuidxx.cpp" />
44+
<ClCompile Include="src\uuidxx\src\uuidxx.h" />
4345
</ItemGroup>
4446
<ItemGroup>
4547
<Filter Include="src">

commandLine/src/projects/baseProject.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ bool isPlatformName(std::string file){
4343

4444
std::unique_ptr<baseProject::Template> baseProject::parseTemplate(const ofDirectory & templateDir){
4545
auto name = fs::path(templateDir.getOriginalDirectory()).parent_path().filename();
46-
if(templateDir.isDirectory() && !isPlatformName(name)){
46+
if(templateDir.isDirectory() && !isPlatformName(name.string())){
4747
ofBuffer templateconfig;
4848
ofFile templateconfigFile(ofFilePath::join(templateDir.path(), "template.config"));
4949
if(templateconfigFile.exists()){
5050
templateconfigFile >> templateconfig;
5151
auto supported = false;
5252
auto templateConfig = std::make_unique<Template>();
5353
templateConfig->dir = templateDir;
54-
templateConfig->name = name;
54+
templateConfig->name = name.string();
5555
for(auto line: templateconfig.getLines()){
5656
if(ofTrim(line).front() == '#') continue;
5757
auto varValue = ofSplitString(line,"+=",true,true);
@@ -121,9 +121,9 @@ bool baseProject::create(const fs::path & _path, std::string templateName){
121121
path = fs::current_path() / path;
122122
}
123123
projectDir = path;
124-
projectName = path.filename();
124+
projectName = path.filename().string();
125125
if (projectName == "") {
126-
projectName = path.parent_path().filename();
126+
projectName = path.parent_path().filename().string();
127127
}
128128
// cout << "path = " << path << endl;
129129
// cout << "projectName = " << projectName << endl;
@@ -226,8 +226,8 @@ bool baseProject::save(){
226226
if( str.rfind("# OF_ROOT =", 0) == 0 || str.rfind("OF_ROOT =", 0) == 0){
227227
auto path = getOFRoot().string();
228228

229-
if( projectDir.string().rfind(getOFRoot(),0) == 0 ){
230-
path = getOFRelPath(projectDir);
229+
if( projectDir.string().rfind(getOFRoot().string(), 0) == 0) {
230+
path = getOFRelPath(projectDir.string());
231231
}
232232

233233
saveConfig << "OF_ROOT = " << path << std::endl;
@@ -342,7 +342,7 @@ void baseProject::addSrcRecursively(std::string srcPath){
342342

343343
//if the files being added are inside the OF root folder, make them relative to the folder.
344344
bool bMakeRelative = false;
345-
if( srcPath.find_first_of(getOFRoot()) == 0 ){
345+
if( srcPath.find_first_of(getOFRoot().string()) == 0 ){
346346
bMakeRelative = true;
347347
}
348348

commandLine/src/projects/xcodeProject.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ bool xcodeProject::createProjectFile(){
142142

143143
//projectDir is always absolute at the moment
144144
//so lets check if the projectDir is inside the OF folder - if it is not make the OF path absolute
145-
if( projectDir.string().rfind(getOFRoot(),0) != 0 ){
146-
relRoot = getOFRoot();
145+
if( projectDir.string().rfind(getOFRoot().string(), 0) != 0) {
146+
relRoot = getOFRoot().string();
147147
}
148148
if (relRoot != "../../.."){
149149
findandreplaceInTexfile(projectDir / (projectName + ".xcodeproj/project.pbxproj"), "../../..", relRoot);

commandLine/src/utils/Utils.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void getFilesRecursively(const fs::path & path, std::vector < string > & fileNam
146146
getFilesRecursively(f, fileNames);
147147
} else {
148148
// FIXME - update someday to fs::path
149-
fileNames.emplace_back(f);
149+
fileNames.emplace_back(f.string());
150150
}
151151
}
152152
}
@@ -165,7 +165,7 @@ void getFilesRecursively(const fs::path & path, std::vector < fs::path > & fileN
165165
getFilesRecursively(f, fileNames);
166166
}
167167
} else {
168-
fileNames.emplace_back(f);
168+
fileNames.emplace_back(f.string());
169169
}
170170
}
171171
}
@@ -264,7 +264,7 @@ void getPropsRecursively(const fs::path & path, std::vector < std::string > & pr
264264
} else {
265265
if (f.extension() == ".props") {
266266
// cout << f << endl;
267-
props.emplace_back(f);
267+
props.emplace_back(f.string());
268268
}
269269
}
270270
}
@@ -283,7 +283,7 @@ void getDllsRecursively(const fs::path & path, std::vector < std::string > & dll
283283
if (f.extension() == ".dll") {
284284
cout << "---->> getDLLs " << f << endl;;
285285

286-
dlls.emplace_back(f);
286+
dlls.emplace_back(f.string());
287287
}
288288
}
289289
}
@@ -295,7 +295,7 @@ void getLibsRecursively(const fs::path & path, std::vector < std::string > & lib
295295
if (!fs::is_directory(path)) return;
296296
for (const auto & entry : fs::directory_iterator(path)) {
297297
auto f = entry.path();
298-
std::vector<std::string> splittedPath = ofSplitString(f, fs::path("/").make_preferred().string());
298+
std::vector<std::string> splittedPath = ofSplitString(f.string(), fs::path("/").make_preferred().string());
299299

300300
// ofFile temp(dir.getFile(i));
301301
std::string ext = "";
@@ -334,12 +334,12 @@ void getLibsRecursively(const fs::path & path, std::vector < std::string > & lib
334334
if (ext == "a" || ext == "lib" || ext == "dylib" || ext == "so" || (ext == "dll" && platform != "vs")){
335335
if (platformFound){
336336
// libLibs.emplace_back( f, arch, target );
337-
libLibs.push_back({ f, arch, target });
337+
libLibs.push_back({ f.string(), arch, target});
338338

339339
//TODO: THEO hack
340340
if( platform == "ios" ){ //this is so we can add the osx libs for the simulator builds
341341

342-
std::string currentPath = f;
342+
std::string currentPath = f.string();
343343

344344
//TODO: THEO double hack this is why we need install.xml - custom ignore ofxOpenCv
345345
if( currentPath.find("ofxOpenCv") == std::string::npos ){
@@ -352,7 +352,7 @@ void getLibsRecursively(const fs::path & path, std::vector < std::string > & lib
352352
}
353353
}
354354
} else if (ext == "h" || ext == "hpp" || ext == "c" || ext == "cpp" || ext == "cc" || ext == "cxx" || ext == "m" || ext == "mm"){
355-
libFiles.emplace_back(f);
355+
libFiles.emplace_back(f.string());
356356
}
357357
}
358358
}

0 commit comments

Comments
 (0)