2011-02-20 13:31:49 +00:00
|
|
|
|
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2010 Kitware, Inc.
|
|
|
|
#
|
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
|
|
|
# License text for the above reference.)
|
|
|
|
|
|
|
|
# support for the nasm assembler
|
|
|
|
|
|
|
|
set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS nasm asm)
|
|
|
|
|
|
|
|
if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
|
|
|
|
if(WIN32)
|
|
|
|
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
|
|
|
SET(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
|
|
|
|
else()
|
|
|
|
SET(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
|
|
|
|
endif()
|
|
|
|
elseif(APPLE)
|
more minor improvements for OS X build
Add Homebrew and MacPorts paths for findings headers and libraries.
Add -x objective-c++ to the C++ compile command so that conditionally
compiled ObjectiveC code for OS X can be supported.
Throw a fatal error if the user tries to enable ENABLE_ASM_CORE,
ENABLE_ASM_SCALERS or ENABLE_MMX on AMD64, as this is not supported yet.
If ENABLE_ASM_SCALERS is enabled, try to find a Homebrew or MacPorts
nasm before using the outdated XCode nasm.
For the future, if the user has only the old XCode nasm which does not
support 64 bit objects and the build is 64 bit, throw a fatal error.
For 32 bit builds with the old XCode nasm, use -f macho instead of -f
macho32, which is used if the version of nasm is > 2.0 .
Pass -DMACHO instead of -DELF and, on AMD64 (for the future) -D__AMD64__
for nasm on OS X.
Pass -D__AMD64__ to C++ compilation as well on AMD64, this will help
when we support AMD64 inline assembly.
Add support for automatically linking Homebrew keg-only gettext from
/usr/local/opt/gettext for ENABLE_NLS.
Fix copying Info.plist and vbam.icns to the .app bundle.
Add a key to the Info.plist to support sharp text on retina displays, as
per:
https://wiki.wxwidgets.org/WxMac-specific_topics#Retina_display_support
Set wxWidgets_USE_DEBUG to ON if CMAKE_BUILD_TYPE is "Debug". I'm not
sure this does anything or if I'm doing this correctly though.
Also set wxWidgets_USE_UNICODE to ON. Again, I'm not sure this does
anything or is in the right place.
Fix a bug in the config dir finding code in
wxvbamApp::GetConfigurationPath() updated in 8b8f2f7 to only use the
more top level dirs if there is a vbam.ini in them, not if they are
writable as well, and use the reverse order (starting with user local
dirs) to check for writable dirs and their writable parents. This fixes
a problem with the vbam.ini being written to the Plugins directory of
the .app bundle if it's writable instead of ~/Library/Application
Support/vbam as was intended.
2015-11-17 02:56:23 +00:00
|
|
|
EXECUTE_PROCESS(COMMAND ${CMAKE_ASM_NASM_COMPILER} -v COMMAND awk "{print \$3}" OUTPUT_VARIABLE NASM_VERSION)
|
|
|
|
IF(NASM_VERSION VERSION_LESS 2.0)
|
|
|
|
IF(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
|
|
|
MESSAGE(FATAL_ERROR "Your nasm is too old to support AMD64, please install nasm from Homebrew or MacPorts.")
|
|
|
|
ENDIF()
|
|
|
|
SET(CMAKE_ASM_NAMS_OBJECT_FORMAT macho)
|
|
|
|
ELSE()
|
|
|
|
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
|
|
|
SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
|
|
|
|
else()
|
|
|
|
SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho32)
|
|
|
|
endif()
|
|
|
|
ENDIF()
|
2011-02-20 13:31:49 +00:00
|
|
|
else()
|
|
|
|
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
|
|
|
SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
|
|
|
|
else()
|
|
|
|
SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf32)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2016-11-20 19:11:52 +00:00
|
|
|
set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>")
|
2011-02-20 13:31:49 +00:00
|
|
|
|
|
|
|
# Load the generic ASMInformation file:
|
|
|
|
set(ASM_DIALECT "_NASM")
|
|
|
|
include(CMakeASMInformation)
|
|
|
|
set(ASM_DIALECT)
|