khanat-opennel-code/code/ryzom/tools/client/ryzom_installer/CMakeLists.txt

92 lines
4.4 KiB
Text
Raw Normal View History

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR} ${NEL_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ryzom/client/src/seven_zip ${ZLIB_INCLUDE_DIR})
FILE(GLOB SRC src/*.cpp src/*.h res/*.rc)
FILE(GLOB CLIENT_INSTALL_HDR src/*.h)
FILE(GLOB CLIENT_INSTALL_UIS ui/*.ui)
FILE(GLOB CLIENT_INSTALL_BASE_TRANS translations/qtbase*.ts)
FILE(GLOB CLIENT_INSTALL_TRANS translations/ryzom_installer_*.ts)
FILE(GLOB CLIENT_INSTALL_RCS res/*.qrc)
CONFIGURE_FILE(translations/translations.qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc COPYONLY)
LIST(APPEND CLIENT_INSTALL_RCS ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc)
IF(WITH_QT)
INCLUDE_DIRECTORIES(${QT_INCLUDES})
INCLUDE(${QT_USE_FILE})
QT4_ADD_TRANSLATION(CLIENT_INSTALL_QM ${CLIENT_INSTALL_TRANS})
QT4_ADD_RESOURCES(CLIENT_INSTALL_RC_SRCS ${CLIENT_INSTALL_RCS})
QT4_WRAP_CPP(CLIENT_INSTALL_MOC_SRC ${CLIENT_INSTALL_HDR})
QT4_WRAP_UI(CLIENT_INSTALL_UI_HDRS ${CLIENT_INSTALL_UIS})
ADD_DEFINITIONS(${QT_DEFINITIONS})
ELSE()
IF(WIN32)
FIND_PACKAGE(Qt5WinExtras)
SET(QT_LIBRARIES Qt5::WinExtras ${QT_LIBRARIES})
ENDIF()
# uncomment this line if you want to update original translations
# QT5_CREATE_TRANSLATION(CLIENT_INSTALL_Q ${CLIENT_INSTALL_UIS} ${SRC} ${CLIENT_INSTALL_TRANS} OPTIONS -I ${CMAKE_CURRENT_SOURCE_DIR})
QT5_ADD_TRANSLATION(CLIENT_INSTALL_QM ${CLIENT_INSTALL_TRANS} ${CLIENT_INSTALL_BASE_TRANS})
QT5_ADD_RESOURCES(CLIENT_INSTALL_RC_SRCS ${CLIENT_INSTALL_RCS})
QT5_WRAP_CPP(CLIENT_INSTALL_MOC_SRC ${CLIENT_INSTALL_HDR})
QT5_WRAP_UI(CLIENT_INSTALL_UI_HDRS ${CLIENT_INSTALL_UIS})
ENDIF()
SOURCE_GROUP("Source" FILES ${SRC})
SOURCE_GROUP("Resources" FILES ${CLIENT_INSTALL_RCS})
SOURCE_GROUP("Forms" FILES ${CLIENT_INSTALL_UIS})
SOURCE_GROUP("Generated Files" FILES ${CLIENT_INSTALL_UI_HDRS} ${CLIENT_INSTALL_MOC_SRC} ${CLIENT_INSTALL_RC_SRCS})
SOURCE_GROUP("Translation Files" FILES ${CLIENT_INSTALL_TRANS} ${CLIENT_INSTALL_BASE_TRANS})
# on Mac, create a .app Bundle
if(APPLE)
SET(MACOSX_BUNDLE_INFO_STRING "Ryzom Installer")
SET(MACOSX_BUNDLE_ICON_FILE "ryzom.icns")
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "com.winchgate.RyzomInstaller")
SET(MACOSX_BUNDLE_LONG_VERSION_STRING ${RYZOM_VERSION})
SET(MACOSX_BUNDLE_BUNDLE_NAME "Ryzom Installer")
SET(MACOSX_BUNDLE_SHORT_VERSION_STRING ${RYZOM_VERSION})
SET(MACOSX_BUNDLE_BUNDLE_VERSION "1.0")
SET(MACOSX_BUNDLE_COPYRIGHT ${COPYRIGHT})
SET(RYZOM_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${MACOSX_BUNDLE_BUNDLE_NAME}.app)
SET(RYZOM_CONTENTS_DIR ${RYZOM_OUTPUT_DIR}/Contents)
SET(RYZOM_RESOURCES_DIR ${RYZOM_CONTENTS_DIR}/Resources)
SET(MAC_RESOURCES_DIR ${CMAKE_SOURCE_DIR}/ryzom/client/macosx)
ENDIF()
ADD_EXECUTABLE(ryzom_installer_qt WIN32 MACOSX_BUNDLE ${SRC} ${CLIENT_INSTALL_MOC_SRC} ${CLIENT_INSTALL_UI_HDRS} ${CLIENT_INSTALL_RC_SRCS} ${CLIENT_INSTALL_TRANS} ${CLIENT_INSTALL_BASE_TRANS} ${CLIENT_INSTALL_QM})
IF(APPLE)
SET_TARGET_PROPERTIES(ryzom_installer_qt PROPERTIES OUTPUT_NAME ${MACOSX_BUNDLE_BUNDLE_NAME})
SET_TARGET_PROPERTIES(ryzom_installer_qt PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${MAC_RESOURCES_DIR}/Info.plist)
ADD_CUSTOM_COMMAND(TARGET ryzom_installer_qt PRE_BUILD COMMAND mkdir -p ${RYZOM_RESOURCES_DIR})
ADD_CUSTOM_COMMAND(TARGET ryzom_installer_qt POST_BUILD COMMAND cp ARGS -p ${MAC_RESOURCES_DIR}/PkgInfo ${RYZOM_CONTENTS_DIR})
ADD_CUSTOM_COMMAND(TARGET ryzom_installer_qt POST_BUILD COMMAND cp ARGS -p ${MAC_RESOURCES_DIR}/ryzom.icns ${RYZOM_RESOURCES_DIR})
IF(CODESIGN_ALLOCATE AND APPLE_CERTIFICATE)
ADD_CUSTOM_COMMAND(TARGET ryzom_installer_qt POST_BUILD COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign -fs "${APPLE_CERTIFICATE}" "${RYZOM_OUTPUT_DIR}" COMMENT "Signing Ryzom Installer bundle...")
ENDIF()
ENDIF()
NL_DEFAULT_PROPS(ryzom_installer_qt "Ryzom, Tools: Ryzom Installer" )
NL_ADD_RUNTIME_FLAGS(ryzom_installer_qt)
NL_ADD_LIB_SUFFIX(ryzom_installer_qt)
TARGET_LINK_LIBRARIES(ryzom_installer_qt nelmisc ryzom_sevenzip ${QT_LIBRARIES})
IF(WIN32)
TARGET_LINK_LIBRARIES(ryzom_installer_qt nelmisc ${WINSDK_LIBRARY_DIR}/Version.lib)
ENDIF()
IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(ryzom_installer_qt ${CMAKE_CURRENT_SOURCE_DIR}/src/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/src/stdpch.cpp)
ENDIF()
INSTALL(TARGETS ryzom_installer_qt RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client BUNDLE DESTINATION /Applications)
IF(UNIX AND NOT APPLE)
INSTALL(FILES res/ryzom_installer.png DESTINATION ${RYZOM_SHARE_PREFIX} COMPONENT client)
ENDIF()