From 741185e8d695c5bc86b7efbfadaf4e5dcd67d4d9 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Wed, 12 Jun 2019 11:21:41 -1000 Subject: [PATCH] Add CMake variable for PUBLIC_RELEASE --- CMakeLists.txt | 6 ++++++ src/Editor/CMakeLists.txt | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ad3d2c7..92bf071c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,12 @@ endif() project(PrimeWorldEditor CXX) +option(PWE_PUBLIC_RELEASE "Enable end-user deployment configuration for PWE" OFF) +if (PWE_PUBLIC_RELEASE) + add_compile_definitions(PUBLIC_RELEASE=1) + message(STATUS "Enabled public release mode") +endif() + # Ensure submodules checked out if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/externals/LibCommon/CMakeLists.txt) message(FATAL_ERROR "Please run 'git submodules update --init --recursive' to fetch submodules.") diff --git a/src/Editor/CMakeLists.txt b/src/Editor/CMakeLists.txt index fc9ced18..0fd3e387 100644 --- a/src/Editor/CMakeLists.txt +++ b/src/Editor/CMakeLists.txt @@ -119,7 +119,6 @@ target_compile_definitions( PRIVATE "APP_NAME=\"${PWE_APP_NAME}\"" "APP_VERSION=\"${PROJECT_VERSION}\"" - "PUBLIC_RELEASE=1" "APP_FULL_NAME=\"${PWE_APP_NAME} ${PWE_WC_DESCRIBE}\"" UNICODE ) @@ -148,6 +147,9 @@ if (WIN32 OR APPLE) set(CPACK_SYSTEM_NAME macOS) set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF) endif() + if (CMAKE_BUILD_TYPE STREQUAL Debug) + set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME}-debug) + endif() include(CPack) endif()