Skip to content

Commit

Permalink
Migration to new CMake build environment
Browse files Browse the repository at this point in the history
  • Loading branch information
shundhammer committed Jan 13, 2021
1 parent 2a33a8d commit e3f80b6
Show file tree
Hide file tree
Showing 15 changed files with 476 additions and 390 deletions.
89 changes: 5 additions & 84 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
# GNU Autotools
Makefile.in
/autom4te.cache
/aclocal.m4
/compile
/configure
/depcomp
/install-sh
/missing

# Object files
*.o

# Libraries
*.lib

# Shared objects (inc. Windows DLLs)
*.dll
*.so

# Executables
*.exe
*.out

# Compiled Object files
*.slo
*.lo
Expand All @@ -39,77 +22,15 @@ Makefile.in
# CMake
CMakeCache.txt
CMakeFiles
/CMakeLists.txt
CMakeDoxyfile.in
Doxyfile
Doxygen.warnings
Makefile
install_manifest.txt
**/*.cmake
libyui-qt.pc

# CMake project-bindir
build*/

# Misc
CMakeDoxyfile.in
Doxyfile
libyui-qt-pkg.pc
src/yui-qt-pkg_autogen

# Archives
# It's better to unpack these files and commit the raw source because
# git has its own built in compression methods.
*.7z
*.jar
*.rar
*.zip
*.gz
*.bzip
*.bz2
*.xz
*.lzma

# packing-only formats
*.iso
*.tar

# package management formats
*.dmg
*.xpi
*.gem
*.egg
*.deb
*.rpm

# CVS
/CVS/*
*/CVS/*
.cvsignore
*/.cvsignore*~
\#*\#

# Emacs
/.emacs.desktop
/.emacs.desktop.lock
.elc
auto-save-list
tramp
.\#*

# Emacs Org-mode
.org-id-locations

# Unix/Linux
*_archive
.*
!.gitignore
!.travis.yml
*~
*.bak
*.log
*.old
*swp
tmp

# KDE
.directory

# Subversion
.svn/
*.tar.*
58 changes: 58 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# CMakeLists.txt for libyui-qt
#
# Usage:
#
# mkdir build
# cd build
# cmake ..
#
# make
# sudo make install
#
# Restart with a clean build environment:
# rm -rf build
#
# Show the complete compiler commands with all arguments:
# make VERBOSE=1

cmake_minimum_required( VERSION 3.10 )
project( libyui-qt )

# Options usage:
#
# cmake -DBUILD_DOC=on -DBUILD_EXAMPLES=off ..

option( BUILD_SRC "Build in src/ subdirectory" on )
option( BUILD_DOC "Build class documentation" off )
option( WERROR "Treat all compiler warnings as errors" on )

# Non-boolean options
set( DOC_DESTDIR "" CACHE STRING "Destination directory prefix for installing docs" )

#----------------------------------------------------------------------


# As of now, no support for /usr/local instead of /usr. But CMake DESTDIR works.
set( CMAKE_INSTALL_PREFIX /usr )


# Initialize compiler flags for all targets in all subdirectories
add_compile_options( "-Wall" )
add_compile_options( "-Os" ) # Optimize for size (overrides CMake's -O3 in RELEASE builds)

if ( WERROR )
add_compile_options( "-Werror" )
endif()


#
# Descend into subdirectories
#

if ( BUILD_SRC )
add_subdirectory( src )
endif()

if ( BUILD_DOC )
add_subdirectory( doc )
endif()
23 changes: 0 additions & 23 deletions Makefile.cvs

This file was deleted.

63 changes: 63 additions & 0 deletions Makefile.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#
# Makefile.repo for libyui-qt-pkg
#

# Local Variables:
# mode: Makefile
# End:


all: clean configure build-hint

build-hint:
@echo ""
@echo "To build:"
@echo ""
@echo " cd build"
@echo " make"
@echo ""

configure:
mkdir build; \
cd build; \
cmake ..

build: clean configure
cd build; \
make -j $$(nproc)

# This needs root privileges, of course
install: configure
cd build; \
make -j $$(nproc) && make install

clean:
rm -rf build

package:
rake package

doc:
test -d build || mkdir build
cd build; \
cmake -DBUILD_DOC=on .. ; \
make doc

install-doc: doc
cd build; \
make install-doc

version-bump:
rake version:bump

# Just an alias
bump-version: version-bump


# Enforce rebuilding some targets unconditionally, even if a file or directory
# with that name exists; otherwise the timestamp of that file or directory
# would be checked.
#
# We need this because we have a subdirectory doc/, a subdirectory package/
# and possibly a subdirectory build/ here.
.PHONY: doc package build
22 changes: 0 additions & 22 deletions PROJECTINFO.cmake

This file was deleted.

25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,28 @@ information about related configuration files.
For details about reported bugs and issues see the wiki page
[background](https://github.com/libyui/libyui-ncurses-pkg/wiki/background).


### Building

Libyui uses CMake, driven by a slightly complex set of
[CMakefiles](https://github.com/libyui/libyui/tree/master/buildtools). For
reproducible builds it is best to use the [libyui-rake](
https://github.com/libyui/libyui-rake) Ruby gem like the [Jenkins CI](
https://ci.opensuse.org/view/libyui/) jobs do.
Libyui uses CMake. Most operations are available from the toplevel
_Makefile.repo_:

```
make -f Makefile.repo
cd build
make
```

or

```
make -f Makefile.repo build
```


For reproducible builds it is best to use the
[libyui-rake](https://github.com/libyui/libyui-rake)
Ruby gem like the [Jenkins CI](https://ci.opensuse.org/view/libyui/) jobs do.

It can be installed from [rubygems.org](https://rubygems.org/gems/libyui-rake/)
using this command (Ruby needs to be installed in the system):
Expand Down
36 changes: 0 additions & 36 deletions RPMINFO.cmake

This file was deleted.

5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
require "libyui/rake"

Libyui::Tasks.configuration do |conf|
# do not check license in qt metadata
conf.skip_license_check << /^Makefile\.repo$/
conf.skip_license_check << /^src\/.*\.h\.in$/
conf.skip_license_check << /^src\/icons\/.*\.svg$/
conf.skip_license_check << /CMakeLists\.txt$/
conf.skip_license_check << /.*\.qrc/
end
Loading

0 comments on commit e3f80b6

Please sign in to comment.