├── templates └── wizards │ ├── files │ ├── fortsource │ │ ├── file.f90 │ │ └── wizard.json │ ├── fortmodule │ │ ├── module.f90 │ │ └── wizard.json │ └── fortdt │ │ ├── module.f90 │ │ └── wizard.json │ ├── global │ ├── lib.png │ ├── lib@2x.png │ ├── guiapplication.png │ ├── consoleapplication.png │ ├── guiapplication@2x.png │ └── consoleapplication@2x.png │ └── projects │ ├── extmod │ ├── file.pro │ ├── file.qbs │ ├── extmodule_impl.f90 │ ├── extmodule_const.f90 │ ├── extmodule_intf.f90 │ ├── CMakeLists.txt │ └── wizard.json │ └── plainfor │ ├── file.pro │ ├── file.qbs │ ├── CMakeLists.txt │ ├── main.f90 │ └── wizard.json ├── generic-highlighter ├── syntax │ └── fortran.xml └── fortran.xml ├── .gitignore ├── installer └── qtcreator-fortran.iss ├── LICENSE └── README.md /templates/wizards/files/fortsource/file.f90: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /generic-highlighter/syntax/fortran.xml: -------------------------------------------------------------------------------- 1 | ../fortran.xml -------------------------------------------------------------------------------- /templates/wizards/global/lib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonaslindemann/qtcreator-fortran/HEAD/templates/wizards/global/lib.png -------------------------------------------------------------------------------- /templates/wizards/global/lib@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonaslindemann/qtcreator-fortran/HEAD/templates/wizards/global/lib@2x.png -------------------------------------------------------------------------------- /templates/wizards/global/guiapplication.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonaslindemann/qtcreator-fortran/HEAD/templates/wizards/global/guiapplication.png -------------------------------------------------------------------------------- /templates/wizards/global/consoleapplication.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonaslindemann/qtcreator-fortran/HEAD/templates/wizards/global/consoleapplication.png -------------------------------------------------------------------------------- /templates/wizards/global/guiapplication@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonaslindemann/qtcreator-fortran/HEAD/templates/wizards/global/guiapplication@2x.png -------------------------------------------------------------------------------- /templates/wizards/global/consoleapplication@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonaslindemann/qtcreator-fortran/HEAD/templates/wizards/global/consoleapplication@2x.png -------------------------------------------------------------------------------- /templates/wizards/projects/extmod/file.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console c++11 3 | CONFIG -= app_bundle 4 | CONFIG -= qt 5 | 6 | SOURCES += \\ 7 | %{CppFileName} 8 | -------------------------------------------------------------------------------- /templates/wizards/projects/plainfor/file.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console c++11 3 | CONFIG -= app_bundle 4 | CONFIG -= qt 5 | 6 | SOURCES += \\ 7 | %{CppFileName} 8 | -------------------------------------------------------------------------------- /templates/wizards/files/fortmodule/module.f90: -------------------------------------------------------------------------------- 1 | module %{ModuleName} 2 | 3 | implicit none 4 | 5 | ! --- Variable declarations here 6 | 7 | contains 8 | 9 | ! --- Subroutine and function declarations here 10 | 11 | end module %{ModuleName} 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | CMakeLists.txt.user 2 | CMakeCache.txt 3 | CMakeFiles 4 | CMakeScripts 5 | Testing 6 | Makefile 7 | cmake_install.cmake 8 | install_manifest.txt 9 | compile_commands.json 10 | CTestTestfile.cmake 11 | _deps 12 | templates/wizards/projects/plainfor/.vscode/settings.json 13 | -------------------------------------------------------------------------------- /templates/wizards/projects/extmod/file.qbs: -------------------------------------------------------------------------------- 1 | import qbs 2 | 3 | CppApplication { 4 | consoleApplication: true 5 | files: "%{CppFileName}" 6 | 7 | Group { // Properties for the produced executable 8 | fileTagsFilter: "application" 9 | qbs.install: true 10 | qbs.installDir: "bin" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /templates/wizards/projects/plainfor/file.qbs: -------------------------------------------------------------------------------- 1 | import qbs 2 | 3 | CppApplication { 4 | consoleApplication: true 5 | files: "%{CppFileName}" 6 | 7 | Group { // Properties for the produced executable 8 | fileTagsFilter: "application" 9 | qbs.install: true 10 | qbs.installDir: "bin" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /templates/wizards/projects/plainfor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | 3 | if (APPLE) 4 | set(CMAKE_Fortran_COMPILER "/usr/local/bin/gfortran") 5 | endif() 6 | 7 | project(%{ProjectName} LANGUAGES Fortran) 8 | 9 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 10 | 11 | file(GLOB fortran_files *.f90) 12 | 13 | add_executable(%{ProjectName} ${fortran_files}) 14 | -------------------------------------------------------------------------------- /templates/wizards/projects/plainfor/main.f90: -------------------------------------------------------------------------------- 1 | program myfortran 2 | 3 | ! --- Put use statements here 4 | ! 5 | ! use mymodule 6 | 7 | implicit none 8 | 9 | ! --- Declare your variables here 10 | ! 11 | ! integer :: a 12 | 13 | print*, 'Hello, Fortran!' 14 | 15 | contains 16 | 17 | ! --- Add your subroutines and functions here 18 | ! 19 | ! subroutine mysub 20 | ! 21 | ! end subroutine mysub 22 | 23 | end program myfortran -------------------------------------------------------------------------------- /installer/qtcreator-fortran.iss: -------------------------------------------------------------------------------- 1 | [Setup] 2 | AppName=Fortran extensions for Qt Creator 3 | AppVersion=1.1 4 | WizardStyle=modern 5 | DefaultDirName={userappdata}\QtProject\qtcreator 6 | Compression=lzma2 7 | SolidCompression=yes 8 | OutputDir=windows-installer 9 | SignTool=signtool_lu 10 | SignedUninstaller=yes 11 | PrivilegesRequired=lowest 12 | 13 | [Files] 14 | Source: "..\generic-highlighter\*"; DestDir: "{app}\generic-highlighter"; Flags: ignoreversion recursesubdirs createallsubdirs; 15 | Source: "..\templates\*"; DestDir: "{app}\templates"; Flags: ignoreversion recursesubdirs createallsubdirs; 16 | 17 | -------------------------------------------------------------------------------- /templates/wizards/projects/extmod/extmodule_impl.f90: -------------------------------------------------------------------------------- 1 | module %{ModuleName}_impl 2 | 3 | ! 4 | ! %{ModuleName} implementation module 5 | ! 6 | ! Subroutines and function in this module 7 | ! will only be availble internally for the 8 | ! interface module. Not availble in the 9 | ! Extension module 10 | ! 11 | 12 | use %{ModuleName}_const 13 | 14 | implicit none 15 | 16 | contains 17 | 18 | subroutine example_impl(a, b, c) 19 | 20 | real(rk), intent(in) :: a 21 | real(rk), intent(in) :: b 22 | real(rk), intent(inout) :: c 23 | 24 | c = a + b 25 | 26 | end subroutine example_impl 27 | 28 | end module %{ModuleName}_impl 29 | -------------------------------------------------------------------------------- /templates/wizards/files/fortdt/module.f90: -------------------------------------------------------------------------------- 1 | module %{ModuleName} 2 | 3 | implicit none 4 | 5 | ! --- Common data type constants 6 | 7 | integer, parameter :: ik2 = selected_int_kind(2) 8 | integer, parameter :: ik4 = selected_int_kind(4) 9 | integer, parameter :: ik9 = selected_int_kind(9) 10 | integer, parameter :: ik18 = selected_int_kind(18) 11 | integer, parameter :: ik = ik9 12 | 13 | integer, parameter :: rks = selected_real_kind(6, 37) 14 | integer, parameter :: rkd = selected_real_kind(15, 307) 15 | integer, parameter :: rk = rkd 16 | 17 | ! --- Variable and constant declarations here 18 | 19 | contains 20 | 21 | ! --- Subroutine and function declarations here 22 | 23 | end module %{ModuleName} 24 | -------------------------------------------------------------------------------- /templates/wizards/projects/extmod/extmodule_const.f90: -------------------------------------------------------------------------------- 1 | module %{ModuleName}_const 2 | 3 | ! 4 | ! %{ModuleName} constants 5 | ! 6 | ! These constants are used in both the 7 | ! Implementation and interface moddules 8 | ! 9 | 10 | implicit none 11 | 12 | integer, parameter :: ik2 = selected_int_kind(2) 13 | integer, parameter :: ik4 = selected_int_kind(4) 14 | integer, parameter :: ik9 = selected_int_kind(9) 15 | integer, parameter :: ik18 = selected_int_kind(18) 16 | integer, parameter :: ik = ik9 17 | 18 | integer, parameter :: rks = selected_real_kind(6, 37) 19 | integer, parameter :: rkd = selected_real_kind(15, 307) 20 | integer, parameter :: rk = rkd 21 | 22 | contains 23 | 24 | end module %{ModuleName}_const -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Jonas Lindemann 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /templates/wizards/files/fortsource/wizard.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "supportedProjectTypes": [ ], 4 | "id": "B.Source", 5 | "category": "O.Fortran", 6 | "trDescription": "Creates a Fortran source file that you can add to a Fortran project.", 7 | "trDisplayName": "Fortran Source File", 8 | "trDisplayCategory": "Fortran", 9 | "iconText": "f90", 10 | "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", 11 | 12 | "options": { "key": "FileName", "value": "%{JS: Util.fileName(value('TargetPath'), Util.preferredSuffix('text/x-c++src'))}" }, 13 | 14 | "pages" : 15 | [ 16 | { 17 | "trDisplayName": "Location", 18 | "trShortTitle": "Location", 19 | "typeId": "File" 20 | }, 21 | { 22 | "trDisplayName": "Project Management", 23 | "trShortTitle": "Summary", 24 | "typeId": "Summary" 25 | } 26 | ], 27 | "generators" : 28 | [ 29 | { 30 | "typeId": "File", 31 | "data": 32 | { 33 | "source": "file.f90", 34 | "target": "%{FileName}", 35 | "openInEditor": true, 36 | "options": { "key": "Cpp:License:FileName", "value": "%{JS: Util.fileName(value('FileName'))}" } 37 | } 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /templates/wizards/projects/extmod/extmodule_intf.f90: -------------------------------------------------------------------------------- 1 | module %{ModuleName} 2 | 3 | ! 4 | ! %{ModuleName} interface module 5 | ! 6 | ! Subroutines and function in this module 7 | ! will be availble in the F2PY generated 8 | ! extension module. 9 | ! 10 | 11 | use %{ModuleName}_const 12 | use %{ModuleName}_impl 13 | 14 | implicit none 15 | 16 | contains 17 | 18 | subroutine example_real(a, b, c) 19 | 20 | real(rk), intent(in) :: a 21 | real(rk), intent(in) :: b 22 | real(rk), intent(out) :: c 23 | 24 | c = a + b 25 | 26 | end subroutine example_real 27 | 28 | subroutine example_int(a, b, c) 29 | 30 | integer, intent(in) :: a 31 | integer, intent(in) :: b 32 | integer, intent(out) :: c 33 | 34 | c = a + b 35 | 36 | end subroutine example_int 37 | 38 | subroutine example_array(a, b, c) 39 | 40 | real(rk), intent(in) :: a 41 | real(rk), intent(in) :: b 42 | real(rk), intent(inout) :: c 43 | 44 | c = a + b 45 | 46 | end subroutine example_array 47 | 48 | subroutine example_intf(a, b, c) 49 | 50 | real(rk), intent(in) :: a 51 | real(rk), intent(in) :: b 52 | real(rk), intent(inout) :: c 53 | 54 | call example_impl(a, b, c) 55 | 56 | end subroutine example_intf 57 | 58 | end module %{ModuleName} 59 | -------------------------------------------------------------------------------- /templates/wizards/files/fortmodule/wizard.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "supportedProjectTypes": [ ], 4 | "id": "C.Module", 5 | "category": "O.Fortran", 6 | "trDescription": "Creates a Fortran module file that you can add to a Fortran project.", 7 | "trDisplayName": "Fortran Module File", 8 | "trDisplayCategory": "Fortran", 9 | "iconText": "f90", 10 | "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", 11 | 12 | "options": [ 13 | { "key": "FileName", "value": "%{JS: Util.fileName(value('TargetPath'), '.f90')}" }, 14 | { "key": "Name", "value": "%{JS: Util.baseName(value('FileName'))}"} 15 | ], 16 | 17 | "pages" : 18 | [ 19 | { 20 | "trDisplayName": "Location", 21 | "trShortTitle": "Location", 22 | "typeId": "File", 23 | "enabled": true 24 | }, 25 | { 26 | "trDisplayName": "Project Management", 27 | "trShortTitle": "Summary", 28 | "typeId": "Summary" 29 | } 30 | ], 31 | "generators" : 32 | [ 33 | { 34 | "typeId": "File", 35 | "data": 36 | { 37 | "source": "module.f90", 38 | "target": "%{FileName}", 39 | "openInEditor": true, 40 | "options": { "key": "ModuleName", "value": "%{Name}" } 41 | } 42 | } 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /templates/wizards/files/fortdt/wizard.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "supportedProjectTypes": [ ], 4 | "id": "C.ModuleDT", 5 | "category": "O.Fortran", 6 | "trDescription": "Creates a Fortran module with data type declarations for integers and floating point numbers.", 7 | "trDisplayName": "Fortran datatype constants module file", 8 | "trDisplayCategory": "Fortran", 9 | "iconText": "f90", 10 | "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", 11 | 12 | "options": [ 13 | { "key": "FileName", "value": "%{JS: Util.fileName(value('TargetPath'), '.f90')}" }, 14 | { "key": "Name", "value": "%{JS: Util.baseName(value('FileName'))}"} 15 | ], 16 | 17 | "pages" : 18 | [ 19 | { 20 | "trDisplayName": "Location", 21 | "trShortTitle": "Location", 22 | "typeId": "File", 23 | "enabled": true 24 | }, 25 | { 26 | "trDisplayName": "Project Management", 27 | "trShortTitle": "Summary", 28 | "typeId": "Summary" 29 | } 30 | ], 31 | "generators" : 32 | [ 33 | { 34 | "typeId": "File", 35 | "data": 36 | { 37 | "source": "module.f90", 38 | "target": "%{FileName}", 39 | "openInEditor": true, 40 | "options": { "key": "ModuleName", "value": "%{Name}" } 41 | } 42 | } 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Templates for using Qt Creator and Fortran 2 | 3 | This project adds support for Fortran projects and source files in Qt Creator as well as syntax-highlighting. 4 | 5 | # Installation 6 | 7 | ## Linux/macOS 8 | 9 | Go to the user configuration directory of Qt Creator 10 | 11 | cd ~/.config/QtProject/qtcreator 12 | 13 | Download this archive: 14 | 15 | wget https://github.com/jonaslindemann/qtcreator-fortran/archive/master.zip 16 | 17 | Unzip the archive: 18 | 19 | unzip master.zip 20 | mv qtcreator-fortran-master/* . 21 | 22 | Restart Qt Creator. 23 | 24 | ## Windows 25 | 26 | Open the **%appdata%\QtProject\qtcreator** folder in explorer. 27 | 28 | Download this archive into the above folder: 29 | 30 | wget https://github.com/jonaslindemann/qtcreator-fortran/archive/master.zip 31 | 32 | Open the zip-file and go into the **qtcreator-fortran-master** folder in the zip file. Select all files and press **Ctrl+C**. Paste the files in the **%appdata%\QtProject\qtcreator** folder. 33 | 34 | # Usage 35 | 36 | When installed Qt Creator can create a CMake based Fortran project as well as create Fortran source files and modules. 37 | 38 | ## Create a Fortran project 39 | 40 | 1. Select **File/New File or Project...** 41 | 2. Select **Non-Qt Project** 42 | 3. Select **Plain Fortran Application** 43 | 4. Click **Choose...** 44 | 45 | Follow the wizard for the rest of the setup. 46 | 47 | ## Adding a Fortran source code 48 | 49 | 1. Select **File/New File or Project...** 50 | 2. Select **Fortran** from **Files and Classes**. 51 | 3. Select **Fortran Source File**. 52 | 4. Click **Choose...** 53 | 54 | Follow the wizard for the rest of the setup. 55 | 56 | ## Adding a Fortran module 57 | 58 | 1. Select **File/New File or Project...** 59 | 2. Select **Fortran** from **Files and Classes**. 60 | 3. Select **Fortran Nodule File**. 61 | 4. Click **Choose...** 62 | 63 | Follow the wizard for the rest of the setup. 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /templates/wizards/projects/extmod/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | 3 | project(%{ProjectName}) 4 | enable_language(Fortran) 5 | 6 | set(LINUX FALSE) 7 | set(BUILD_EXTENSION ON) 8 | set(F2PY_MODULE_NAME "%{ModuleName}") 9 | set(F2PY_IMPL_LIB_NAME "%{ModuleName}_impl") 10 | set(F2PY_INTF_LIB_NAME "%{ModuleName}_intf") 11 | 12 | if (UNIX) 13 | if (NOT APPLE) 14 | set(LINUX TRUE) 15 | endif() 16 | endif() 17 | 18 | message("-- Checking Python distribution...") 19 | find_package(Python COMPONENTS Interpreter Development) 20 | 21 | if (WIN32) 22 | message("-- Checking for Anaconda...") 23 | get_filename_component(PYTHON_DIR ${Python_EXECUTABLE} DIRECTORY ) 24 | if (${PYTHON_DIR} MATCHES "anaconda") 25 | message("-- Anaconda found. Condfiguring f2py...") 26 | set(CONDA_CMD ${PYTHON_DIR}/condabin/conda.bat) 27 | else() 28 | message("-- Anaconda not found. Disable extension build.") 29 | set(BUILD_EXTENSION OFF) 30 | endif() 31 | endif() 32 | 33 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 34 | 35 | file(GLOB FORT_COMMON_SOURCES *.f90) 36 | file(GLOB FORT_INTF_SOURCES *_intf.f90) 37 | file(GLOB FORT_IMPL_SOURCES *_impl.f90) 38 | 39 | list(REMOVE_ITEM FORT_COMMON_SOURCES ${FORT_INTF_SOURCES}) 40 | list(REMOVE_ITEM FORT_COMMON_SOURCES ${FORT_IMPL_SOURCES}) 41 | 42 | add_library(${F2PY_IMPL_LIB_NAME} SHARED ${FORT_COMMON_SOURCES} ${FORT_IMPL_SOURCES}) 43 | add_library(${F2PY_INTF_LIB_NAME} SHARED ${FORT_COMMON_SOURCES} ${FORT_INTF_SOURCES} ${FORT_IMPL_SOURCES}) 44 | 45 | if (WIN32) 46 | message("-- Extension built using Anaconda/F2PY (Windows)...") 47 | add_custom_command(TARGET ${F2PY_IMPL_LIB_NAME} 48 | POST_BUILD 49 | COMMAND ${CONDA_CMD} run python -m numpy.f2py -m ${F2PY_MODULE_NAME} -c ${FORT_COMMON_SOURCES} ${FORT_INTF_SOURCES} --opt=-O3 -l${F2PY_IMPL_LIB_NAME} -L${CMAKE_BINARY_DIR} 50 | ) 51 | # COMMAND ${CONDA_CMD} run python -m numpy.f2py -m particle -c ${PROJECT_SOURCE_DIR}/particle_driver.f90 --opt=-O3 -lpartlib -L${CMAKE_BINARY_DIR} 52 | else() 53 | message("-- Extension module built using f2py...") 54 | add_custom_command(TARGET ${F2PY_IMPL_LIB_NAME} 55 | POST_BUILD 56 | COMMAND f2py -m ${F2PY_MODULE_NAME} -c ${FORT_COMMON_SOURCES} --opt=-O3 -l${F2PY_IMPL_LIB_NAME} -L${CMAKE_BINARY_DIR} 57 | ) 58 | endif() 59 | -------------------------------------------------------------------------------- /templates/wizards/projects/plainfor/wizard.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ], 4 | "id": "R.Plain Fortran Application", 5 | "category": "I.Projects", 6 | "trDescription": "Creates a simple Fortran application with no dependencies.", 7 | "trDisplayName": "Plain Fortran Application", 8 | "trDisplayCategory": "Non-Qt Project", 9 | "icon": "../../global/consoleapplication.png", 10 | "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0 && (value('Plugins').indexOf('QmakeProjectManager') >= 0 || value('Plugins').indexOf('QbsProjectManager') >= 0 || value('Plugins').indexOf('CMakeProjectManager') >= 0)}", 11 | 12 | "options": 13 | [ 14 | { "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : ('%{BuildSystem}' === 'cmake' ? '%{CMakeFile}' : '%{QbsFile}')}" }, 15 | { "key": "ProFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" }, 16 | { "key": "QbsFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qbs')}" }, 17 | { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, 18 | { "key": "CppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" } 19 | ], 20 | 21 | "pages": 22 | [ 23 | { 24 | "trDisplayName": "Project Location", 25 | "trShortTitle": "Location", 26 | "typeId": "Project" 27 | }, 28 | { 29 | "trDisplayName": "Define Build System", 30 | "trShortTitle": "Build System", 31 | "typeId": "Fields", 32 | "enabled": "%{JS: ! %{IsSubproject}}", 33 | "data": 34 | [ 35 | { 36 | "name": "BuildSystem", 37 | "trDisplayName": "Build system:", 38 | "type": "ComboBox", 39 | "persistenceKey": "BuildSystemType", 40 | "data": 41 | { 42 | "index": 0, 43 | "items": 44 | [ 45 | { 46 | "trKey": "CMake", 47 | "value": "cmake", 48 | "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" 49 | } 50 | ] 51 | } 52 | } 53 | ] 54 | }, 55 | { 56 | "trDisplayName": "Kit Selection", 57 | "trShortTitle": "Kits", 58 | "typeId": "Kits", 59 | "enabled": "%{JS: ! %{IsSubproject}}", 60 | "data": { "projectFilePath": "%{ProjectFile}" } 61 | }, 62 | { 63 | "trDisplayName": "Project Management", 64 | "trShortTitle": "Summary", 65 | "typeId": "Summary" 66 | } 67 | ], 68 | "generators": 69 | [ 70 | { 71 | "typeId": "File", 72 | "data": 73 | [ 74 | { 75 | "source": "CMakeLists.txt", 76 | "openAsProject": true, 77 | "condition": "%{JS: '%{BuildSystem}' === 'cmake'}" 78 | }, 79 | { 80 | "source": "main.f90", 81 | "target": "main.f90", 82 | "openInEditor": true 83 | }, 84 | { 85 | "source": "../git.ignore", 86 | "target": ".gitignore", 87 | "condition": "%{JS: ! %{IsSubproject} && '%{VersionControl}' === 'G.Git'}" 88 | } 89 | ] 90 | } 91 | ] 92 | } 93 | -------------------------------------------------------------------------------- /templates/wizards/projects/extmod/wizard.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ], 4 | "id": "R.Fortran F2PY Extension", 5 | "category": "I.Projects", 6 | "trDescription": "Creates a Fortran F2PY extension module skeleton.", 7 | "trDisplayName": "Fortran F2PY Extension", 8 | "trDisplayCategory": "Non-Qt Project", 9 | "icon": "../../global/consoleapplication.png", 10 | "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0 && (value('Plugins').indexOf('QmakeProjectManager') >= 0 || value('Plugins').indexOf('QbsProjectManager') >= 0 || value('Plugins').indexOf('CMakeProjectManager') >= 0)}", 11 | 12 | "options": 13 | [ 14 | { "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : ('%{BuildSystem}' === 'cmake' ? '%{CMakeFile}' : '%{QbsFile}')}" }, 15 | { "key": "ProFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" }, 16 | { "key": "QbsFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qbs')}" }, 17 | { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, 18 | { "key": "CppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" } 19 | ], 20 | 21 | "pages": 22 | [ 23 | { 24 | "trDisplayName": "Project Location", 25 | "trShortTitle": "Location", 26 | "typeId": "Project" 27 | }, 28 | { 29 | "trDisplayName": "Module name", 30 | "trShortTitle": "Module", 31 | "typeId": "Fields", 32 | "data": 33 | [ 34 | { 35 | "name": "ModuleName", 36 | "type": "LineEdit", 37 | "trDisplayName": "Module name:", 38 | "mandatory": true, 39 | "data": {"trText": "extmod"} 40 | } 41 | ] 42 | }, 43 | { 44 | "trDisplayName": "Define Build System", 45 | "trShortTitle": "Build System", 46 | "typeId": "Fields", 47 | "enabled": "%{JS: ! %{IsSubproject}}", 48 | "data": 49 | [ 50 | { 51 | "name": "BuildSystem", 52 | "trDisplayName": "Build system:", 53 | "type": "ComboBox", 54 | "persistenceKey": "BuildSystemType", 55 | "data": 56 | { 57 | "index": 0, 58 | "items": 59 | [ 60 | { 61 | "trKey": "CMake", 62 | "value": "cmake", 63 | "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" 64 | } 65 | ] 66 | } 67 | } 68 | ] 69 | }, 70 | { 71 | "trDisplayName": "Kit Selection", 72 | "trShortTitle": "Kits", 73 | "typeId": "Kits", 74 | "enabled": "%{JS: ! %{IsSubproject}}", 75 | "data": { "projectFilePath": "%{ProjectFile}" } 76 | }, 77 | { 78 | "trDisplayName": "Project Management", 79 | "trShortTitle": "Summary", 80 | "typeId": "Summary" 81 | } 82 | ], 83 | "generators": 84 | [ 85 | { 86 | "typeId": "File", 87 | "data": 88 | [ 89 | { 90 | "source": "CMakeLists.txt", 91 | "openAsProject": true, 92 | "condition": "%{JS: '%{BuildSystem}' === 'cmake'}" 93 | }, 94 | { 95 | "source": "extmodule_const.f90", 96 | "target": "%{ModuleName}_const.f90", 97 | "openInEditor": true 98 | }, 99 | { 100 | "source": "extmodule_intf.f90", 101 | "target": "%{ModuleName}_intf.f90", 102 | "openInEditor": true 103 | }, 104 | { 105 | "source": "extmodule_impl.f90", 106 | "target": "%{ModuleName}_impl.f90", 107 | "openInEditor": true 108 | }, 109 | { 110 | "source": "../git.ignore", 111 | "target": ".gitignore", 112 | "condition": "%{JS: ! %{IsSubproject} && '%{VersionControl}' === 'G.Git'}" 113 | } 114 | ] 115 | } 116 | ] 117 | } 118 | -------------------------------------------------------------------------------- /generic-highlighter/fortran.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | allocate 12 | break 13 | call 14 | case 15 | common 16 | contains 17 | continue 18 | cycle 19 | deallocate 20 | default 21 | 22 | forall 23 | where 24 | elsewhere 25 | 26 | 27 | equivalence 28 | exit 29 | external 30 | for 31 | go 32 | goto 33 | if 34 | implicit 35 | include 36 | interface 37 | intrinsic 38 | namelist 39 | none 40 | nullify 41 | operator 42 | assignment 43 | pause 44 | procedure 45 | pure 46 | elemental 47 | record 48 | recursive 49 | result 50 | return 51 | select 52 | selectcase 53 | stop 54 | 55 | to 56 | use 57 | only 58 | entry 59 | while 60 | 61 | 62 | access 63 | backspace 64 | close 65 | inquire 66 | open 67 | print 68 | read 69 | rewind 70 | write 71 | format 72 | 73 | 75 | 76 | unit 77 | end 78 | err 79 | fmt 80 | iostat 81 | status 82 | advance 83 | size 84 | eor 85 | 86 | 87 | 88 | unit 89 | iostat 90 | err 91 | file 92 | status 93 | access 94 | form 95 | recl 96 | blank 97 | position 98 | action 99 | delim 100 | pad 101 | 102 | 103 | 104 | unit 105 | iostat 106 | err 107 | file 108 | exist 109 | opened 110 | number 111 | named 112 | name 113 | access 114 | sequential 115 | direct 116 | form 117 | formatted 118 | unformatted 119 | recl 120 | nextrec 121 | blank 122 | position 123 | action 124 | read 125 | write 126 | readwrite 127 | delim 128 | pad 129 | 130 | 131 | double 132 | precision 133 | parameter 134 | save 135 | pointer 136 | public 137 | private 138 | target 139 | allocatable 140 | optional 141 | sequence 142 | 143 | 144 | 154 | 155 | 156 | 157 | 158 | abs 159 | cabs 160 | dabs 161 | iabs 162 | aimag 163 | aint 164 | dint 165 | anint 166 | dnint 167 | ceiling 168 | cmplx 169 | dcmplx 170 | dimag 171 | floor 172 | nint 173 | idnint 174 | int 175 | idint 176 | ifix 177 | real 178 | float 179 | sngl 180 | dble 181 | dreal 182 | aprime 183 | dconjg 184 | dfloat 185 | ddmim 186 | rand 187 | 188 | modulo 189 | conjg 190 | dprod 191 | dim 192 | ddim 193 | idim 194 | max 195 | amax0 196 | amax1 197 | max0 198 | max1 199 | dmax1 200 | min 201 | amin0 202 | amin1 203 | min0 204 | min1 205 | dmin1 206 | mod 207 | amod 208 | dmod 209 | sign 210 | dsign 211 | isign 212 | 213 | acos 214 | dacos 215 | asin 216 | dasin 217 | atan 218 | datan 219 | atan2 220 | datan2 221 | cos 222 | ccos 223 | dcos 224 | cosh 225 | dcosh 226 | exp 227 | cexp 228 | dexp 229 | log 230 | alog 231 | dlog 232 | clog 233 | log10 234 | alog10 235 | dlog10 236 | sin 237 | csin 238 | dsin 239 | sinh 240 | dsinh 241 | sqrt 242 | csqrt 243 | dsqrt 244 | tan 245 | dtan 246 | tanh 247 | dtanh 248 | 249 | 250 | achar 251 | char 252 | iachar 253 | ichar 254 | 255 | lge 256 | lgt 257 | lle 258 | llt 259 | 260 | adjustl 261 | adjustr 262 | index 263 | len_trim 264 | scan 265 | verify 266 | 267 | logical 268 | 269 | exponent 270 | fraction 271 | nearest 272 | rrspacing 273 | scale 274 | set_exponent 275 | spacing 276 | 277 | btest 278 | iand 279 | ibclr 280 | ibits 281 | ibset 282 | ieor 283 | ior 284 | ishft 285 | ishftc 286 | not 287 | 288 | mvbits 289 | 290 | merge 291 | 292 | 293 | 294 | 295 | 296 | associated 297 | present 298 | kind 299 | 300 | len 301 | 302 | digits 303 | epsilon 304 | huge 305 | maxexponent 306 | minexponent 307 | precision 308 | radix 309 | range 310 | tiny 311 | 312 | bit_size 313 | 314 | allocated 315 | lbound 316 | ubound 317 | shape 318 | size 319 | 320 | 321 | 322 | 323 | 324 | repeat 325 | trim 326 | 327 | selected_int_kind 328 | selected_real_kind 329 | 330 | transfer 331 | 332 | dot_product 333 | matmul 334 | 335 | all 336 | any 337 | count 338 | maxval 339 | minval 340 | product 341 | sum 342 | 343 | pack 344 | unpack 345 | 346 | reshape 347 | 348 | spread 349 | 350 | cshift 351 | eoshift 352 | 353 | transpose 354 | 355 | maxloc 356 | minloc 357 | 358 | 359 | 360 | 361 | 362 | date_and_time 363 | system_clock 364 | 365 | random_number 366 | random_seed 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | --------------------------------------------------------------------------------