You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

175 lines
3.3 KiB

cmake_minimum_required(VERSION 2.6)
set(PROJECT cl-install-gui)
project(${PROJECT})
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "MinsizeRel")
endif(NOT CMAKE_BUILD_TYPE)
list(APPEND CMAKE_MODULE_PATH "cmake")
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_INSTALL_PREFIX /usr CACHE INTERNAL "Prefix prepended to install directories" FORCE)
set(QT_MIN_VERSION 4.6.2)
find_package(Qt4 COMPONENTS QtCore QtGui QtXml REQUIRED)
include(${QT_USE_FILE})
# TODO: qtermwidget also REQUIRED
set(TRANSLATIONS_DEST "share/${PROJECT}")
set( SOURCES
src/main.cpp
src/systeminstaller.cpp
src/calculateconfig.cpp
src/pagemanager.cpp
src/pagewelcome.cpp
src/pagelicense.cpp
src/pagepartitioning.cpp
src/pagecfdisk.cpp
src/pagemountpoints.cpp
src/pageconfiguration.cpp
src/pageusers.cpp
src/pageinstall.cpp
src/pagefinish.cpp
src/tools.cpp
src/userinfodialog.cpp
src/mountpointdialog.cpp
)
set( HEADERS
src/systeminstaller.h
src/calculateconfig.h
src/installerpage.h
src/pagemanager.h
src/pagewelcome.h
src/pagelicense.h
src/pagepartitioning.h
src/pagecfdisk.h
src/pagemountpoints.h
src/pageconfiguration.h
src/pageusers.h
src/pageinstall.h
src/pagefinish.h
src/userinfodialog.h
src/mountpointdialog.h
# src/commons.h
)
set( LANGUAGES
ru
bg
uk
)
set( RESOURCES
resources/systeminstaller.qrc
)
set( DESKTOP
resources/cl-install-gui.desktop
resources/cl-install-gui-kde.desktop
)
set( ICONS
resources/cl-install-gui.png
)
add_definitions(-DNO_INSTALL -DQT_GUI_LIB -DQT_CORE_LIB -Wall)
include_directories(
./
${QT_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
/usr/lib
)
qt4_add_resources( RESOURCES_SRCS
${RESOURCES}
)
qt4_wrap_cpp( MOC_SRCS
${HEADERS}
)
foreach (LANGUAGE ${LANGUAGES})
set (TS ${PROJECT_SOURCE_DIR}/translations/${PROJECT}_${LANGUAGE}.ts)
set (QM ${CMAKE_BINARY_DIR}/translations/${PROJECT}_${LANGUAGE}.qm)
set (TRANSLATIONS ${TRANSLATIONS} ${TS})
set (TRANSLATIONS_BINARY ${TRANSLATIONS_BINARY} ${QM})
add_custom_command (
OUTPUT ${QM}
COMMAND ${QT_LRELEASE_EXECUTABLE} ${TS}
MAIN_DEPENDENCY ${TS}
)
endforeach()
add_custom_target (
translations
COMMAND ${QT_LUPDATE_EXECUTABLE} ${HEADERS} ${SOURCES} -ts ${TRANSLATIONS}
)
add_custom_command (
TARGET translations
COMMAND ${QT_LRELEASE_EXECUTABLE} ${TRANSLATIONS}
)
add_executable( ${PROJECT}
${HEADERS}
${SOURCES}
${MOC_SRCS}
${RESOURCES_SRCS}
${TRANSLATIONS}
)
target_link_libraries( ${PROJECT}
${QT_LIBRARIES}
qtermwidget
)
install( FILES ${CMAKE_BINARY_DIR}/${PROJECT}
DESTINATION sbin
PERMISSIONS
OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ
)
install( FILES ${TRANSLATIONS_BINARY}
DESTINATION share/${PROJECT}
PERMISSIONS
OWNER_WRITE OWNER_READ
GROUP_READ
WORLD_READ
)
install( FILES ${TRANSLATIONS_BINARY}
DESTINATION share/${PROJECT}
PERMISSIONS
OWNER_WRITE OWNER_READ
GROUP_READ
WORLD_READ
)
install( FILES ${DESKTOP}
DESTINATION share/applications
PERMISSIONS
OWNER_WRITE OWNER_READ
GROUP_READ
WORLD_READ
)
install( FILES ${ICONS}
DESTINATION share/pixmaps
PERMISSIONS
OWNER_WRITE OWNER_READ
GROUP_READ
WORLD_READ
)
#install( FILES resources/${PROJECT}.desktop
# DESTINATION share/applications
# PERMISSIONS
# OWNER_WRITE OWNER_READ
# GROUP_READ
# WORLD_READ
#)