-
Notifications
You must be signed in to change notification settings - Fork 314
move to cmake, ctest, cpack to build direwolf #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seen that we moved data in the data/ directory we need to add the new patch to source code.
to facilitate the parsing con cmake move from single letter like C to tag like %C%
in this way there is not mismatch
this step unify the builing system for all platforms (windows, linux, osx and *BSD) * Requirements: - gcc/clang (C/C++ compiler) (in debian build-essential) - cmake (in debian cmake) - git if you build from source (in debian git) - posix threads ** Requirements on *BSD/macOS: - portaudio ** Optional Requirements: - gpsd (in debian libgps-dev) - libhamlib (in debian libhamlib-dev) ** Optional Requirements in Linux - udev (in debian libudev-dev) - alsa (in debian libasound2-dev) * Main changes: - version is now set only on CMakeLists.txt and automatically used on the code - cpu flags are auto-discovered in the default build and it works on gcc/clang/msvc on x86/x86_64/arm; you can force cpu flags with -DFORCE_SSE=1 for example (see CMakeLists.txt on root) - use a more "complex" tag on generic.conf to facilitate parsing by cmake (not more platform dependent). Now it is %C% or %R% for example - target `tocalls-symbols` is now called `data-update` - created debian/ directory to contains files to use debuild * Example to build: mkdir build && cd build cmake .. make make install make install-conf then you have the binary files on src/ and in the system directory * CMake options (see the head of CMakeLists.txt) - FORCE_SSE force sse instruction - FORCE_SSSE3 force ssse3 instruction - FORCE_SSE41 force ssse4.1 instruction - OPTIONAL_TEST compile optional test (might be broken) - BUILD_TESTING enable tests (ctest framework) - CMAKE_INSTALL_PREFIX if you want to change your install path prefix for example: cmake .. -DOPTIONAL_TEST=ON
- we set cpu flags for CXX and C - raspberry "only" has lxterminal not xterm
this way permit to use cmake language to manipulate the target and avoid restriction imposed by CMAKE_COMMAND command mode
the new tests are implemented with CTest suite of CMake. To enable the tests you need to run cmake with -DBUILD_TESTING=ON There are optional tests (that might not work) that can be enabled with -DOPTIONAL_TEST=ON So, to enable all tests and run it use the following command mkdir build cmake -DBUILD_TESTING=ON -DOPTIONA_TEST=ON .. make ctest to debug the errors use ctest --debug You can always find all tests binary on build/test/ Implementation: - check-modem* tests are implemented with shell script because it requires to execute many commands and therefore will be easy to manage. The file is configured at configuration time. - for single binary we verify the exit status (default = 0) so you only need to build the binary and add it to add_test()
in this way, If the input file is modified the build system will re-run CMake to re-configure the file and generate the build system again.
works with cygwin and x86_64-w64-mingw32-gcc/x86_64-w64-mingw32-g++ from the package installer of cygwin. To use that add the following lines to .bash_profile export CC=x86_64-w64-mingw32-gcc export CXX=x86_64-w64-mingw32-g++ you also need cmake from cygwin
This should works fine also with cpack and packaging seen that they are using DESTDIR. CPACK: - from 2.8.3 CPACK_SET_DESTDIR is default to ON - if you have trouble read CPACK_PACKAGING_INSTALL_PREFIX
unit test binaries are disabled by default now. To enable it use either cmake -DUNITTEST=1 .. or cmake -DCMAKE_BUILD_TYPE=DEBUG where CMAKE_BUILD_TYPE must be different from "RELEASE" see https://cmake.org/cmake/help/v3.0/variable/CMAKE_BUILD_TYPE.html
to create ZIP package run cpack to add new generator modify CPACK_GENERATOR variable. NOTE: pay attention on CPU flags optimization when you redistribuite the package (segmentation fault)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this PR reworks how direwolf is built and where the files are.
Now to build the project do
To run tests
To create archive to distribute (pay attention on CPU flags, see
CMakeLists.txt
)