세상을 이롭게

OpenCPN 개발하기_02.빌드 본문

카테고리 없음

OpenCPN 개발하기_02.빌드

2022. 1. 21. 11:01

메뉴얼에 나와있는 대로 더 진행해보도록 하겠습니다.

Getting and building OpenCPN source

Get the OpenCPN sources

In the open x86 Native Tools Command Prompt for VS 2017 execute the following commands:

cd \Users\myname\Sources
git clone https://github.com/OpenCPN/OpenCPN

Get prebuilt Windows dependencies

  • Download the dependencies bundle from OpenCPN_buildwin-4.99a.7z
  • Extract into c:\Users\myname\Sources\OpenCPN\buildwin using 7-Zip

Building OpenCPN

  • In the open x86 Native Tools Command Prompt for VS 2017 execute the following commands to create the build directory, generate the solutions files and build the debug version, the release version and the setup package.
  • **필자는 2019를 사용하고 있으므로 Visual Strudio 16 2019 로 해보겠습니다.
cd C:\Users\myname\Sources\OpenCPN
mkdir build
cd build
cmake -G "Visual Studio 15 2017" -T v141_xp ..
cmake --build .
cmake --build . --config release
cmake --build . --config release --target package
Visual Studio 2017 이 없어서 나는 문제이다.
v142를 타겟으로 

 

플랫폼 도구 집합을 바꿔달라 했지만  무시하였다.

 CMakeCache.txt 에서 v141_xp 를 v142로 바꾸고 다시 해보았다.

wxWidgets 에서 안된단다.

 

asdasd

asd

asd
asdasdasdsa

 

  • These commands should generate an OpenCPN install package in c:\Users\username\Sources\OpenCPN\build\opencpn_5.0.0_setup.exe
  • Excecute this program to install OpenCPN. Choose c:\Program Files (x86)\OpenCPN\ as installation directory to avoid unnecessary issues when installing plugins.

Alternatives:

  • Instead of running the last 3 cmake-commands, one could also start Visual Studio, open the generated solutionfile OpenCPN.sln and build from there.
  • Obviously other directories can be used as well, just as multiple opencpn installation. The instructions above are meant for those setting up a new development environment for just OpenCPN 5.0.

Setup Copyfiles.bat - Last step to Debug

Copyfiles.bat is a useful single batch file to copy all the needed files to the various directories. This batch file does not execute any cmake commands.

  • Download Copyfiles.bat.doc and remove the .doc
  • Move the file to <Your OpenCPN source tree> (for example: C:\Compile\Github\Opencpn)
  • Execute copyfiles.bat
  • Start Visual Studio 2017 and the OpenCPN-solution file. (For Example: C:\Compile\Github\Opencpn\build\opencpn.sln)
  • If the Solution Explorer is not visible, open the Solution Explorer (Via the view-menu, or Ctrl+Alt+L)
  • Select the project “Opencpn” from the list, right click and pick “Set as Startup Project”

Now Opencpn should be ready to debug.

BatchUTILS

BatchUTILS is another alternative that is a more complete set of batch files to assist building OpenCPN. Osetup.bat is intended to be modified by an individual user based on their own system. Git clone https://github.com/transmitterdan/BatchUTILS to your github directory, next to the OpenCPN local repository. Discussion about the use and development of BatchUtils

It’s nearly impossible to guess all the possible wxWidgets versions someone might have on their system. Also, other tools sometimes change paths as new versions are released. So it is expected that each user will customize Osetup.bat. The latest of Transmitter Dan's batchutils is in git. If you want to use some other environment variable other than WXDIR that is ok. The Cmake tool will accept a number of possible environment names as the root of the wxWidgets toolkit.

First Run

  1. Make sure you've downloaded wxWidgets 3.1.2 and compiled them See the paragraph above.
  2. Be sure to set environment path for wxWIDGETS_ROOT_DIR
  3. First try doing Release or RelWithDebInfo to avoid issues using Debug because of missing wxWidgets debug .dlls.
  4. Do not use the “All Build” target. Use the “opencpn” target.
  5. Right click on “opencpn” target, and select “Set as StartUp Project”
  6. Build the target “opencpn”. Should be able to debug this now.
  7. If you get a popup similar to “this DLL can't be found; wxmsw312ud_gl_vc_custom.dll
  8. You will need to rebuild wxWidgets in Debug mode if you want to run the OCPN Debug build. Not difficult. See the paragraph above.
  9. You can also get useful debugging from the “RelWithDebInfo” build.