Use lower case cmake function names
This commit is contained in:
parent
3b8761a18c
commit
67515e27f9
6 changed files with 240 additions and 240 deletions
|
@ -1,46 +1,46 @@
|
|||
SET(CMAKE_D_COMPILER "@CMAKE_D_COMPILER@")
|
||||
SET(CMAKE_D_COMPILER_ARG1 "@CMAKE_D_COMPILER_ARG1@")
|
||||
SET(CMAKE_D_COMPILER_ID "@CMAKE_D_COMPILER_ID@")
|
||||
SET(CMAKE_D_PLATFORM_ID "@CMAKE_D_PLATFORM_ID@")
|
||||
set(CMAKE_D_COMPILER "@CMAKE_D_COMPILER@")
|
||||
set(CMAKE_D_COMPILER_ARG1 "@CMAKE_D_COMPILER_ARG1@")
|
||||
set(CMAKE_D_COMPILER_ID "@CMAKE_D_COMPILER_ID@")
|
||||
set(CMAKE_D_PLATFORM_ID "@CMAKE_D_PLATFORM_ID@")
|
||||
@SET_MSVC_D_ARCHITECTURE_ID@
|
||||
SET(CMAKE_AR "@CMAKE_AR@")
|
||||
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
||||
SET(CMAKE_LINKER "@CMAKE_LINKER@")
|
||||
SET(CMAKE_COMPILER_IS_GDC @CMAKE_COMPILER_IS_GDC@)
|
||||
SET(CMAKE_COMPILER_IS_DMD @CMAKE_COMPILER_IS_DMD@)
|
||||
SET(CMAKE_D_COMPILER_LOADED 1)
|
||||
SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
|
||||
SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
|
||||
IF(CMAKE_COMPILER_IS_CYGWIN)
|
||||
SET(CYGWIN 1)
|
||||
SET(UNIX 1)
|
||||
ENDIF(CMAKE_COMPILER_IS_CYGWIN)
|
||||
set(CMAKE_AR "@CMAKE_AR@")
|
||||
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
||||
set(CMAKE_LINKER "@CMAKE_LINKER@")
|
||||
set(CMAKE_COMPILER_IS_GDC @CMAKE_COMPILER_IS_GDC@)
|
||||
set(CMAKE_COMPILER_IS_DMD @CMAKE_COMPILER_IS_DMD@)
|
||||
set(CMAKE_D_COMPILER_LOADED 1)
|
||||
set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
|
||||
set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
|
||||
if(CMAKE_COMPILER_IS_CYGWIN)
|
||||
set(CYGWIN 1)
|
||||
set(UNIX 1)
|
||||
endif(CMAKE_COMPILER_IS_CYGWIN)
|
||||
|
||||
SET(CMAKE_D_COMPILER_ENV_VAR "DC")
|
||||
set(CMAKE_D_COMPILER_ENV_VAR "DC")
|
||||
|
||||
IF(CMAKE_COMPILER_IS_MINGW)
|
||||
SET(MINGW 1)
|
||||
ENDIF(CMAKE_COMPILER_IS_MINGW)
|
||||
SET(CMAKE_D_SOURCE_FILE_EXTENSIONS d;di)
|
||||
SET(CMAKE_D_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||
if(CMAKE_COMPILER_IS_MINGW)
|
||||
set(MINGW 1)
|
||||
endif(CMAKE_COMPILER_IS_MINGW)
|
||||
set(CMAKE_D_SOURCE_FILE_EXTENSIONS d;di)
|
||||
set(CMAKE_D_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||
# Prefer to use D's linker.
|
||||
# The D value 40 beats CXX value of 30 and C value of 10
|
||||
SET(CMAKE_D_LINKER_PREFERENCE 40 )
|
||||
SET(CMAKE_D_LINKER_PREFERENCE_PROPOGATES 1 )
|
||||
set(CMAKE_D_LINKER_PREFERENCE 40 )
|
||||
set(CMAKE_D_LINKER_PREFERENCE_PROPOGATES 1 )
|
||||
# Save compiler ABI information.
|
||||
SET(CMAKE_D_SIZEOF_DATA_PTR "@CMAKE_D_SIZEOF_DATA_PTR@")
|
||||
SET(CMAKE_D_COMPILER_ABI "@CMAKE_D_COMPILER_ABI@")
|
||||
set(CMAKE_D_SIZEOF_DATA_PTR "@CMAKE_D_SIZEOF_DATA_PTR@")
|
||||
set(CMAKE_D_COMPILER_ABI "@CMAKE_D_COMPILER_ABI@")
|
||||
|
||||
IF(CMAKE_D_SIZEOF_DATA_PTR)
|
||||
SET(CMAKE_SIZEOF_VOID_P "${CMAKE_D_SIZEOF_DATA_PTR}")
|
||||
ENDIF(CMAKE_D_SIZEOF_DATA_PTR)
|
||||
if(CMAKE_D_SIZEOF_DATA_PTR)
|
||||
set(CMAKE_SIZEOF_VOID_P "${CMAKE_D_SIZEOF_DATA_PTR}")
|
||||
endif(CMAKE_D_SIZEOF_DATA_PTR)
|
||||
|
||||
IF(CMAKE_D_COMPILER_ABI)
|
||||
SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_D_COMPILER_ABI}")
|
||||
ENDIF(CMAKE_D_COMPILER_ABI)
|
||||
if(CMAKE_D_COMPILER_ABI)
|
||||
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_D_COMPILER_ABI}")
|
||||
endif(CMAKE_D_COMPILER_ABI)
|
||||
|
||||
SET(CMAKE_D_HAS_ISYSROOT "@CMAKE_D_HAS_ISYSROOT@")
|
||||
set(CMAKE_D_HAS_ISYSROOT "@CMAKE_D_HAS_ISYSROOT@")
|
||||
@CMAKE_D_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
|
||||
|
||||
SET(CMAKE_D_IMPLICIT_LINK_LIBRARIES "@CMAKE_D_IMPLICIT_LINK_LIBRARIES@")
|
||||
SET(CMAKE_D_IMPLICIT_LINK_DIRECTORIES "@CMAKE_D_IMPLICIT_LINK_DIRECTORIES@")
|
||||
set(CMAKE_D_IMPLICIT_LINK_LIBRARIES "@CMAKE_D_IMPLICIT_LINK_LIBRARIES@")
|
||||
set(CMAKE_D_IMPLICIT_LINK_DIRECTORIES "@CMAKE_D_IMPLICIT_LINK_DIRECTORIES@")
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
int main( string[] args )
|
||||
int main(string[] args)
|
||||
{
|
||||
int require = 0;
|
||||
return require;
|
||||
int require = 0;
|
||||
return require;
|
||||
}
|
||||
|
|
|
@ -22,52 +22,52 @@
|
|||
|
||||
# Load compiler-specific information.
|
||||
|
||||
SET( _INCLUDED_FILE 0 ) # reset the indicator if an include occurred.
|
||||
set(_INCLUDED_FILE 0) # reset the indicator if an include occurred.
|
||||
|
||||
IF(CMAKE_D_COMPILER_ID)
|
||||
INCLUDE(Compiler/${CMAKE_D_COMPILER_ID}-D OPTIONAL)
|
||||
ENDIF(CMAKE_D_COMPILER_ID)
|
||||
if(CMAKE_D_COMPILER_ID)
|
||||
include(Compiler/${CMAKE_D_COMPILER_ID}-D OPTIONAL)
|
||||
endif(CMAKE_D_COMPILER_ID)
|
||||
|
||||
# SET(CMAKE_D_OUTPUT_EXTENSION .o)
|
||||
SET(CMAKE_C_OUTPUT_EXTENSION_REPLACE TRUE )
|
||||
SET(CMAKE_D_OUTPUT_EXTENSION_REPLACE TRUE )
|
||||
# set(CMAKE_D_OUTPUT_EXTENSION .o)
|
||||
set(CMAKE_C_OUTPUT_EXTENSION_REPLACE TRUE )
|
||||
set(CMAKE_D_OUTPUT_EXTENSION_REPLACE TRUE )
|
||||
|
||||
SET(CMAKE_BASE_NAME)
|
||||
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_D_COMPILER} NAME_WE)
|
||||
set(CMAKE_BASE_NAME)
|
||||
get_filename_component(CMAKE_BASE_NAME ${CMAKE_D_COMPILER} NAME_WE)
|
||||
|
||||
SET( _INCLUDED_FILE 0 ) # reset the indicator if an include occurred.
|
||||
set(_INCLUDED_FILE 0) # reset the indicator if an include occurred.
|
||||
|
||||
# load a hardware specific file, mostly useful for embedded compilers
|
||||
IF(CMAKE_SYSTEM_PROCESSOR)
|
||||
IF(CMAKE_D_COMPILER_ID)
|
||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_D_COMPILER_ID}-D-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||
ENDIF(CMAKE_D_COMPILER_ID)
|
||||
IF (NOT _INCLUDED_FILE)
|
||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
|
||||
ENDIF (NOT _INCLUDED_FILE)
|
||||
ENDIF(CMAKE_SYSTEM_PROCESSOR)
|
||||
if(CMAKE_SYSTEM_PROCESSOR)
|
||||
if(CMAKE_D_COMPILER_ID)
|
||||
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_D_COMPILER_ID}-D-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||
endif(CMAKE_D_COMPILER_ID)
|
||||
if(NOT _INCLUDED_FILE)
|
||||
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
|
||||
endif(NOT _INCLUDED_FILE)
|
||||
endif(CMAKE_SYSTEM_PROCESSOR)
|
||||
|
||||
SET( _INCLUDED_FILE 0 ) # reset the indicator if an include occurred.
|
||||
set(_INCLUDED_FILE 0) # reset the indicator if an include occurred.
|
||||
|
||||
# load the system- and compiler specific files
|
||||
IF(CMAKE_D_COMPILER_ID)
|
||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_D_COMPILER_ID}-D
|
||||
if(CMAKE_D_COMPILER_ID)
|
||||
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_D_COMPILER_ID}-D
|
||||
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||
ENDIF(CMAKE_D_COMPILER_ID)
|
||||
endif(CMAKE_D_COMPILER_ID)
|
||||
|
||||
# if no high specificity file was included, then try a more general one
|
||||
IF (NOT _INCLUDED_FILE)
|
||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
|
||||
if(NOT _INCLUDED_FILE)
|
||||
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
|
||||
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||
ENDIF (NOT _INCLUDED_FILE)
|
||||
endif(NOT _INCLUDED_FILE)
|
||||
|
||||
# We specify the compiler information in the system file for some
|
||||
# platforms, but this language may not have been enabled when the file
|
||||
# was first included. Include it again to get the language info.
|
||||
# Remove this when all compiler info is removed from system files.
|
||||
IF (NOT _INCLUDED_FILE)
|
||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
|
||||
ENDIF (NOT _INCLUDED_FILE)
|
||||
if(NOT _INCLUDED_FILE)
|
||||
include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
|
||||
endif(NOT _INCLUDED_FILE)
|
||||
|
||||
|
||||
# This should be included before the _INIT variables are
|
||||
|
@ -76,53 +76,53 @@ ENDIF (NOT _INCLUDED_FILE)
|
|||
# But, it should still be after the platform file so changes can
|
||||
# be made to those values.
|
||||
|
||||
IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
||||
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE})
|
||||
ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
||||
if(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
||||
include(${CMAKE_USER_MAKE_RULES_OVERRIDE})
|
||||
endif(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
||||
|
||||
IF(CMAKE_USER_MAKE_RULES_OVERRIDE_D)
|
||||
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_D})
|
||||
ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE_D)
|
||||
if(CMAKE_USER_MAKE_RULES_OVERRIDE_D)
|
||||
include(${CMAKE_USER_MAKE_RULES_OVERRIDE_D})
|
||||
endif(CMAKE_USER_MAKE_RULES_OVERRIDE_D)
|
||||
|
||||
# for most systems a module is the same as a shared library
|
||||
# so unless the variable CMAKE_MODULE_EXISTS is set just
|
||||
# copy the values from the LIBRARY variables
|
||||
IF(NOT CMAKE_MODULE_EXISTS)
|
||||
SET(CMAKE_SHARED_MODULE_D_FLAGS ${CMAKE_SHARED_LIBRARY_D_FLAGS})
|
||||
SET(CMAKE_SHARED_MODULE_CREATE_D_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_D_FLAGS})
|
||||
ENDIF(NOT CMAKE_MODULE_EXISTS)
|
||||
if(NOT CMAKE_MODULE_EXISTS)
|
||||
set(CMAKE_SHARED_MODULE_D_FLAGS ${CMAKE_SHARED_LIBRARY_D_FLAGS})
|
||||
set(CMAKE_SHARED_MODULE_CREATE_D_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_D_FLAGS})
|
||||
endif(NOT CMAKE_MODULE_EXISTS)
|
||||
|
||||
SET(CMAKE_D_FLAGS_INIT "$ENV{DFLAGS} ${CMAKE_D_FLAGS_INIT}")
|
||||
set(CMAKE_D_FLAGS_INIT "$ENV{DFLAGS} ${CMAKE_D_FLAGS_INIT}")
|
||||
# avoid just having a space as the initial value for the cache
|
||||
IF(CMAKE_D_FLAGS_INIT STREQUAL " ")
|
||||
SET(CMAKE_D_FLAGS_INIT)
|
||||
ENDIF(CMAKE_D_FLAGS_INIT STREQUAL " ")
|
||||
SET (CMAKE_D_FLAGS "${CMAKE_D_FLAGS_INIT}" CACHE STRING
|
||||
if(CMAKE_D_FLAGS_INIT STREQUAL " ")
|
||||
set(CMAKE_D_FLAGS_INIT)
|
||||
endif(CMAKE_D_FLAGS_INIT STREQUAL " ")
|
||||
set(CMAKE_D_FLAGS "${CMAKE_D_FLAGS_INIT}" CACHE STRING
|
||||
"Flags used by the D compiler during all build types.")
|
||||
|
||||
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||
# default build type is none
|
||||
IF(NOT CMAKE_NO_BUILD_TYPE)
|
||||
SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
|
||||
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||
# default build type is none
|
||||
if(NOT CMAKE_NO_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
|
||||
"Choose the type of build, options are: None(CMAKE_D_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
|
||||
ENDIF(NOT CMAKE_NO_BUILD_TYPE)
|
||||
SET (CMAKE_D_FLAGS_DEBUG "${CMAKE_D_FLAGS_DEBUG_INIT}" CACHE STRING
|
||||
endif(NOT CMAKE_NO_BUILD_TYPE)
|
||||
set(CMAKE_D_FLAGS_DEBUG "${CMAKE_D_FLAGS_DEBUG_INIT}" CACHE STRING
|
||||
"Flags used by the compiler during debug builds.")
|
||||
SET (CMAKE_D_FLAGS_MINSIZEREL "${CMAKE_D_FLAGS_MINSIZEREL_INIT}" CACHE STRING
|
||||
set(CMAKE_D_FLAGS_MINSIZEREL "${CMAKE_D_FLAGS_MINSIZEREL_INIT}" CACHE STRING
|
||||
"Flags used by the compiler during release minsize builds.")
|
||||
SET (CMAKE_D_FLAGS_RELEASE "${CMAKE_D_FLAGS_RELEASE_INIT}" CACHE STRING
|
||||
set(CMAKE_D_FLAGS_RELEASE "${CMAKE_D_FLAGS_RELEASE_INIT}" CACHE STRING
|
||||
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
|
||||
SET (CMAKE_D_FLAGS_RELWITHDEBINFO "${CMAKE_D_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
|
||||
set(CMAKE_D_FLAGS_RELWITHDEBINFO "${CMAKE_D_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
|
||||
"Flags used by the compiler during Release with Debug Info builds.")
|
||||
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||
endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||
|
||||
IF(CMAKE_D_STANDARD_LIBRARIES_INIT)
|
||||
SET(CMAKE_D_STANDARD_LIBRARIES "${CMAKE_D_STANDARD_LIBRARIES_INIT}"
|
||||
if(CMAKE_D_STANDARD_LIBRARIES_INIT)
|
||||
set(CMAKE_D_STANDARD_LIBRARIES "${CMAKE_D_STANDARD_LIBRARIES_INIT}"
|
||||
CACHE STRING "Libraries linked by default with all D applications.")
|
||||
MARK_AS_ADVANCED(CMAKE_D_STANDARD_LIBRARIES)
|
||||
ENDIF(CMAKE_D_STANDARD_LIBRARIES_INIT)
|
||||
mark_as_advanced(CMAKE_D_STANDARD_LIBRARIES)
|
||||
endif(CMAKE_D_STANDARD_LIBRARIES_INIT)
|
||||
|
||||
INCLUDE(CMakeCommonLanguageInclude)
|
||||
include(CMakeCommonLanguageInclude)
|
||||
|
||||
# now define the following rule variables
|
||||
|
||||
|
@ -153,54 +153,54 @@ INCLUDE(CMakeCommonLanguageInclude)
|
|||
|
||||
|
||||
# create a D shared library
|
||||
IF(NOT CMAKE_D_CREATE_SHARED_LIBRARY)
|
||||
SET(CMAKE_D_CREATE_SHARED_LIBRARY
|
||||
if(NOT CMAKE_D_CREATE_SHARED_LIBRARY)
|
||||
set(CMAKE_D_CREATE_SHARED_LIBRARY
|
||||
"<CMAKE_D_COMPILER> <CMAKE_SHARED_LIBRARY_D_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_D_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_D_FLAG><TARGET_SONAME> ${CMAKE_D_DASH_O}<TARGET> <OBJECTS> <LINK_LIBRARIES> ${DSTDLIB_FLAGS} ${CMAKE_D_STDLIBS}")
|
||||
ENDIF(NOT CMAKE_D_CREATE_SHARED_LIBRARY)
|
||||
endif(NOT CMAKE_D_CREATE_SHARED_LIBRARY)
|
||||
|
||||
# create a D shared module just copy the shared library rule
|
||||
IF(NOT CMAKE_D_CREATE_SHARED_MODULE)
|
||||
SET(CMAKE_D_CREATE_SHARED_MODULE ${CMAKE_D_CREATE_SHARED_LIBRARY})
|
||||
ENDIF(NOT CMAKE_D_CREATE_SHARED_MODULE)
|
||||
IF(NOT CMAKE_D_CREATE_STATIC_LIBRARY AND CMAKE_STATIC_LIBRARY_CREATE_D_FLAGS)
|
||||
SET(CMAKE_D_CREATE_STATIC_LIBRARY
|
||||
if(NOT CMAKE_D_CREATE_SHARED_MODULE)
|
||||
set(CMAKE_D_CREATE_SHARED_MODULE ${CMAKE_D_CREATE_SHARED_LIBRARY})
|
||||
endif(NOT CMAKE_D_CREATE_SHARED_MODULE)
|
||||
if(NOT CMAKE_D_CREATE_STATIC_LIBRARY AND CMAKE_STATIC_LIBRARY_CREATE_D_FLAGS)
|
||||
set(CMAKE_D_CREATE_STATIC_LIBRARY
|
||||
"<CMAKE_D_COMPILER> ${CMAKE_STATIC_LIBRARY_CREATE_D_FLAGS} <OBJECTS> ${CMAKE_D_DASH_O}<TARGET>")
|
||||
ENDIF(NOT CMAKE_D_CREATE_STATIC_LIBRARY AND CMAKE_STATIC_LIBRARY_CREATE_D_FLAGS)
|
||||
endif(NOT CMAKE_D_CREATE_STATIC_LIBRARY AND CMAKE_STATIC_LIBRARY_CREATE_D_FLAGS)
|
||||
|
||||
# Create a static archive incrementally for large object file counts.
|
||||
# If CMAKE_D_CREATE_STATIC_LIBRARY is set it will override these.
|
||||
SET(CMAKE_D_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
SET(CMAKE_D_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
SET(CMAKE_D_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
|
||||
set(CMAKE_D_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_D_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_D_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
|
||||
|
||||
# compile a D file into an object file
|
||||
IF(NOT CMAKE_D_COMPILE_OBJECT)
|
||||
SET(CMAKE_D_COMPILE_OBJECT
|
||||
if(NOT CMAKE_D_COMPILE_OBJECT)
|
||||
set(CMAKE_D_COMPILE_OBJECT
|
||||
"<CMAKE_D_COMPILER> <FLAGS> ${CMAKE_D_DASH_O}<OBJECT> -c <SOURCE>")
|
||||
ENDIF(NOT CMAKE_D_COMPILE_OBJECT)
|
||||
endif(NOT CMAKE_D_COMPILE_OBJECT)
|
||||
|
||||
IF(NOT CMAKE_D_LINK_EXECUTABLE)
|
||||
SET(CMAKE_D_LINK_EXECUTABLE
|
||||
if(NOT CMAKE_D_LINK_EXECUTABLE)
|
||||
set(CMAKE_D_LINK_EXECUTABLE
|
||||
"<CMAKE_D_COMPILER> <FLAGS> <CMAKE_D_LINK_FLAGS> <OBJECTS> ${CMAKE_D_DASH_O}<TARGET> <LINK_LIBRARIES> ${CMAKE_D_STDLIBS}")
|
||||
ENDIF(NOT CMAKE_D_LINK_EXECUTABLE)
|
||||
endif(NOT CMAKE_D_LINK_EXECUTABLE)
|
||||
|
||||
IF(NOT CMAKE_EXECUTABLE_RUNTIME_D_FLAG)
|
||||
SET(CMAKE_EXECUTABLE_RUNTIME_D_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_D_FLAG})
|
||||
ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_D_FLAG)
|
||||
if(NOT CMAKE_EXECUTABLE_RUNTIME_D_FLAG)
|
||||
set(CMAKE_EXECUTABLE_RUNTIME_D_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_D_FLAG})
|
||||
endif(NOT CMAKE_EXECUTABLE_RUNTIME_D_FLAG)
|
||||
|
||||
IF(NOT CMAKE_EXECUTABLE_RUNTIME_D_FLAG_SEP)
|
||||
SET(CMAKE_EXECUTABLE_RUNTIME_D_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_D_FLAG_SEP})
|
||||
ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_D_FLAG_SEP)
|
||||
if(NOT CMAKE_EXECUTABLE_RUNTIME_D_FLAG_SEP)
|
||||
set(CMAKE_EXECUTABLE_RUNTIME_D_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_D_FLAG_SEP})
|
||||
endif(NOT CMAKE_EXECUTABLE_RUNTIME_D_FLAG_SEP)
|
||||
|
||||
IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_D_FLAG)
|
||||
SET(CMAKE_EXECUTABLE_RPATH_LINK_D_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_D_FLAG})
|
||||
ENDIF(NOT CMAKE_EXECUTABLE_RPATH_LINK_D_FLAG)
|
||||
if(NOT CMAKE_EXECUTABLE_RPATH_LINK_D_FLAG)
|
||||
set(CMAKE_EXECUTABLE_RPATH_LINK_D_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_D_FLAG})
|
||||
endif(NOT CMAKE_EXECUTABLE_RPATH_LINK_D_FLAG)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
mark_as_advanced(
|
||||
CMAKE_D_FLAGS
|
||||
CMAKE_D_FLAGS_DEBUG
|
||||
CMAKE_D_FLAGS_MINSIZEREL
|
||||
CMAKE_D_FLAGS_RELEASE
|
||||
CMAKE_D_FLAGS_RELWITHDEBINFO
|
||||
)
|
||||
SET(CMAKE_D_INFORMATION_LOADED 1)
|
||||
set(CMAKE_D_INFORMATION_LOADED 1)
|
||||
|
|
|
@ -20,143 +20,143 @@
|
|||
# the cmake variable CMAKE_GENERATOR_D which can be defined by a generator
|
||||
# as a default compiler
|
||||
|
||||
IF(NOT CMAKE_D_COMPILER)
|
||||
SET(CMAKE_D_COMPILER_INIT NOTFOUND)
|
||||
if(NOT CMAKE_D_COMPILER)
|
||||
set(CMAKE_D_COMPILER_INIT NOTFOUND)
|
||||
# prefer the environment variable DC
|
||||
IF($ENV{DC} MATCHES ".+")
|
||||
GET_FILENAME_COMPONENT(CMAKE_D_COMPILER_INIT $ENV{DC} PROGRAM PROGRAM_ARGS CMAKE_D_FLAGS_ENV_INIT)
|
||||
IF(CMAKE_D_FLAGS_ENV_INIT)
|
||||
SET(CMAKE_D_COMPILER_ARG1 "${CMAKE_D_FLAGS_ENV_INIT}" CACHE STRING "First argument to D compiler")
|
||||
ENDIF(CMAKE_D_FLAGS_ENV_INIT)
|
||||
IF(NOT EXISTS ${CMAKE_D_COMPILER_INIT})
|
||||
if($ENV{DC} MATCHES ".+")
|
||||
get_filename_component(CMAKE_D_COMPILER_INIT $ENV{DC} PROGRAM PROGRAM_ARGS CMAKE_D_FLAGS_ENV_INIT)
|
||||
if(CMAKE_D_FLAGS_ENV_INIT)
|
||||
set(CMAKE_D_COMPILER_ARG1 "${CMAKE_D_FLAGS_ENV_INIT}" CACHE STRING "First argument to D compiler")
|
||||
endif(CMAKE_D_FLAGS_ENV_INIT)
|
||||
if(NOT EXISTS ${CMAKE_D_COMPILER_INIT})
|
||||
MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable C:\n$ENV{DC}.")
|
||||
ENDIF(NOT EXISTS ${CMAKE_D_COMPILER_INIT})
|
||||
ENDIF($ENV{DC} MATCHES ".+")
|
||||
endif(NOT EXISTS ${CMAKE_D_COMPILER_INIT})
|
||||
endif($ENV{DC} MATCHES ".+")
|
||||
|
||||
# next try prefer the compiler specified by the generator
|
||||
IF(CMAKE_GENERATOR_D)
|
||||
IF(NOT CMAKE_D_COMPILER_INIT)
|
||||
SET(CMAKE_D_COMPILER_INIT ${CMAKE_GENERATOR_D})
|
||||
ENDIF(NOT CMAKE_D_COMPILER_INIT)
|
||||
ENDIF(CMAKE_GENERATOR_D)
|
||||
if(CMAKE_GENERATOR_D)
|
||||
if(NOT CMAKE_D_COMPILER_INIT)
|
||||
set(CMAKE_D_COMPILER_INIT ${CMAKE_GENERATOR_D})
|
||||
endif(NOT CMAKE_D_COMPILER_INIT)
|
||||
endif(CMAKE_GENERATOR_D)
|
||||
|
||||
# finally list compilers to try
|
||||
IF(CMAKE_D_COMPILER_INIT)
|
||||
SET(CMAKE_D_COMPILER_LIST ${CMAKE_D_COMPILER_INIT})
|
||||
ELSE(CMAKE_D_COMPILER_INIT)
|
||||
SET(CMAKE_D_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}gdc ${_CMAKE_TOOLCHAIN_PREFIX}dmd)
|
||||
ENDIF(CMAKE_D_COMPILER_INIT)
|
||||
if(CMAKE_D_COMPILER_INIT)
|
||||
set(CMAKE_D_COMPILER_LIST ${CMAKE_D_COMPILER_INIT})
|
||||
else(CMAKE_D_COMPILER_INIT)
|
||||
set(CMAKE_D_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}gdc ${_CMAKE_TOOLCHAIN_PREFIX}dmd)
|
||||
endif(CMAKE_D_COMPILER_INIT)
|
||||
|
||||
# Find the compiler.
|
||||
IF (_CMAKE_USER_D_COMPILER_PATH)
|
||||
FIND_PROGRAM(CMAKE_D_COMPILER NAMES ${CMAKE_D_COMPILER_LIST} PATHS ${_CMAKE_USER_D_COMPILER_PATH} DOC "D compiler" NO_DEFAULT_PATH)
|
||||
ENDIF (_CMAKE_USER_D_COMPILER_PATH)
|
||||
FIND_PROGRAM(CMAKE_D_COMPILER NAMES ${CMAKE_D_COMPILER_LIST} DOC "D compiler")
|
||||
if(_CMAKE_USER_D_COMPILER_PATH)
|
||||
find_program(CMAKE_D_COMPILER NAMES ${CMAKE_D_COMPILER_LIST} PATHS ${_CMAKE_USER_D_COMPILER_PATH} DOC "D compiler" NO_DEFAULT_PATH)
|
||||
endif(_CMAKE_USER_D_COMPILER_PATH)
|
||||
find_program(CMAKE_D_COMPILER NAMES ${CMAKE_D_COMPILER_LIST} DOC "D compiler")
|
||||
|
||||
IF(CMAKE_D_COMPILER_INIT AND NOT CMAKE_D_COMPILER)
|
||||
SET(CMAKE_D_COMPILER "${CMAKE_D_COMPILER_INIT}" CACHE FILEPATH "D compiler" FORCE)
|
||||
ENDIF(CMAKE_D_COMPILER_INIT AND NOT CMAKE_D_COMPILER)
|
||||
ELSE (NOT CMAKE_D_COMPILER)
|
||||
if(CMAKE_D_COMPILER_INIT AND NOT CMAKE_D_COMPILER)
|
||||
set(CMAKE_D_COMPILER "${CMAKE_D_COMPILER_INIT}" CACHE FILEPATH "D compiler" FORCE)
|
||||
endif(CMAKE_D_COMPILER_INIT AND NOT CMAKE_D_COMPILER)
|
||||
else(NOT CMAKE_D_COMPILER)
|
||||
|
||||
# we only get here if CMAKE_D_COMPILER was specified using -D or a pre-made CMakeCache.txt
|
||||
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
|
||||
# if CMAKE_D_COMPILER is a list of length 2, use the first item as
|
||||
# CMAKE_D_COMPILER and the 2nd one as CMAKE_D_COMPILER_ARG1
|
||||
|
||||
LIST(LENGTH CMAKE_D_COMPILER _CMAKE_D_COMPILER_LIST_LENGTH)
|
||||
IF("${_CMAKE_D_COMPILER_LIST_LENGTH}" EQUAL 2)
|
||||
LIST(GET CMAKE_D_COMPILER 1 CMAKE_D_COMPILER_ARG1)
|
||||
LIST(GET CMAKE_D_COMPILER 0 CMAKE_D_COMPILER)
|
||||
ENDIF("${_CMAKE_D_COMPILER_LIST_LENGTH}" EQUAL 2)
|
||||
list(LENGTH CMAKE_D_COMPILER _CMAKE_D_COMPILER_LIST_LENGTH)
|
||||
if("${_CMAKE_D_COMPILER_LIST_LENGTH}" EQUAL 2)
|
||||
list(GET CMAKE_D_COMPILER 1 CMAKE_D_COMPILER_ARG1)
|
||||
list(GET CMAKE_D_COMPILER 0 CMAKE_D_COMPILER)
|
||||
endif("${_CMAKE_D_COMPILER_LIST_LENGTH}" EQUAL 2)
|
||||
|
||||
# if a compiler was specified by the user but without path,
|
||||
# now try to find it with the full path
|
||||
# if it is found, force it into the cache,
|
||||
# if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
|
||||
# if the C compiler already had a path, reuse it for searching the CXX compiler
|
||||
GET_FILENAME_COMPONENT(_CMAKE_USER_D_COMPILER_PATH "${CMAKE_D_COMPILER}" PATH)
|
||||
IF(NOT _CMAKE_USER_D_COMPILER_PATH)
|
||||
FIND_PROGRAM(CMAKE_D_COMPILER_WITH_PATH NAMES ${CMAKE_D_COMPILER})
|
||||
MARK_AS_ADVANCED(CMAKE_D_COMPILER_WITH_PATH)
|
||||
IF(CMAKE_D_COMPILER_WITH_PATH)
|
||||
SET(CMAKE_D_COMPILER ${CMAKE_D_COMPILER_WITH_PATH} CACHE STRING "D compiler" FORCE)
|
||||
ENDIF(CMAKE_D_COMPILER_WITH_PATH)
|
||||
ENDIF(NOT _CMAKE_USER_D_COMPILER_PATH)
|
||||
ENDIF(NOT CMAKE_D_COMPILER)
|
||||
MARK_AS_ADVANCED(CMAKE_D_COMPILER)
|
||||
get_filename_component(_CMAKE_USER_D_COMPILER_PATH "${CMAKE_D_COMPILER}" PATH)
|
||||
if(NOT _CMAKE_USER_D_COMPILER_PATH)
|
||||
find_program(CMAKE_D_COMPILER_WITH_PATH NAMES ${CMAKE_D_COMPILER})
|
||||
mark_as_advanced(CMAKE_D_COMPILER_WITH_PATH)
|
||||
if(CMAKE_D_COMPILER_WITH_PATH)
|
||||
set(CMAKE_D_COMPILER ${CMAKE_D_COMPILER_WITH_PATH} CACHE STRING "D compiler" FORCE)
|
||||
endif(CMAKE_D_COMPILER_WITH_PATH)
|
||||
endif(NOT _CMAKE_USER_D_COMPILER_PATH)
|
||||
endif(NOT CMAKE_D_COMPILER)
|
||||
mark_as_advanced(CMAKE_D_COMPILER)
|
||||
|
||||
IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
||||
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_D_COMPILER}" PATH)
|
||||
ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
||||
if(NOT _CMAKE_TOOLCHAIN_LOCATION)
|
||||
get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_D_COMPILER}" PATH)
|
||||
endif(NOT _CMAKE_TOOLCHAIN_LOCATION)
|
||||
|
||||
# Build a small source file to identify the compiler.
|
||||
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
||||
SET(CMAKE_D_COMPILER_ID_RUN 1)
|
||||
SET(CMAKE_D_PLATFORM_ID "Windows")
|
||||
if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
||||
set(CMAKE_D_COMPILER_ID_RUN 1)
|
||||
set(CMAKE_D_PLATFORM_ID "Windows")
|
||||
|
||||
# TODO: Set the compiler id. It is probably MSVC but
|
||||
# the user may be using an integrated Intel compiler.
|
||||
# SET(CMAKE_D_COMPILER_ID "MSVC")
|
||||
ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
||||
# set(CMAKE_D_COMPILER_ID "MSVC")
|
||||
endif(${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
||||
|
||||
IF(NOT CMAKE_D_COMPILER_ID_RUN)
|
||||
SET(CMAKE_D_COMPILER_ID_RUN 1)
|
||||
if(NOT CMAKE_D_COMPILER_ID_RUN)
|
||||
set(CMAKE_D_COMPILER_ID_RUN 1)
|
||||
|
||||
# Each entry in this list is a set of extra flags to try
|
||||
# adding to the compile line to see if it helps produce
|
||||
# a valid identification file.
|
||||
SET(CMAKE_D_COMPILER_ID_TEST_FLAGS
|
||||
set(CMAKE_D_COMPILER_ID_TEST_FLAGS
|
||||
# Try compiling to an object file only.
|
||||
"-c"
|
||||
)
|
||||
|
||||
# Try to identify the compiler.
|
||||
SET(CMAKE_D_COMPILER_ID)
|
||||
FIND_FILE(CMAKE_PLATFORM_ID_CONTENT_FILE CMakePlatformId.di.in
|
||||
set(CMAKE_D_COMPILER_ID)
|
||||
find_file(CMAKE_PLATFORM_ID_CONTENT_FILE CMakePlatformId.di.in
|
||||
PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH})
|
||||
FILE(READ ${CMAKE_PLATFORM_ID_CONTENT_FILE} CMAKE_D_COMPILER_ID_PLATFORM_CONTENT)
|
||||
FIND_FILE(CMAKE_D_COMPILER_ID_FILE_IN CMakeDCompilerId.d.in PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH})
|
||||
file(READ ${CMAKE_PLATFORM_ID_CONTENT_FILE} CMAKE_D_COMPILER_ID_PLATFORM_CONTENT)
|
||||
find_file(CMAKE_D_COMPILER_ID_FILE_IN CMakeDCompilerId.d.in PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH})
|
||||
# Workaround for bug http://public.kitware.com/Bug/view.php?id=14481
|
||||
# if CMAKE_MODULE_PATH is used, then patch ${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake
|
||||
GET_FILENAME_COMPONENT(CMAKE_D_COMPILER_ID_FILE_IN_PATH ${CMAKE_D_COMPILER_ID_FILE_IN} PATH)
|
||||
IF(CMAKE_D_COMPILER_ID_FILE_IN_PATH STREQUAL ${CMAKE_ROOT}/Modules)
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
|
||||
ELSE(CMAKE_D_COMPILER_ID_FILE_IN_PATH STREQUAL ${CMAKE_ROOT}/Modules)
|
||||
FILE(READ ${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake CMAKE_DETERMINE_COMPILER_ID_CMAKE_CONTENT)
|
||||
get_filename_component(CMAKE_D_COMPILER_ID_FILE_IN_PATH ${CMAKE_D_COMPILER_ID_FILE_IN} PATH)
|
||||
if(CMAKE_D_COMPILER_ID_FILE_IN_PATH STREQUAL ${CMAKE_ROOT}/Modules)
|
||||
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
|
||||
else(CMAKE_D_COMPILER_ID_FILE_IN_PATH STREQUAL ${CMAKE_ROOT}/Modules)
|
||||
file(READ ${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake CMAKE_DETERMINE_COMPILER_ID_CMAKE_CONTENT)
|
||||
STRING(REPLACE "file(READ \${CMAKE_ROOT}/Modules/\${src}.in ID_CONTENT_IN)"
|
||||
"find_file(src_in \${src}.in PATHS \${CMAKE_ROOT}/Modules \${CMAKE_MODULE_PATH})
|
||||
file(READ \${src_in} ID_CONTENT_IN)
|
||||
unset(src_in CACHE)"
|
||||
CMAKE_DETERMINE_COMPILER_ID_CMAKE_CONTENT_PATCHED ${CMAKE_DETERMINE_COMPILER_ID_CMAKE_CONTENT})
|
||||
FILE(WRITE ${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerId.cmake
|
||||
file(WRITE ${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerId.cmake
|
||||
${CMAKE_DETERMINE_COMPILER_ID_CMAKE_CONTENT_PATCHED})
|
||||
INCLUDE(${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerId.cmake)
|
||||
ENDIF(CMAKE_D_COMPILER_ID_FILE_IN_PATH STREQUAL ${CMAKE_ROOT}/Modules)
|
||||
include(${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerId.cmake)
|
||||
endif(CMAKE_D_COMPILER_ID_FILE_IN_PATH STREQUAL ${CMAKE_ROOT}/Modules)
|
||||
CMAKE_DETERMINE_COMPILER_ID(D DFLAGS CMakeDCompilerId.d)
|
||||
UNSET(CMAKE_D_COMPILER_ID_FILE_IN CACHE)
|
||||
UNSET(CMAKE_PLATFORM_ID_CONTENT_FILE CACHE)
|
||||
unset(CMAKE_D_COMPILER_ID_FILE_IN CACHE)
|
||||
unset(CMAKE_PLATFORM_ID_CONTENT_FILE CACHE)
|
||||
|
||||
# Set old compiler and platform id variables.
|
||||
IF("${CMAKE_D_COMPILER_ID}" MATCHES "GNU")
|
||||
SET(CMAKE_COMPILER_IS_GDC 1)
|
||||
ENDIF("${CMAKE_D_COMPILER_ID}" MATCHES "GNU")
|
||||
IF("${CMAKE_D_PLATFORM_ID}" MATCHES "MinGW")
|
||||
SET(CMAKE_COMPILER_IS_MINGW 1)
|
||||
ELSEIF("${CMAKE_D_PLATFORM_ID}" MATCHES "Cygwin")
|
||||
SET(CMAKE_COMPILER_IS_CYGWIN 1)
|
||||
ENDIF("${CMAKE_D_PLATFORM_ID}" MATCHES "MinGW")
|
||||
ENDIF(NOT CMAKE_D_COMPILER_ID_RUN)
|
||||
if("${CMAKE_D_COMPILER_ID}" MATCHES "GNU")
|
||||
set(CMAKE_COMPILER_IS_GDC 1)
|
||||
endif("${CMAKE_D_COMPILER_ID}" MATCHES "GNU")
|
||||
if("${CMAKE_D_PLATFORM_ID}" MATCHES "MinGW")
|
||||
set(CMAKE_COMPILER_IS_MINGW 1)
|
||||
elseif("${CMAKE_D_PLATFORM_ID}" MATCHES "Cygwin")
|
||||
set(CMAKE_COMPILER_IS_CYGWIN 1)
|
||||
endif("${CMAKE_D_PLATFORM_ID}" MATCHES "MinGW")
|
||||
endif(NOT CMAKE_D_COMPILER_ID_RUN)
|
||||
|
||||
INCLUDE(CMakeFindBinUtils)
|
||||
IF(MSVC_D_ARCHITECTURE_ID)
|
||||
SET(SET_MSVC_D_ARCHITECTURE_ID
|
||||
"SET(MSVC_D_ARCHITECTURE_ID ${MSVC_D_ARCHITECTURE_ID})")
|
||||
ENDIF(MSVC_D_ARCHITECTURE_ID)
|
||||
include(CMakeFindBinUtils)
|
||||
if(MSVC_D_ARCHITECTURE_ID)
|
||||
set(SET_MSVC_D_ARCHITECTURE_ID
|
||||
"set(MSVC_D_ARCHITECTURE_ID ${MSVC_D_ARCHITECTURE_ID})")
|
||||
endif(MSVC_D_ARCHITECTURE_ID)
|
||||
# configure variables set in this file for fast reload later on
|
||||
FIND_FILE(CMAKE_D_COMPILER_CMAKE_IN CMakeDCompiler.cmake.in
|
||||
find_file(CMAKE_D_COMPILER_CMAKE_IN CMakeDCompiler.cmake.in
|
||||
PATHS ${CMAKE_ROOT} ${CMAKE_MODULE_PATH})
|
||||
CONFIGURE_FILE(${CMAKE_D_COMPILER_CMAKE_IN}
|
||||
configure_file(${CMAKE_D_COMPILER_CMAKE_IN}
|
||||
${CMAKE_PLATFORM_INFO_DIR}/CMakeDCompiler.cmake
|
||||
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
|
||||
)
|
||||
SET(CMAKE_D_COMPILER_ENV_VAR "DC")
|
||||
set(CMAKE_D_COMPILER_ENV_VAR "DC")
|
||||
|
|
|
@ -13,66 +13,66 @@
|
|||
# See http://www.cmake.org/HTML/Copyright.html for details
|
||||
#
|
||||
|
||||
INCLUDE(CMakeTestCompilerCommon)
|
||||
include(CMakeTestCompilerCommon)
|
||||
|
||||
# This file is used by EnableLanguage in cmGlobalGenerator to
|
||||
# determine that that selected D compiler can actually compile
|
||||
# and link the most basic of programs. If not, a fatal error
|
||||
# is set and cmake stops processing commands and will not generate
|
||||
# any makefiles or projects.
|
||||
IF(NOT CMAKE_D_COMPILER_WORKS)
|
||||
if(NOT CMAKE_D_COMPILER_WORKS)
|
||||
PrintTestCompilerStatus("D" "")
|
||||
FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testDCompiler.d
|
||||
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testDCompiler.d
|
||||
"int main(char[][] args)\n"
|
||||
"{return args.sizeof-1;}\n")
|
||||
TRY_COMPILE(CMAKE_D_COMPILER_WORKS ${CMAKE_BINARY_DIR}
|
||||
try_compile(CMAKE_D_COMPILER_WORKS ${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testDCompiler.d
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
SET(D_TEST_WAS_RUN 1)
|
||||
ENDIF(NOT CMAKE_D_COMPILER_WORKS)
|
||||
set(D_TEST_WAS_RUN 1)
|
||||
endif(NOT CMAKE_D_COMPILER_WORKS)
|
||||
|
||||
IF(NOT CMAKE_D_COMPILER_WORKS)
|
||||
if(NOT CMAKE_D_COMPILER_WORKS)
|
||||
PrintTestCompilerStatus("D" " -- broken")
|
||||
message(STATUS "To force a specific D compiler set the DC environment variable")
|
||||
message(STATUS " ie - export DC=\"/usr/bin/dmd\"")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if the D compiler works failed with "
|
||||
"the following output:\n${OUTPUT}\n\n")
|
||||
# if the compiler is broken make sure to remove the platform file
|
||||
# since Windows-cl configures both c/cxx files both need to be removed
|
||||
# when c or c++ fails
|
||||
FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeDPlatform.cmake )
|
||||
MESSAGE(FATAL_ERROR "The D compiler \"${CMAKE_D_COMPILER}\" "
|
||||
file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeDPlatform.cmake )
|
||||
message(FATAL_ERROR "The D compiler \"${CMAKE_D_COMPILER}\" "
|
||||
"is not able to compile a simple test program.\nIt fails "
|
||||
"with the following output:\n ${OUTPUT}\n\n"
|
||||
"CMake will not be able to correctly generate this project.")
|
||||
ELSE(NOT CMAKE_D_COMPILER_WORKS)
|
||||
IF(D_TEST_WAS_RUN)
|
||||
MESSAGE(STATUS "Check for working D compiler: ${CMAKE_D_COMPILER} -- works")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
else(NOT CMAKE_D_COMPILER_WORKS)
|
||||
if(D_TEST_WAS_RUN)
|
||||
message(STATUS "Check for working D compiler: ${CMAKE_D_COMPILER} -- works")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if the D compiler works passed with "
|
||||
"the following output:\n${OUTPUT}\n\n")
|
||||
ENDIF(D_TEST_WAS_RUN)
|
||||
SET(CMAKE_D_COMPILER_WORKS 1 CACHE INTERNAL "")
|
||||
endif(D_TEST_WAS_RUN)
|
||||
set(CMAKE_D_COMPILER_WORKS 1 CACHE INTERNAL "")
|
||||
|
||||
IF(CMAKE_D_COMPILER_FORCED)
|
||||
if(CMAKE_D_COMPILER_FORCED)
|
||||
# The compiler configuration was forced by the user.
|
||||
# Assume the user has configured all compiler information.
|
||||
ELSE(CMAKE_D_COMPILER_FORCED)
|
||||
else(CMAKE_D_COMPILER_FORCED)
|
||||
# Try to identify the ABI and configure it into CMakeDCompiler.cmake
|
||||
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
|
||||
FIND_FILE(CMAKE_D_COMPILER_ABI_SRC CMakeDCompilerABI.d
|
||||
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
|
||||
find_file(CMAKE_D_COMPILER_ABI_SRC CMakeDCompilerABI.d
|
||||
PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH})
|
||||
CMAKE_DETERMINE_COMPILER_ABI(D ${CMAKE_D_COMPILER_ABI_SRC})
|
||||
FIND_FILE(CMAKE_D_COMPILER_CMAKE_IN CMakeDCompiler.cmake.in
|
||||
find_file(CMAKE_D_COMPILER_CMAKE_IN CMakeDCompiler.cmake.in
|
||||
PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH})
|
||||
CONFIGURE_FILE(
|
||||
configure_file(
|
||||
${CMAKE_D_COMPILER_CMAKE_IN}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeDCompiler.cmake
|
||||
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
|
||||
)
|
||||
INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeDCompiler.cmake)
|
||||
UNSET(CMAKE_D_COMPILER_ABI_SRC CACHE)
|
||||
UNSET(CMAKE_D_COMPILER_CMAKE_IN CACHE)
|
||||
ENDIF(CMAKE_D_COMPILER_FORCED)
|
||||
ENDIF(NOT CMAKE_D_COMPILER_WORKS)
|
||||
include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeDCompiler.cmake)
|
||||
unset(CMAKE_D_COMPILER_ABI_SRC CACHE)
|
||||
unset(CMAKE_D_COMPILER_CMAKE_IN CACHE)
|
||||
endif(CMAKE_D_COMPILER_FORCED)
|
||||
endif(NOT CMAKE_D_COMPILER_WORKS)
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# GDC_INCLUDE_PATH = path to where object.d is found
|
||||
#
|
||||
|
||||
SET(GDC_POSSIBLE_INCLUDE_PATHS
|
||||
set(GDC_POSSIBLE_INCLUDE_PATHS
|
||||
/usr/include/d/4.8.2
|
||||
/usr/include/d/4.8.1
|
||||
/usr/include/d/4.8.0
|
||||
|
@ -41,9 +41,9 @@ SET(GDC_POSSIBLE_INCLUDE_PATHS
|
|||
/usr/include/d/3.4.0
|
||||
)
|
||||
|
||||
FIND_PATH(GDC_INCLUDE_PATH object.d
|
||||
find_path(GDC_INCLUDE_PATH object.d
|
||||
${GDC_POSSIBLE_INCLUDE_PATHS})
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
mark_as_advanced(
|
||||
GDC_INCLUDE_PATH
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue