Add CMake variable for PUBLIC_RELEASE

This commit is contained in:
Jack Andersen 2019-06-12 11:21:41 -10:00
parent e6a1837450
commit 741185e8d6
2 changed files with 9 additions and 1 deletions

View File

@ -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.")

View File

@ -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()