summaryrefslogtreecommitdiff
path: root/graphics/asymptote/cmake-scripts/asy-macro.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/cmake-scripts/asy-macro.cmake')
-rw-r--r--graphics/asymptote/cmake-scripts/asy-macro.cmake50
1 files changed, 50 insertions, 0 deletions
diff --git a/graphics/asymptote/cmake-scripts/asy-macro.cmake b/graphics/asymptote/cmake-scripts/asy-macro.cmake
new file mode 100644
index 0000000000..e21af7d406
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/asy-macro.cmake
@@ -0,0 +1,50 @@
+if (NOT ASY_VERSION_OVERRIDE)
+if (ASY_ADDR_VERSION_SUFFIX_FILE STREQUAL "NOTFOUND")
+ if (CMAKE_BUILD_TYPE IN_LIST cmake_debug_build_types)
+ set(ASY_VERSION_SUFFIX "+debug")
+ endif()
+endif()
+
+set(ASY_VERSION "${ASY_VERSION_BASE}${ASY_VERSION_SUFFIX}")
+else()
+ message(STATUS "Override version specified")
+ set(ASY_VERSION ${ASY_VERSION_OVERRIDE})
+endif()
+
+message(STATUS "Asymptote version: ${ASY_VERSION}")
+
+
+list(APPEND ASY_MACROS
+ PACKAGE_NAME="${ASY_PACKAGE_NAME}"
+ PACKAGE_VERSION="${ASY_VERSION}"
+ PACKAGE_BUGREPORT="${ASY_BUGREPORT}"
+ PACKAGE_STRING="${ASY_PACKAGE_NAME} ${ASY_VERSION}"
+)
+
+# Since we require C++11 and up, some macros are automatically included
+list(APPEND ASY_MACROS
+ HAVE_UNORDERED_MAP
+ HAVE_STRFTIME
+ _USE_MATH_DEFINES
+)
+
+if (DEBUG_GC_ENABLE)
+ list(APPEND ASY_MACROS GC_DEBUG)
+endif()
+
+if (DEBUG_GC_BACKTRACE_ENABLE)
+ list(APPEND ASY_MACROS GC_BACKTRACE)
+endif()
+
+
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ list(APPEND ASY_MACROS LINUX_SYSTEM)
+endif()
+
+if (CMAKE_BUILD_TYPE IN_LIST cmake_debug_build_types)
+ list(APPEND ASY_MACROS DEBUG)
+endif()
+
+if (CTAN_BUILD)
+ list(APPEND ASY_MACROS CTAN_BUILD)
+endif()