Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 17-01-2016, 06:55   #1
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,369
Compile O+OD for SVG Icons

As per Hakan
Quote:
Delete everything in ocpn_draw/build except
cairo.lib
expat.lib
opencpn.lib (fresh from yesterday)
WXSVG.lib
build.bat (Tdan's)
Using normal commands
Quote:
git fetch --all
git pull origin master
cd build
cmake -T v120_xp ..
cmake --build . --config release
cpack
Then tried git_fetch.bat from ocpn_draw_pi directory, worked fine.
Compiling ODraw for SVG Icons

Use with OpenCPN specially compiled for use with SVG Icon
To use SVG within OD you need to ensure that OD_USE_SVG=ON in the cmake. From ocpn_draw/build

Quote:
On SourceForge > opencpnplugins - Browse 'opencpn_packaging_data'
Download 'OpenCPN_buildwin-svg.7z' and expand and copy 'buildwin' into 'ocpn_draw_pi/'
These files should all be copied to 'ocpn_draw_pi/build'
cairo.lib Copy from \ocpn_draw_pi\build\buildwin\gtk\cairo.lib
expat.lib Copy from \ocpn_draw_pi\build\buildwin\expat-2.1.0\expate.lib
opencpn.lib Copy from \OpenCPN\build\release\opencpn.lib (fresh fetch & compile)
WXSVG.lib Copy from \OpenCPN\build\release\wxsvg.lib (fresh fetch & compile)
OR
Quote:
Or get these files from a recent Opencpn fetch
Copy: \GitHub\OpenCPN\buildwin\gtk\cairo.lib ---> ocpn_draw_pi\build\
Copy: \GitHub\OpenCPN\buildwin\expat-2.1.0\expate.lib ---> ocpn_draw_pi\build\
Copy: \GitHub\OpenCPN\build\release\wxsvg.lib ---> ocpn_draw_pi\build\
Copy: \GitHub\OpenCPN\build\release\opencpn.lib ---> ocpn_draw_pi\build\
Then Copy Images SVG & PNG
Quote:
Copy from \ocpn_draw_pi\data\[all images] ---> ocpn_draw_pi\images\ (new directory)
Ensure that OpenCPN is using SVG, i.e. compiled with OD_USE_SVG=ON as a cmake option.
Quote:
cmake -T v120_xp ..
cmake --OD_USE_SVG=ON ..
cmake --build . --config release [or debug]
cpack
Result: OK. When I check
..\GitHub\o-plugin\j-ocpn_draw_pi\build\_CPack_Packages\win32\NSIS\ocpn _draw_pi-0.4.618-win32\plugins\ocpn_draw_pi\data'
I find the svg and png files copied over. Also the exe was made and it instals.



Compiling OpenCPN for SVG Icons

From sourceforge download from opencpnplugins 'opencpn_packaging_data' -'OpenCPN_buildwin-svg.7z' ... and expand then copy 'buildwin' into 'OpenCPN/'

These files should all be copied to 'OpenCPN/build'
Quote:
cairo.lib Copy from buildwin
expat.lib Copy from buildwin
opencpn.lib Copy from fresh OpenCPN compile
WXSVG.lib Copy from fresh OpenCPN git fetch
Copy the SVG Image files
Quote:
Copy from ..\GitHub\OpenCPN\data\svg the directories: journeyman, journeyman_flat and traditional
to ..\GitHub\OpenCPN\images
also tried to
Quote:
..\GitHub\OpenCPN\build\uidata
These directories have the svg and png files

Result after Cpack - No svg directories in the NSIS directory, see below.

Also ensure that OpenCPN is using SVG, i.e. compiled with OCPN_USE_SVG=ON as a cmake option. Same routine
Quote:
cmake -T v120_xp ..
cmake --OCPN_USE_SVG=ON ..
cmake --build . --config release [or debug]
Result: No svg files or directories in the very bottom NSIS directory.

Also when I check '..\GitHub\o-plugin\j-ocpn_draw_pi\build\_CPack_Packages\win32\NSIS\ocpn _draw_pi-0.4.618-win32\plugins\ocpn_draw_pi\data'
I find NO svg files!!!
When installed the program loads with some icons (png?) and the screen is black and it freezes.

When I uninstall Ocpn_Draw_pi it does the same thing.
When I copy the Journeyman, Journeyman-flat, Traditional Icons to the Program Files x86/OpenCPN.4.1.1301/uidata directory there is no improvement. Toolbar shows with a Black screen, freezes.


=======
Debugging with VC2013 using the SVG Icon feature
(not tried yet)

Quote:
Copy cairo.lib, expat.lib and WXSVG.lib in the root of the build directory.
Copy the Git 'ocpn_draw_pi\data\*.svg & *.png' to VC2013 '\plugins\ocpn_draw_pi\data\' directory.

Using VC2013 build the project once you have run the cmake commands from the Dev Command prompt
cmake -T v120_xp ..
cmake --OCPN_USE_SVG=ON ..
In MSVC2013 issue 'Build'
This will expect to find the lib files and will complain if it does not.
At run time it will use the DLL's which should have been loaded by OCPN.

To install ocpn_draw_pi in MSVC, create an install package, install to MSVC and then running MSVC2010 OCPN. In this case the image files will all be in C:\Program Files\OpenCPN\plugins\ocpn_draw_pi\data.

You should notice that the SVG files are cleaner looking and if you cause them to scale they should still look OK. If you are not sure rename one of the SVG icons. In this case you will get a green jigsaw piece instead of the icon.
Question: Can you create an NSIS install file that is debug? -never tried it.

It would be nice to get this working. But I appear to be misunderstanding something here.
__________________

__________________
rgleason is online now   Reply With Quote
Old 17-01-2016, 08:06   #2
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,369
Re: Compile O+OD for SVG Icons

Just realized that the NSIS install did not get these three files, so I copied them to the main Opencpn.4.1.1301 directory.
Quote:
cairo.lib
expat.lib
opencpn.lib (already there)
WXSVG.lib
It still has journeyman png toolbar and is a black screen with hangup.

PS: I have also copied the SVG folders Journeyman, Journeyman-flat, Traditional to uidata as there did not appear to be any SVG anywhere after the installl.... Don't know if this is right. Where? Also I expect they can they be in a sub-folder.
__________________

__________________
rgleason is online now   Reply With Quote
Old 17-01-2016, 08:14   #3
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,369
Re: Compile O+OD for SVG Icons

I am going to delete Opencpn /build/ and start over.
May git Clone.
__________________
rgleason is online now   Reply With Quote
Old 17-01-2016, 13:41   #4
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 883
Re: Compile O+OD for SVG Icons

Rick,
To compile OCPN correctly you need to issue
Code:
cmake -DOCPN_USE_SVG=ON ..
Your cmake would not have build OCPN correctly.

You really need to pull the latest git for OCPN, run the cmake and build OCPN. The if you want to run from the IDE you will need to copy all the files that are mentioned in the doco, if you want to try an install I have found it easier to build the Package then install the exe file that is the result.

Now test to see if you are getting SVG images. They are generally much clearer if you scale them. To do this go to 'Options/User Interface' and move the GUI slider fully to the right, click 'OK' then wait for the toolbar to redraw. You should see nice clear LARGE icons. If they look fuzzy, then you are still using png files.

Once this is working THEN build OD. Make sure you copy the lib files, opencpn.lib. cairo.lib, expat.lib and WXSVG.lib to the build directory you are working from before you start.

The OD SVG and png files are all in the same directory, so just copy all of them to the correct place in your IDE version of OCPN ( in my install it is in plugins/ocpn_draw_pi/data under my build directory, alongside 'Debug' and 'Release' directories, but again, follow the OCPN build documentation).

If you want to see if you are using SVG files in OD, just remove one of the SVG icons and restart OCPN, you will see a green jigsaw piece instead of the real icon.

If you build the Package for both OCPN and OD and then install it should all work with all the correct images and dll's. Just the debugging builds are now a bit more complicated.

Regards
Jon
__________________
jongough is offline   Reply With Quote
Old 17-01-2016, 14:12   #5
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 1,967
Re: Compile O+OD for SVG Icons

Quote:
Originally Posted by rgleason View Post
I am going to delete Opencpn /build/ and start over.
May git Clone.
Rick.
That's what I did. And for the rest I use to do as of OpenCPN.org description using VS2013. And to make release/debug files copying easier use my "copyfile.bat".
But I've OD outside OCPN repository so far and for that I use my "copylib.bat" after OCPN- and before OD-build.
That's all and everything is working. (Jon the cmake -DOCPN_....... I've never used and no zig-zag??)
Håkan
__________________
Hakan is offline   Reply With Quote
Old 17-01-2016, 15:36   #6
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,369
Re: Compile O+OD for SVG Icons

Hakan, Thanks. Didn't have time today, nor tomorrow.
Quote:
(Jon the cmake -DOCPN_....... I've never used and no zig-zag??)
I think it is 'cmake --OCPN_USE_SVG=0N ..' That seems to do something reasonable.
I guess I will have to read small text some more and perhaps try your bats.
I found TDan's bats pretty darn good too, for different purposes.
Repurposed his for git_fetch.bat and can git and compile with just that. I don't have it set up to rebuild the whole build dir though.
__________________
rgleason is online now   Reply With Quote
Old 17-01-2016, 15:53   #7
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 883
Re: Compile O+OD for SVG Icons

Rick,
The '-DOCPN_USE_SVG=ON' is the default and if you were starting from scratch it would be set. If you have updated from an older version this variable may have been set to OFF and would have to be set ON by the user.

Jon
__________________
jongough is offline   Reply With Quote
Old 17-01-2016, 18:40   #8
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,369
Re: Compile O+OD for SVG Icons

I ran '--OCPN_USE_SVG=ON" maybe thats why it is not loading! Thanks.
__________________
rgleason is online now   Reply With Quote
Old 18-01-2016, 18:34   #9
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,369
Re: Compile O+OD for SVG Icons

All along I thought it was a compiling problem with Opencpn, for about a week.
It turns out that it appears to be a problem with OpenGL=ON..

Whenever OpenGL is turned on, the trouble starts. If it is left on, and OpenCPN is restarted again (after forcing shutdown with task manager or just leaving windows searching for solutions...) the toolbar comes up, the screen turns black and the program freezes.

When I go into ini and turn openGL off everything loads and works fine.

This is a change from about a week ago.

My Nvidia Geforce 540M no longer appears to work with OpenGL. It used to be a real champ. What happened?

So I don't believe it was a compile problem at all.

See attached if you want backup. Failure to Start.....
Attached Files
File Type: doc ov4.1.1301-failure-to-start.doc (29.8 KB, 21 views)
__________________

__________________
rgleason is online now   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting Png to Svg for O Icons rgleason OpenCPN 8 10-01-2016 04:16
Crew Wanted: crew wanted: Swan 48 Bequia SVG to Miami mountholly Crew Archives 7 19-01-2015 18:30
seasonal winds and currents in SVG Jana Atlantic & the Caribbean 1 20-05-2013 03:49
SVG Rating? snort Monohull Sailboats 3 03-03-2013 19:54
howto rebuild SVG icon ? manuprenlair OpenCPN 2 17-12-2011 12:35



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 21:43.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.