mirror of https://github.com/cutefishos/calamares
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
102 lines
3.6 KiB
CMake
102 lines
3.6 KiB
CMake
project( calamares )
|
|
cmake_minimum_required( VERSION 2.8.12 )
|
|
set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" )
|
|
|
|
cmake_policy( SET CMP0023 OLD )
|
|
|
|
find_package( Qt5 5.3.0 CONFIG REQUIRED Core Gui Widgets )
|
|
|
|
###
|
|
### Calamares application info
|
|
###
|
|
SET( CALAMARES_ORGANIZATION_NAME "The Calamares Team" )
|
|
SET( CALAMARES_ORGANIZATION_DOMAIN "github.com/calamares" )
|
|
SET( CALAMARES_APPLICATION_NAME "Calamares" )
|
|
SET( CALAMARES_DESCRIPTION_SUMMARY "The distribution-independent installer framework" )
|
|
|
|
set( CALAMARES_VERSION_MAJOR 0 )
|
|
set( CALAMARES_VERSION_MINOR 1 )
|
|
set( CALAMARES_VERSION_PATCH 0 )
|
|
#set( CALAMARES_VERSION_RC 0 )
|
|
|
|
set( CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH} )
|
|
set( CALAMARES_VERSION_SHORT "${CALAMARES_VERSION}" )
|
|
if( CALAMARES_VERSION_RC )
|
|
set( CALAMARES_VERSION ${CALAMARES_VERSION}rc${CALAMARES_VERSION_RC} )
|
|
endif()
|
|
|
|
# additional info for non-release builds
|
|
if( NOT BUILD_RELEASE AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git/" )
|
|
include( CMakeDateStamp )
|
|
set( CALAMARES_VERSION_DATE "${CMAKE_DATESTAMP_YEAR}${CMAKE_DATESTAMP_MONTH}${CMAKE_DATESTAMP_DAY}" )
|
|
if( CALAMARES_VERSION_DATE GREATER 0 )
|
|
set( CALAMARES_VERSION ${CALAMARES_VERSION}.${CALAMARES_VERSION_DATE} )
|
|
endif()
|
|
|
|
include( CMakeVersionSource )
|
|
if( CMAKE_VERSION_SOURCE )
|
|
set( CALAMARES_VERSION ${CALAMARES_VERSION}-${CMAKE_VERSION_SOURCE} )
|
|
endif()
|
|
endif()
|
|
|
|
# enforce using constBegin, constEnd for const-iterators
|
|
add_definitions( "-DQT_STRICT_ITERATORS" )
|
|
|
|
# set paths
|
|
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
|
|
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
|
|
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
|
|
|
|
# make predefined install dirs available everywhere
|
|
include( GNUInstallDirs )
|
|
|
|
# make uninstall support
|
|
configure_file(
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
|
IMMEDIATE @ONLY
|
|
)
|
|
|
|
set( CALAMARES_LIBRARIES calamareslib )
|
|
|
|
add_subdirectory( src )
|
|
|
|
# Add all targets to the build-tree export set
|
|
set( CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/Calamares" CACHE PATH "Installation directory for CMake files" )
|
|
set( CMAKE_INSTALL_FULL_CMAKEDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_CMAKEDIR}" )
|
|
export(TARGETS calamareslib
|
|
FILE "${PROJECT_BINARY_DIR}/CalamaresLibraryDepends.cmake")
|
|
|
|
# Export the package for use from the build-tree
|
|
# (this registers the build-tree with a global CMake-registry)
|
|
export( PACKAGE Calamares )
|
|
|
|
# Create a CalamaresBuildTreeSettings.cmake file for the use from the build tree
|
|
configure_file( CalamaresBuildTreeSettings.cmake.in "${PROJECT_BINARY_DIR}/CalamaresBuildTreeSettings.cmake" @ONLY )
|
|
|
|
# Create the CalamaresConfig.cmake and CalamaresConfigVersion files
|
|
file( RELATIVE_PATH CONF_REL_INCLUDE_DIR "${CMAKE_INSTALL_FULL_CMAKEDIR}" "${CMAKE_INSTALL_FULL_INCLUDEDIR}" )
|
|
|
|
configure_file( CalamaresConfig.cmake.in "${PROJECT_BINARY_DIR}/CalamaresConfig.cmake" @ONLY )
|
|
configure_file( CalamaresConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake" @ONLY )
|
|
|
|
# Install the cmake files
|
|
install(
|
|
FILES
|
|
"${PROJECT_BINARY_DIR}/CalamaresConfig.cmake"
|
|
"${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake"
|
|
# "${PROJECT_BINARY_DIR}/CalamaresUse.cmake"
|
|
# "${PROJECT_BINARY_DIR}/CalamaresAddPlugin.cmake"
|
|
# "${PROJECT_BINARY_DIR}/CalamaresAddLibrary.cmake"
|
|
DESTINATION
|
|
"${CMAKE_INSTALL_CMAKEDIR}"
|
|
)
|
|
|
|
# Install the export set for use with the install-tree
|
|
install(
|
|
EXPORT
|
|
CalamaresLibraryDepends
|
|
DESTINATION
|
|
"${CMAKE_INSTALL_CMAKEDIR}"
|
|
)
|