-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add lua, csharp, java, octave modular support
- Loading branch information
Showing
17 changed files
with
596 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
find_file(ANT_EXECUTABLE NAMES ant ant.sh ant.bat PATHS $ENV{ANT_HOME}/bin) | ||
|
||
INCLUDE(FindPackageHandleStandardArgs) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ANT DEFAULT_MSG ANT_EXECUTABLE) | ||
|
||
MARK_AS_ADVANCED(ANT_EXECUTABLE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# | ||
# A CMake Module for finding and using C# (.NET and Mono). | ||
# | ||
# The following variables are set: | ||
# CSHARP_FOUND - set to ON if C# is found | ||
# CSHARP_USE_FILE - the path to the C# use file | ||
# CSHARP_TYPE - the type of the C# compiler (eg. ".NET" or "Mono") | ||
# CSHARP_VERSION - the version of the C# compiler (eg. "v4.0" or "2.10.2") | ||
# CSHARP_COMPILER - the path to the C# compiler executable (eg. "C:/Windows/Microsoft.NET/Framework/v4.0.30319/csc.exe" or "/usr/bin/gmcs") | ||
# CSHARP_INTERPRETER - the path to interpreter needed to run CSharp executables | ||
# CSHARP_PLATFORM - the C# target platform | ||
# CSHARP_SDK - the SDK commandline switch (empty for .NET, for Mono eg. "/sdk:2" or "/sdk:4") | ||
# | ||
# This file is based on the work of GDCM: | ||
# http://gdcm.svn.sf.net/viewvc/gdcm/trunk/CMake/FindCSharp.cmake | ||
# Copyright (c) 2006-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com> | ||
# | ||
|
||
# TODO: ADD ABILITY TO SELECT WHICH C# COMPILER eg. .NET or Mono (if both exist). For the moment, .NET is selected above Mono. | ||
|
||
# Make sure find package macros are included | ||
include( FindPackageHandleStandardArgs ) | ||
|
||
unset( CSHARP_COMPILER CACHE ) | ||
unset( CSHARP_INTERPRETER CACHE ) | ||
unset( CSHARP_TYPE CACHE ) | ||
unset( CSHARP_VERSION CACHE ) | ||
unset( CSHARP_FOUND CACHE ) | ||
|
||
# By default use anycpu platform, allow the user to override | ||
set( CSHARP_PLATFORM "anycpu" CACHE STRING "C# target platform: x86, x64, anycpu, or itanium" ) | ||
if( NOT ${CSHARP_PLATFORM} MATCHES "x86|x64|anycpu|itanium" ) | ||
message( FATAL_ERROR "The C# target platform '${CSHARP_PLATFORM}' is not valid. Please enter one of the following: x86, x64, anycpu, or itanium" ) | ||
endif( ) | ||
|
||
if( WIN32 ) | ||
find_package( DotNetFrameworkSdk ) | ||
if( NOT CSHARP_DOTNET_FOUND ) | ||
find_package( Mono ) | ||
endif( ) | ||
else( UNIX ) | ||
find_package( Mono ) | ||
endif( ) | ||
|
||
if( CSHARP_DOTNET_FOUND ) | ||
set( CSHARP_TYPE ".NET" CACHE STRING "Using the .NET compiler" ) | ||
set( CSHARP_VERSION ${CSHARP_DOTNET_VERSION} CACHE STRING "C# .NET compiler version" FORCE ) | ||
set( CSHARP_COMPILER ${CSHARP_DOTNET_COMPILER_${CSHARP_DOTNET_VERSION}} CACHE STRING "Full path to .NET compiler" FORCE ) | ||
set( CSHARP_INTERPRETER "" CACHE INTERNAL "Interpretor not required for .NET" FORCE ) | ||
elseif( CSHARP_MONO_FOUND ) | ||
set( CSHARP_TYPE "Mono" CACHE STRING "Using the Mono compiler" ) | ||
set( CSHARP_VERSION ${CSHARP_MONO_VERSION} CACHE STRING "C# Mono compiler version" FORCE ) | ||
set( CSHARP_COMPILER ${CSHARP_MONO_COMPILER_${CSHARP_MONO_VERSION}} CACHE STRING "Full path to Mono compiler" FORCE ) | ||
set( CSHARP_INTERPRETER ${CSHARP_MONO_INTERPRETER_${CSHARP_MONO_VERSION}} CACHE STRING "Full path to Mono interpretor" FORCE ) | ||
set( CSHARP_SDK "/sdk:2" CACHE STRING "C# Mono SDK commandline switch (e.g. /sdk:2, /sdk:4, /sdk:5)" ) | ||
endif( ) | ||
|
||
# Handle WIN32 specific issues | ||
if ( WIN32 ) | ||
if ( CSHARP_COMPILER MATCHES "bat" ) | ||
set( CSHARP_COMPILER "call ${CSHARP_COMPILER}" ) | ||
endif ( ) | ||
endif( ) | ||
|
||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CSharp DEFAULT_MSG CSHARP_TYPE CSHARP_VERSION CSHARP_COMPILER) | ||
|
||
mark_as_advanced( CSHARP_TYPE CSHARP_VERSION CSHARP_COMPILER CSHARP_INTERPRETER CSHARP_PLATFORM CSHARP_SDK ) | ||
|
||
# Set the USE_FILE path | ||
# http://public.kitware.com/Bug/view.php?id=7757 | ||
get_filename_component( current_list_path ${CMAKE_CURRENT_LIST_FILE} PATH ) | ||
set( CSHARP_USE_FILE ${current_list_path}/UseCSharp.cmake ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
# A CMake Module for finding C# .NET. | ||
# | ||
# The following variables are set: | ||
# CSHARP_DOTNET_FOUND | ||
# CSHARP_DOTNET_COMPILER_${version} eg. "CSHARP_DOTNET_COMPILER_v4.0.30319" | ||
# CSHARP_DOTNET_VERSION eg. "v4.0.30319" | ||
# CSHARP_DOTNET_VERSIONS eg. "v2.0.50727, v3.5, v4.0.30319" | ||
# DotNetFrameworkSdk_USE_FILE | ||
# | ||
# Additional references can be found here: | ||
# .NET SDK 1.1: http://www.microsoft.com/downloads/details.aspx?FamilyID=9b3a2ca6-3647-4070-9f41-a333c6b9181d&displaylang=en | ||
# .NET SDK 2.0: http://www.microsoft.com/downloads/details.aspx?FamilyID=fe6f2099-b7b4-4f47-a244-c96d69c35dec&displaylang=en | ||
# .NET SDK 3.5: http://www.microsoft.com/downloads/details.aspx?familyid=333325fd-ae52-4e35-b531-508d977d32a6&displaylang=en | ||
# C# Compiler options: http://msdn.microsoft.com/en-us/library/2fdbz5xd(v=VS.71).aspx | ||
# | ||
# This file is based on the work of GDCM: | ||
# http://gdcm.svn.sf.net/viewvc/gdcm/trunk/CMake/FindDotNETFrameworkSDK.cmake | ||
# Copyright (c) 2006-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com> | ||
# | ||
|
||
set( csharp_dotnet_valid 1 ) | ||
if( DEFINED CSHARP_DOTNET_FOUND ) | ||
# The .NET compiler has already been found | ||
# It may have been reset by the user, verify it is correct | ||
if( NOT DEFINED CSHARP_DOTNET_COMPILER_${CSHARP_DOTNET_VERSION} ) | ||
set( csharp_dotnet_version_user ${CSHARP_DOTNET_VERSION} ) | ||
set( csharp_dotnet_valid 0 ) | ||
set( CSHARP_DOTNET_FOUND 0 ) | ||
set( CSHARP_DOTNET_VERSION "CSHARP_DOTNET_VERSION-NOTVALID" CACHE STRING "C# .NET compiler version, choices: ${CSHARP_DOTNET_VERSIONS}" FORCE ) | ||
message( FATAL_ERROR "The C# .NET version '${csharp_dotnet_version_user}' is not valid. Please enter one of the following: ${CSHARP_DOTNET_VERSIONS}" ) | ||
endif( ) | ||
endif( ) | ||
|
||
unset( CSHARP_DOTNET_VERSIONS CACHE ) # Clear versions | ||
|
||
# Get the framework directory based on platform | ||
if( ${CSHARP_PLATFORM} MATCHES "x64|itanium" ) | ||
set( csharp_dotnet_framework_dir "$ENV{windir}/Microsoft.NET/Framework64" ) | ||
else( ) | ||
set( csharp_dotnet_framework_dir "$ENV{windir}/Microsoft.NET/Framework" ) | ||
endif( ) | ||
|
||
# Search for .NET versions | ||
string( REPLACE "\\" "/" csharp_dotnet_framework_dir ${csharp_dotnet_framework_dir} ) | ||
file( GLOB_RECURSE csharp_dotnet_executables "${csharp_dotnet_framework_dir}/csc.exe" ) | ||
list( SORT csharp_dotnet_executables ) | ||
list( REVERSE csharp_dotnet_executables ) | ||
foreach ( csharp_dotnet_executable ${csharp_dotnet_executables} ) | ||
if( csharp_dotnet_valid ) | ||
# Extract version number (eg. v4.0.30319) | ||
# TODO: Consider using REGEX | ||
string( REPLACE "${csharp_dotnet_framework_dir}/" "" csharp_dotnet_version_temp ${csharp_dotnet_executable} ) | ||
string( REPLACE "/csc.exe" "" csharp_dotnet_version_temp ${csharp_dotnet_version_temp} ) | ||
|
||
# Add variable holding executable | ||
set( CSHARP_DOTNET_COMPILER_${csharp_dotnet_version_temp} ${csharp_dotnet_executable} CACHE STRING "C# .NET compiler ${csharp_dotnet_version}" FORCE ) | ||
mark_as_advanced( CSHARP_DOTNET_COMPILER_${csharp_dotnet_version_temp} ) | ||
endif( ) | ||
|
||
# Create a list of supported compiler versions | ||
if( NOT DEFINED CSHARP_DOTNET_VERSIONS ) | ||
set( CSHARP_DOTNET_VERSIONS "${csharp_dotnet_version_temp}" CACHE STRING "Available C# .NET compiler versions" FORCE ) | ||
else( ) | ||
set( CSHARP_DOTNET_VERSIONS "${CSHARP_DOTNET_VERSIONS}, ${csharp_dotnet_version_temp}" CACHE STRING "Available C# .NET compiler versions" FORCE ) | ||
endif( ) | ||
mark_as_advanced( CSHARP_DOTNET_VERSIONS ) | ||
|
||
# We found at least one .NET compiler version | ||
set( CSHARP_DOTNET_FOUND 1 CACHE INTERNAL "Boolean indicating if C# .NET was found" ) | ||
endforeach( csharp_dotnet_executable ) | ||
|
||
if( CSHARP_DOTNET_FOUND ) | ||
# Report the found versions | ||
message( STATUS "Found the following C# .NET versions: ${CSHARP_DOTNET_VERSIONS}" ) | ||
|
||
# Set the compiler version | ||
# Do not force, so that the user can manually select their own version if they wish | ||
if ( DEFINED CSHARP_DOTNET_COMPILER_v2.0.50727 ) | ||
# If available, select .NET v2.0.50727 (this is the minimal version as it supports generics, and allows use of VS2008) | ||
set( CSHARP_DOTNET_VERSION "v2.0.50727" CACHE STRING "C# .NET compiler version" ) | ||
else( ) | ||
# Select the highest version (first in reverse sorted list) | ||
list( GET CSHARP_DOTNET_VERSIONS 0 csharp_dotnet_version_temp ) | ||
set( CSHARP_DOTNET_VERSION ${csharp_dotnet_version_temp} CACHE STRING "C# .NET compiler version" ) | ||
endif( ) | ||
mark_as_advanced( CSHARP_DOTNET_VERSION ) | ||
endif( ) | ||
|
||
# Set USE_FILE | ||
get_filename_component( current_list_path ${CMAKE_CURRENT_LIST_FILE} PATH ) | ||
set( DotNetFrameworkSdk_USE_FILE ${current_list_path}/UseDotNetFrameworkSdk.cmake ) |
Oops, something went wrong.