diff --git a/CMakeLists.txt b/CMakeLists.txt index 73ac6a37c..69c7134da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,15 +99,37 @@ CMAKE_DEPENDENT_OPTION(VNC "VNC renderer" ON "DEV_BRANCH" OFF) CMAKE_DEPENDENT_OPTION(XL24 "ATI VGA Wonder XL24 (ATI-28800-6)" ON "DEV_BRANCH" OFF) CMAKE_DEPENDENT_OPTION(VECT486VL "HP Vectra 486VL" ON "DEV_BRANCH" OFF) +# Determine the build type +set(RELEASE_BUILD OFF) +set(BETA_BUILD OFF) +set(ALPHA_BUILD OFF) + string(TOLOWER "${BUILD_TYPE}" BUILD_TYPE_LOWER) if(BUILD_TYPE_LOWER STREQUAL "release") + # Release build + set(RELEASE_BUILD ON) add_compile_definitions(RELEASE_BUILD) elseif(BUILD_TYPE_LOWER STREQUAL "beta") + # Beta build + set(BETA_BUILD ON) add_compile_definitions(BETA_BUILD) elseif(BUILD_TYPE_LOWER STREQUAL "alpha") + # Alpha build + set(ALPHA_BUILD ON) add_compile_definitions(ALPHA_BUILD) endif() +# Variables introduced by richardg867 for versioning stuff +if(NOT CMAKE_PROJECT_VERSION_PATCH) + set(CMAKE_PROJECT_VERSION_PATCH 0) +endif() +if(NOT EMU_BUILD_NUM) + set(EMU_BUILD_NUM 0) +endif() +if(NOT EMU_COPYRIGHT_YEAR) + set(EMU_COPYRIGHT_YEAR 2021) +endif() + # HACK: Avoid a MSVC2019 compiler bug on ARM64 Debug builds if(MSVC_TOOLSET_VERSION GREATER_EQUAL 142 AND ARCH STREQUAL "arm64") # Define a cache option in case somebody wants to disable this workaround diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3fb0c229f..4bdb5a15a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -69,24 +69,13 @@ if(MINGW) set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".dll.a") endif() -# Variables introduced by richardg867 for versioning stuff -if(NOT CMAKE_PROJECT_VERSION_PATCH) - set(CMAKE_PROJECT_VERSION_PATCH 0) -endif() -if(NOT EMU_BUILD_NUM) - set(EMU_BUILD_NUM 0) -endif() -if(NOT EMU_COPYRIGHT_YEAR) - set(EMU_COPYRIGHT_YEAR 2021) -endif() - #some macOS specific configuration steps if(APPLE) -# Force using the newest library if it's installed by homebrew - set(CMAKE_FIND_FRAMEWORK LAST) - - # setting our compilation target to macOS 10.13 High Sierra - set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13") + # Force using the newest library if it's installed by homebrew + set(CMAKE_FIND_FRAMEWORK LAST) + + # setting our compilation target to macOS 10.13 High Sierra + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13") endif() find_package(Freetype REQUIRED) @@ -107,10 +96,10 @@ elseif(WIN32) target_link_libraries(86Box SDL2::SDL2) else() if (TARGET SDL2::SDL2) - target_link_libraries(86Box SDL2::SDL2) - else() - target_link_libraries(86Box ${SDL2_LIBRARIES}) - endif() + target_link_libraries(86Box SDL2::SDL2) +else() + target_link_libraries(86Box ${SDL2_LIBRARIES}) +endif() endif() find_package(PNG REQUIRED) @@ -168,10 +157,10 @@ endif() if(APPLE) set(APPS ${CMAKE_CURRENT_BINARY_DIR}/86Box.app) install(CODE " - include(BundleUtilities) + include(BundleUtilities) get_filename_component(CMAKE_INSTALL_PREFIX_ABSOLUTE \${CMAKE_INSTALL_PREFIX} ABSOLUTE) fixup_bundle(\"\${CMAKE_INSTALL_PREFIX_ABSOLUTE}/bin/86Box.app\" \"\" \"\")" - COMPONENT Runtime) + COMPONENT Runtime) endif() if(VCPKG_TOOLCHAIN)