Skip to content

Commit

Permalink
Merge pull request #109 from libyui/huha-cmake
Browse files Browse the repository at this point in the history
New CMake-based Build Environment for libyui-ncurses
  • Loading branch information
shundhammer committed Feb 4, 2021
2 parents ce8fcc2 + 85d203d commit 37d3a1e
Show file tree
Hide file tree
Showing 22 changed files with 577 additions and 471 deletions.
101 changes: 5 additions & 96 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,110 +1,19 @@
# 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
*.o

# Compiled Dynamic libraries
*.so
*.so.*

# Compiled Static libraries
*.lai
*.la
*.a

# CMake
CMakeCache.txt
CMakeFiles
CMakeLists.txt
CMakeDoxyfile.in
Doxyfile
Doxygen.warnings
Makefile
cmake_install.cmake
install_manifest.txt

# CMake project-bindir
build*/
package/*.tar.*

# 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/
*.auto

60 changes: 60 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# CMakeLists.txt for libyui-ncurses
#
# 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-ncurses )

# 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 )

set( CMAKE_INSTALL_MESSAGE LAZY ) # Suppress "up-to-date" messages during "make install"


# 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()
1 change: 0 additions & 1 deletion MAINTAINER

This file was deleted.

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-ncurses
#

# 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
18 changes: 0 additions & 18 deletions PROJECTINFO.cmake

This file was deleted.

28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,31 @@
providing Qt, GTK and ncurses frontends. Originally it was developed for
[YaST](https://yast.github.io/) but it can be used in any independent project.

This part contains the text mode front end which displays the UI in a console
This part contains the text mode front-end which displays the UI in a console
or a terminal emulator.


### 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 All @@ -31,4 +46,3 @@ Then to build the package run:
```
rake osc:build
```

11 changes: 10 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
#--
# Copyright (C) 2015 SUSE LLC
# Copyright (c) 2015-2019 SUSE LLC
# Copyright (c) 2020-2021 SUSE LLC
#
# make continuous integration using rubygem-libyui-rake.
#
# MIT license
#++
require "libyui/rake"

Libyui::Tasks.configuration do |conf|
include Libyui::Tasks::Helpers

conf.skip_license_check << /^Makefile\.repo$/
conf.skip_license_check << /^src\/.*\.h\.in$/
conf.skip_license_check << /CMakeLists\.txt$/
end

0 comments on commit 37d3a1e

Please sign in to comment.