diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2024-07-03 10:19:36 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2024-07-03 10:19:36 +0200 |
commit | b6bd52cd7330a90fc0e44dbe6022551a8dd768a1 (patch) | |
tree | 9804282102f8c40d27407b9c94119b35eeb5013c /PlatformSettings.cmake | |
parent | c9d0740841fbe0539e42e66d3865672bfcd3ac02 (diff) | |
parent | a14a7a0ccc9de76aeab0b2e4bbf58f1a79deedc2 (diff) |
Update upstream source from tag 'upstream/5.3.0GA'
Update to upstream version '5.3.0GA'
with Debian dir dfd14d63b0238e276ade6f54dd9100325df5b2f9
Diffstat (limited to 'PlatformSettings.cmake')
-rw-r--r-- | PlatformSettings.cmake | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/PlatformSettings.cmake b/PlatformSettings.cmake new file mode 100644 index 0000000..272af37 --- /dev/null +++ b/PlatformSettings.cmake @@ -0,0 +1,61 @@ +# Configure the platform specific settings
+#
+# Setup high-level build options ...
+if(UNIX)
+ include(FindPkgConfig)
+ set(XTRKCAD_USE_GTK_DEFAULT ON)
+
+ # Configure help display and i18n
+ if(APPLE)
+ set(CMAKE_MACOSX_RPATH 0)
+ set(XTRKCAD_USE_GETTEXT_DEFAULT OFF)
+ set(XTRKCAD_USE_APPLEHELP_DEFAULT ON)
+ set(CMAKE_FIND_APPBUNDLE LAST)
+ pkg_check_modules(GTK_WEBKIT "webkit-1.0" QUIET)
+ if(GTK_WEBKIT_FOUND)
+ set(XTRKCAD_USE_BROWSER_DEFAULT OFF)
+ else()
+ set(XTRKCAD_USE_BROWSER_DEFAULT ON)
+ endif()
+ else()
+ set(XTRKCAD_USE_GETTEXT_DEFAULT ON)
+ set(XTRKCAD_USE_BROWSER_DEFAULT ON)
+ add_compile_options("-pthread")
+ add_link_options("-pthread")
+ endif()
+
+ # glib 2.0 deprecated GTypeDebugFlags and GTimeVal, gtk2 has not been updated
+ add_compile_options("-Wno-deprecated-declarations")
+endif()
+
+# Set Win64 flag when a 64 bit build is selected
+if(WIN32)
+ set(XTRKCAD_USE_GETTEXT_DEFAULT ON)
+ set(XTRKCAD_USE_GTK_DEFAULT OFF)
+
+ # determine processor target architecture
+ if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(Win64Bit ON CACHE BOOL "Target Architecture: x64")
+ else ()
+ set(Win64Bit OFF CACHE BOOL "Target Architecture: x86")
+ endif ()
+
+ mark_as_advanced(Win64Bit)
+
+ if (Win64Bit)
+ set(XTRKCAD_ARCH_SUBDIR "x64")
+ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ set(CMAKE_INSTALL_PREFIX "C:/Program Files/XTrkCAD" CACHE PATH "WIN64 Install" FORCE)
+ endif()
+ else ()
+ set( XTRKCAD_ARCH_SUBDIR "x86")
+ endif ()
+
+ set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1" CACHE STRING "Flags used by the compiler during debug builds" FORCE)
+ set(CMAKE_C_FLAGS_MINSIZEREL "/MD /O1 /Ob1 /D NDEBUG" CACHE STRING "Flags used by the compiler during release minumum size builds" FORCE)
+ set(CMAKE_C_FLAGS_RELEASE "/MD /O2 /Ob2 /D NDEBUG" CACHE STRING "Flags used by the compiler during release builds" FORCE)
+ set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MDd /Zi /O2 /Ob1 /D NDEBUG" CACHE STRING "Flags used by the compiler during release with debug info builds" FORCE)
+
+ add_definitions(-DWINDOWS)
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+endif()
|