Skip to content
Permalink
Browse files

Add CMake files, remove qmake files

  • Loading branch information...
Oleksii Vilchanskyi authored and tatokis committed Jan 10, 2018
1 parent 29f68dd commit c56d5f9b683531e2da717ff9377ce9a0d1581216
Showing with 3,338 additions and 526 deletions.
  1. +4 −1 .gitignore
  2. +0 −50 BUILD.md
  3. +155 −0 CMakeLists.txt
  4. +0 −24 ckb.pro
  5. +187 −0 cmake/cmake_uninstall.cmake.in
  6. +35 −0 cmake/modules/CkbNextBuildType.cmake
  7. +76 −0 cmake/modules/CkbNextCompileFlags.cmake
  8. +99 −0 cmake/modules/CkbNextDetermineVersion.cmake
  9. +39 −0 cmake/modules/CkbNextPlatform.cmake
  10. +370 −0 cmake/modules/DeployQt5.cmake
  11. +64 −0 cmake/modules/FindAppindicator.cmake
  12. +107 −0 cmake/modules/FindIconv.cmake
  13. +81 −0 cmake/modules/FindPulseAudio.cmake
  14. +48 −0 cmake/modules/FindQuaZip.cmake
  15. +95 −0 cmake/modules/FindUDEV.cmake
  16. +39 −0 cmake/modules/MacroEnsureOutOfSourceBuild.cmake
  17. +59 −0 cmake/modules/sanitizers/FindASan.cmake
  18. +57 −0 cmake/modules/sanitizers/FindMSan.cmake
  19. +87 −0 cmake/modules/sanitizers/FindSanitizers.cmake
  20. +65 −0 cmake/modules/sanitizers/FindTSan.cmake
  21. +46 −0 cmake/modules/sanitizers/FindUBSan.cmake
  22. +55 −0 cmake/modules/sanitizers/asan-wrapper
  23. +170 −0 cmake/modules/sanitizers/sanitize-helpers.cmake
  24. +0 −28 qmake-auto
  25. +47 −0 src/CMakeLists.txt
  26. +63 −0 src/animations/CMakeLists.txt
  27. +62 −0 src/animations/mviz/CMakeLists.txt
  28. +0 −71 src/ckb-daemon/ckb-daemon.pro
  29. +0 −19 src/ckb-gradient/ckb-gradient.pro
  30. +0 −19 src/ckb-heat/ckb-heat.pro
  31. +0 −21 src/ckb-mviz/ckb-mviz.pro
  32. +0 −19 src/ckb-pinwheel/ckb-pinwheel.pro
  33. +0 −19 src/ckb-rain/ckb-rain.pro
  34. +0 −19 src/ckb-random/ckb-random.pro
  35. +0 −19 src/ckb-ripple/ckb-ripple.pro
  36. +0 −19 src/ckb-wave/ckb-wave.pro
  37. +0 −198 src/ckb/ckb.pro
  38. +5 −0 src/ckbnextconfig.h.in
  39. +444 −0 src/daemon/CMakeLists.txt
  40. +476 −0 src/gui/CMakeLists.txt
  41. +37 −0 src/libs/CMakeLists.txt
  42. +83 −0 src/libs/ckb-next/CMakeLists.txt
  43. +28 −0 src/libs/ckb-next/cmake/AnimationConfig.cmake
  44. +62 −0 src/libs/kissfft/CMakeLists.txt
  45. +93 −0 src/libs/quazip/CMakeLists.txt
@@ -1,7 +1,8 @@
CMakeLists.txt.user
bin/
build/
*.app/
cmake-build-debug/
cmake-build*/
*.pkg
.DS_Store
.*
@@ -16,3 +17,5 @@ ui_*
qrc_*
.firmware
ckb-dev-detect-report.gz
ckb-next-dev-detect-report.gz
macos/pkgproj/build

This file was deleted.

@@ -0,0 +1,155 @@
# Copyright 2017-2018 ckb-next Development Team <ckb-next@googlegroups.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

# Lower it _only_ if tested to work correctly with that version!
# Might be as low as 3.3, but again, use at your own risk
cmake_minimum_required(VERSION 3.5.1 FATAL_ERROR)

project(ckb-next LANGUAGES C CXX VERSION 0.2.8)

# Let CMake find custom modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules/sanitizers")

include(MacroEnsureOutOfSourceBuild)
macro_ensure_out_of_source_build("ckb-next requires an out of source build. \
Please create a separate build directory and run 'cmake /path/to/ckb-next [options]' there.")

# Set platform-specific booleans
include(CkbNextPlatform)

# Set a default build type if none was specified
include(CkbNextBuildType)

# Get more precise version from git, fallback on release
include(CkbNextDetermineVersion)
find_package(Git)
determine_version("${ckb-next_SOURCE_DIR}" "${GIT_EXECUTABLE}" "ckb-next")

find_package(Sanitizers)

# Options for the whole project follow

include(CMakeDependentOption)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" CACHE STRING "Where to put binaries after compilation.")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" CACHE STRING "Where to put libraries after compilation.")

if (MACOS)
option(USE_BREW_QT5 "Use Homebrew package for Qt5." ON)
option(USE_BREW_QUAZIP "Use Homebrew package for QuaZip." ON)
elseif (LINUX)
option(WITH_MVIZ "Build with music visualizer." ON)
endif ()

# Options: GUI
option(WITH_GUI "Build with Qt GUI to manipulate animations." ON)

# Options: GUI animations
option(WITH_ANIMATIONS "Build with animations." ON)
cmake_dependent_option(WITH_GRADIENT "Build with 'Gradient' animation." ON "WITH_ANIMATIONS;WITH_GUI" OFF)
cmake_dependent_option(WITH_HEAT "Build with 'Heat map' animation." ON "WITH_ANIMATIONS;WITH_GUI" OFF)
cmake_dependent_option(WITH_RAIN "Build with 'Rain' animation." ON "WITH_ANIMATIONS;WITH_GUI" OFF)
cmake_dependent_option(WITH_RANDOM "Build with 'Random' animation." ON "WITH_ANIMATIONS;WITH_GUI" OFF)
cmake_dependent_option(WITH_PINWHEEL "Build with 'Pinwheel' animation." ON "WITH_ANIMATIONS;WITH_GUI" OFF)
cmake_dependent_option(WITH_RIPPLE "Build with 'Ripple' animation." ON "WITH_ANIMATIONS;WITH_GUI" OFF)
cmake_dependent_option(WITH_WAVE "Build with 'Wave' animation." ON "WITH_ANIMATIONS;WITH_GUI" OFF)

# Options: daemon
option(DEBUG_USB_SEND "Show the contents of USB packets being sent to device." OFF)
option(DEBUG_USB_RECV "Show the contents of USB packets being received from device." OFF)

# Options: install
if (MACOS)
set(CMAKE_INSTALL_PREFIX "/Applications")
endif ()

include(GNUInstallDirs)
set(ANIMATIONS_DIR_NAME "ckb-next-animations")
if (MACOS)
set(INSTALL_DIR_ANIMATIONS "ckb-next.app/Contents/Resources/${ANIMATIONS_DIR_NAME}"
CACHE STRING "Where to install animations.")
elseif (LINUX)
set(INSTALL_DIR_ANIMATIONS "${CMAKE_INSTALL_LIBEXECDIR}/${ANIMATIONS_DIR_NAME}"
CACHE STRING "Where to install animations.")
endif ()

# Options: other
option(SAFE_INSTALL "Execute pre-install tasks to ensure correct installation.
Intended to be used with direct installations without package manager." OFF)
option(SAFE_UNINSTALL "Execute pre-uninstall tasks to ensure correct removal.
Intended to be used with direct removals without package manager." OFF)

option(WITH_SHIPPED_QUAZIP "Use shipped QuaZip5 instead of system package" OFF)

if (NOT WITH_GUI)
message(WARNING "Building without GUI. Proceed only if you know what you are doing.")
endif ()

# Project-specific compiler settings
include(CkbNextCompileFlags)

add_subdirectory(src)

# Uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
@ONLY)

add_custom_target(
uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
USES_TERMINAL)

# macOS packaging
if (MACOS AND WITH_GUI)
include(ProcessorCount)
ProcessorCount(cores)
if ("${cores}" EQUAL 0)
message(FATAL_ERROR "Counted 0 cores")
else ()
message(STATUS "Number of cores: ${cores}")
endif ()

add_custom_target(
macos-package
COMMAND
${CMAKE_MAKE_PROGRAM} -j${cores}
COMMAND
sudo ${CMAKE_MAKE_PROGRAM} install
COMMAND
packagesbuild ${ckb-next_SOURCE_DIR}/macos/pkgproj/ckb-next.pkgproj
COMMAND
appdmg ${ckb-next_SOURCE_DIR}/macos/pkgproj/appdmg.json ckb-next_v${ckb-next_VERSION}_${CMAKE_OSX_DEPLOYMENT_TARGET}-SDK.dmg
WORKING_DIRECTORY
"${ckb-next_BINARY_DIR}"
COMMENT
"Generating macOS package"
USES_TERMINAL
VERBATIM)
endif ()
24 ckb.pro

This file was deleted.

0 comments on commit c56d5f9

Please sign in to comment.
You can’t perform that action at this time.