C Make Lists
C Make Lists
C Make Lists
1)
if(WIN32)
# In Qt 5.1+ we have our own main() function, don't autolink to qtmain on
Windows
cmake_policy(SET CMP0020 OLD)
endif()
project(Launcher)
enable_testing()
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
# Output all executables and shared libs in the main build folder, not in
subfolders.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
if(UNIX)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
endif()
set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${PROJECT_BINARY_DIR}/jars)
# Build number
set(Launcher_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number.")
# Build platform.
set(Launcher_BUILD_PLATFORM "" CACHE STRING "A short string identifying the
platform that this build was built for. Only used by the notification system and to
display in the about dialog.")
# Notification URL
set(Launcher_NOTIFICATION_URL "" CACHE STRING "URL for checking for
notifications.")
# Google analytics ID
set(Launcher_ANALYTICS_ID "UA-87731965-2" CACHE STRING "ID you can get from Google
analytics")
# Bug tracker URL
set(Launcher_BUG_TRACKER_URL "" CACHE STRING "URL for the bug tracker.")
# Discord URL
set(Launcher_DISCORD_URL "" CACHE STRING "URL for the Discord guild.")
# Subreddit URL
set(Launcher_SUBREDDIT_URL "" CACHE STRING "URL for the subreddit.")
set(Launcher_RELEASE_VERSION_NAME "${Launcher_VERSION_MAJOR}.$
{Launcher_VERSION_MINOR}.${Launcher_VERSION_HOTFIX}")
# The Qt5 cmake files don't provide its install paths, so ask qmake.
include(QMakeQuery)
query_qmake(QT_INSTALL_PLUGINS QT_PLUGINS_DIR)
query_qmake(QT_INSTALL_IMPORTS QT_IMPORTS_DIR)
query_qmake(QT_INSTALL_LIBS QT_LIBS_DIR)
query_qmake(QT_INSTALL_LIBEXECS QT_LIBEXECS_DIR)
query_qmake(QT_HOST_DATA QT_DATA_DIR)
set(QT_MKSPECS_DIR ${QT_DATA_DIR}/mkspecs)
if (Qt5_POSITION_INDEPENDENT_CODE)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
####################################### Secrets
#######################################
if(Launcher_EMBED_SECRETS)
add_subdirectory(secrets)
else()
add_subdirectory(notsecrets)
endif()
set(BUNDLE_DEST_DIR ".")
# Apps to bundle
set(APPS "\${CMAKE_INSTALL_PREFIX}/${Launcher_Name}.app")
# install as bundle
set(INSTALL_BUNDLE "full")
# Add the icon
install(FILES ${Launcher_Branding_ICNS} DESTINATION ${RESOURCES_DEST_DIR}
RENAME ${Launcher_Name}.icns)
# Set RPATH
SET(Launcher_BINARY_RPATH "$ORIGIN/")
# Apps to bundle
set(APPS "\${CMAKE_INSTALL_PREFIX}/${Launcher_Name}.exe")
# install as bundle
set(INSTALL_BUNDLE "full")
else()
message(FATAL_ERROR "No sensible install layout set.")
endif()
include(ExternalProject)
set_directory_properties(PROPERTIES EP_BASE External)
add_subdirectory(buildconfig)
# NOTE: this must always be last to appease the CMake deity of quirky install
command evaluation order.
add_subdirectory(launcher)