Merge branch 'install-bits'

FIXES #729
This commit is contained in:
Adriaan de Groot 2018-02-21 10:15:58 -05:00
commit 36ef4556b4
5 changed files with 37 additions and 24 deletions

View File

@ -126,16 +126,12 @@ set( QT_VERSION 5.6.0 )
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Core Gui Widgets LinguistTools Svg Quick QuickWidgets )
find_package( YAMLCPP 0.5.1 REQUIRED )
find_package( PolkitQt5-1 REQUIRED )
find_package(ECM 5.18 NO_MODULE)
if( ECM_FOUND )
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})
endif()
# Find ECM once, and add it to the module search path; Calamares
# modules that need ECM can do
# find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE),
# no need to mess with the module path after.
set( ECM_VERSION 5.10.0 )
set( ECM_VERSION 5.18 )
find_package(ECM ${ECM_VERSION} NO_MODULE)
if( ECM_FOUND )
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})
@ -340,16 +336,20 @@ file( RELATIVE_PATH CONF_REL_INCLUDE_DIR "${CMAKE_INSTALL_FULL_CMAKEDIR}" "${CMA
configure_file( CalamaresConfig.cmake.in "${PROJECT_BINARY_DIR}/CalamaresConfig.cmake" @ONLY )
configure_file( CalamaresConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake" @ONLY )
configure_file( CalamaresUse.cmake.in "${PROJECT_BINARY_DIR}/CalamaresUse.cmake" @ONLY )
# Install the cmake files
install(
FILES
"${PROJECT_BINARY_DIR}/CalamaresConfig.cmake"
"${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake"
"${PROJECT_BINARY_DIR}/CalamaresUse.cmake"
"CMakeModules/CalamaresAddPlugin.cmake"
"CMakeModules/CalamaresAddModuleSubdirectory.cmake"
"CMakeModules/CalamaresAddLibrary.cmake"
"CMakeModules/CalamaresAddBrandingSubdirectory.cmake"
"CMakeModules/CalamaresAddTranslations.cmake"
"CMakeModules/CMakeColors.cmake"
DESTINATION
"${CMAKE_INSTALL_CMAKEDIR}"
)

29
CalamaresUse.cmake.in Normal file
View File

@ -0,0 +1,29 @@
# A setup-cmake-things-for-Calamares module.
#
# This module handles looking for dependencies and including
# all of the Calamares macro modules, so that you can focus
# on just using the macros to build Calamares modules.
# Typical use looks like this:
#
# ```
# find_package( Calamares REQUIRED )
# include( "${CALAMARES_CMAKE_DIR}/CalamaresUse.cmake" )
# ```
#
# The first CMake command finds Calamares (which will contain
# this file), then adds the found location to the search path,
# and then includes this file. After that, you can use
# Calamares module and plugin macros.
if( NOT CALAMARES_CMAKE_DIR )
message( FATAL_ERROR "Use find_package(Calamares) first." )
endif()
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CALAMARES_CMAKE_DIR} )
find_package( Qt5 @QT_VERSION@ CONFIG REQUIRED Core Widgets )
include( CalamaresAddLibrary )
include( CalamaresAddModuleSubdirectory )
include( CalamaresAddPlugin )
include( CalamaresAddBrandingSubdirectory )

View File

@ -18,10 +18,6 @@ set( calamaresSources
progresstree/ViewStepItem.cpp
)
set( calamaresUi
#nothing to do here
)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
@ -33,16 +29,14 @@ include_directories(
include( GNUInstallDirs )
qt5_wrap_ui( calamaresUi_H ${calamaresUi} )
# Translations
include( CalamaresAddTranslations )
add_calamares_translations( ${CALAMARES_TRANSLATION_LANGUAGES} )
set( final_src ${calamaresUi_H} ${calamaresSources} ${calamaresRc} ${trans_outfile} )
set( final_src ${calamaresSources} ${calamaresRc} ${trans_outfile} )
add_executable( calamares_bin ${final_src} )
SET_TARGET_PROPERTIES(calamares_bin
set_target_properties(calamares_bin
PROPERTIES
AUTOMOC TRUE
ENABLE_EXPORTS TRUE

View File

@ -83,8 +83,6 @@ add_library( calamares SHARED ${libSources} ${kdsagSources} ${utilsSources} )
set_target_properties( calamares
PROPERTIES
AUTOMOC TRUE
VERSION ${CALAMARES_VERSION_SHORT}
SOVERSION ${CALAMARES_VERSION_SHORT}
)
target_link_libraries( calamares
@ -94,18 +92,10 @@ target_link_libraries( calamares
install( TARGETS calamares
EXPORT CalamaresLibraryDepends
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
# Make symlink lib/calamares/libcalamares.so to lib/libcalamares.so.VERSION so
# lib/calamares can be used as module path for the Python interpreter.
install( CODE "
file( MAKE_DIRECTORY \"\$ENV{DESTDIR}/${CMAKE_INSTALL_FULL_LIBDIR}/calamares\" )
execute_process( COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ../libcalamares.so.${CALAMARES_VERSION_SHORT} libcalamares.so WORKING_DIRECTORY \"\$ENV{DESTDIR}/${CMAKE_INSTALL_FULL_LIBDIR}/calamares\" )
")
# Install header files
file( GLOB rootHeaders "*.h" )
file( GLOB kdsingleapplicationguardHeaders "kdsingleapplicationguard/*.h" )

View File

@ -78,5 +78,5 @@ calamares_add_library( calamaresui
Qt5::QuickWidgets
RESOURCES libcalamaresui.qrc
EXPORT CalamaresLibraryDepends
VERSION ${CALAMARES_VERSION_SHORT}
NO_VERSION
)