Author Topic: prefer forward slash folder separator style (unix style) in cbp files?  (Read 14063 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Ok with the below patch:
Code
Index: E:/code/cb/cb_trunk_sf/src/plugins/contrib/wxSmithPlot/wxsSmithPlot.cbp
===================================================================
--- E:/code/cb/cb_trunk_sf/src/plugins/contrib/wxSmithPlot/wxsSmithPlot.cbp (revision 9132)
+++ E:/code/cb/cb_trunk_sf/src/plugins/contrib/wxSmithPlot/wxsSmithPlot.cbp (working copy)
@@ -7,33 +7,34 @@
  <Option compiler="gcc" />
  <Build>
  <Target title="MathPlot">
- <Option output="..\..\..\devel\libMathPlot" prefix_auto="1" extension_auto="1" />
+ <Option output="../../../devel/MathPlot" prefix_auto="1" extension_auto="1" />
  <Option working_dir="" />
- <Option object_output="..\..\..\.objs\plugins\contrib\wxSmithPlot\MathPlot" />
+ <Option object_output="../../../.objs/plugins/contrib/wxSmithPlot/MathPlot" />
  <Option type="2" />
  <Option compiler="gcc" />
  <Option createDefFile="1" />
  </Target>
  <Target title="wxSmithPlot">
  <Option platforms="Windows;" />
- <Option output="..\..\..\devel\share\codeblocks\plugins\wxSmithPlot" prefix_auto="0" extension_auto="1" />
- <Option working_dir="..\..\..\devel" />
- <Option object_output="..\..\..\.objs\plugins\contrib\wxSmithPlot" />
+ <Option output="../../../devel/share/codeblocks/plugins/wxSmithPlot" prefix_auto="0" extension_auto="1" />
+ <Option working_dir="../../../devel" />
+ <Option object_output="../../../.objs/plugins/contrib/wxSmithPlot" />
  <Option type="3" />
  <Option compiler="gcc" />
  <Option parameters="--debug-log -na -ns -nd" />
  <Option host_application="codeblocks.exe" />
+ <Option run_host_application_in_terminal="0" />
  <Option projectLinkerOptionsRelation="2" />
  <Compiler>
  <Add option="-DBUILDING_PLUGIN" />
  <Add option="-DcbDEBUG" />
  <Add option="-DCB_PRECOMP" />
- <Add directory="..\..\..\include" />
- <Add directory="..\..\..\sdk\wxscintilla\include" />
- <Add directory="..\..\..\sdk\wxpropgrid\include" />
- <Add directory="..\wxSmith\properties" />
- <Add directory="..\wxSmith\wxwidgets" />
- <Add directory="..\wxSmith\wxwidgets\properties" />
+ <Add directory="../../../include" />
+ <Add directory="../../../sdk/wxscintilla/include" />
+ <Add directory="../../../sdk/wxpropgrid/include" />
+ <Add directory="../wxSmith/properties" />
+ <Add directory="../wxSmith/wxwidgets" />
+ <Add directory="../wxSmith/wxwidgets/properties" />
  <Add directory="images" />
  </Compiler>
  <Linker>
@@ -41,7 +42,7 @@
  <Add library="wxsmithlib" />
  <Add library="codeblocks" />
  <Add library="wxpropgrid" />
- <Add directory="..\..\..\devel" />
+ <Add directory="../../../devel" />
  </Linker>
  <ExtraCommands>
  <Add after="zip -j9 ..\..\..\devel\share\CodeBlocks\wxSmithPlot.zip manifest.xml" />
@@ -70,7 +71,7 @@
  <Add option="-DWX_PRECOMP" />
  <Add option="-DwxUSE_UNICODE" />
  <Add directory="$(#wx.include)" />
- <Add directory="$(#wx.lib)\gcc_dll$(WX_CFG)\msw$(WX_SUFFIX)" />
+ <Add directory="$(#wx.lib)/gcc_dll$(WX_CFG)/msw$(WX_SUFFIX)" />
  <Add directory="." />
  </Compiler>
  <Linker>
@@ -78,30 +79,30 @@
  <Add option="-Wl,--export-all-symbols" />
  <Add option="-Wl,--enable-auto-import" />
  <Add library="wxmsw28$(WX_SUFFIX)" />
- <Add directory="$(#wx.lib)\gcc_dll$(WX_CFG)" />
+ <Add directory="$(#wx.lib)/gcc_dll$(WX_CFG)" />
  </Linker>
- <Unit filename="images\axis16.xpm">
+ <Unit filename="images/axis16.xpm">
  <Option target="wxSmithPlot" />
  </Unit>
- <Unit filename="images\axis32.xpm">
+ <Unit filename="images/axis32.xpm">
  <Option target="wxSmithPlot" />
  </Unit>
- <Unit filename="images\marker16.xpm">
+ <Unit filename="images/marker16.xpm">
  <Option target="wxSmithPlot" />
  </Unit>
- <Unit filename="images\marker32.xpm">
+ <Unit filename="images/marker32.xpm">
  <Option target="wxSmithPlot" />
  </Unit>
- <Unit filename="images\plot16.xpm">
+ <Unit filename="images/plot16.xpm">
  <Option target="wxSmithPlot" />
  </Unit>
- <Unit filename="images\plot32.xpm">
+ <Unit filename="images/plot32.xpm">
  <Option target="wxSmithPlot" />
  </Unit>
- <Unit filename="images\vector16.xpm">
+ <Unit filename="images/vector16.xpm">
  <Option target="wxSmithPlot" />
  </Unit>
- <Unit filename="images\vector32.xpm">
+ <Unit filename="images/vector32.xpm">
  <Option target="wxSmithPlot" />
  </Unit>
  <Unit filename="manifest.xml">


No functional change, but we should forward slash in cbp files?
« Last Edit: June 03, 2013, 11:42:35 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Doesn't matter, because in cb we don't share projects between oses.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
I see most cbp files in CB sources (For Windows C::B project) use unix style folder separator.
Maybe, Morten can say some thing on this.

I see another change is:
Code
-				<Option output="..\..\..\devel\libMathPlot" prefix_auto="1" extension_auto="1" />
+ <Option output="../../../devel/MathPlot" prefix_auto="1" extension_auto="1" />
I also see it does not cause any issue.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Online gd_on

  • Lives here!
  • ****
  • Posts: 824
Quote
Doesn't matter, because in cb we don't share projects between oses.

For me it's important that .cbp files uses forward or back slashes indifferently. I have some big projects (and workspaces) that I compile on Linux and Windows : so, it's a nice thing to be able to use exactly the same .cbp file on both OSes.

gd_on
Windows 11 64 bits (24H2), svn C::B (last version or almost!), wxWidgets 3.2.8 (tests with 3.3), Msys2 Compilers 15.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Well, since Windows is the only OS using backlashes, and the Win32 API functions silently translate forward slashes to backslashes, where's the problem?
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Code::Blocks (newer than 10.05) saves all paths in the .cbp as Unix style (for all OS's).  On Windows, the Unix style paths are converted to Windows style on load (and back to Unix on save).