Skip to content

Commit

Permalink
Merge pull request #45 from libyui/huha-cmake
Browse files Browse the repository at this point in the history
New CMake-based Build Environment for libyui-ncurses-pkg
  • Loading branch information
shundhammer committed Feb 4, 2021
2 parents 4ffb2f0 + b4858bf commit bbfaaf5
Show file tree
Hide file tree
Showing 69 changed files with 839 additions and 640 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-pkg
#
# 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-pkg )

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

This file was deleted.

10 changes: 9 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
#--
# 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 << /CMakeLists\.txt$/
end
64 changes: 0 additions & 64 deletions SOURCECONF.cmake

This file was deleted.

10 changes: 4 additions & 6 deletions VERSION.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
SET( VERSION_MAJOR "2" )
SET( VERSION_MINOR "50" )
SET( VERSION_PATCH "10" )
SET( VERSION_MAJOR "4")
SET( VERSION_MINOR "0" )
SET( VERSION_PATCH "0" )
SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )

##### This is need for the libyui core ONLY.
##### These will be overridden from exports in LibyuiConfig.cmake
SET( SONAME_MAJOR "0" )
SET( SONAME_MAJOR "15" )
SET( SONAME_MINOR "0" )
SET( SONAME_PATCH "0" )
SET( SONAME "${SONAME_MAJOR}.${SONAME_MINOR}.${SONAME_PATCH}" )

0 comments on commit bbfaaf5

Please sign in to comment.