Skip to content

Commit

Permalink
Merge 5eab9a1 into 822c8fe
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Jul 4, 2018
2 parents 822c8fe + 5eab9a1 commit 4ded87b
Show file tree
Hide file tree
Showing 24 changed files with 109 additions and 179 deletions.
72 changes: 36 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,45 @@ else()
endif()
endif()

# Determine the effective build directory

set(PROJECT_BUILD_DIR ${CMAKE_BINARY_DIR})

if(APPLE AND "${CMAKE_GENERATOR}" STREQUAL "Xcode")
# With Xcode, we have a configuration directory, but it messes up our build
# system, so ask for all the binaries to be generated in our build folder

set(XCODE TRUE)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BUILD_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BUILD_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BUILD_DIR})

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BUILD_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BUILD_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BUILD_DIR})

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BUILD_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BUILD_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BUILD_DIR})
else()
# Check whether there is a configuration directory (the case with MSVC) and,
# if so, make use of it

set(XCODE FALSE)

if(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
set(PROJECT_BUILD_DIR ${PROJECT_BUILD_DIR}/${CMAKE_CFG_INTDIR})
endif()
endif()

# Make sure that we are building OpenCOR on a supported architecture
# Note: normally, we would check the value of CMAKE_SIZEOF_VOID_P, but in some
# cases it may not be set (e.g. when generating an Xcode project file), so
# we determine and retrieve that value ourselves...

try_run(ARCHITECTURE_RUN ARCHITECTURE_COMPILE
${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/architecture.c
${PROJECT_BUILD_DIR} ${CMAKE_SOURCE_DIR}/cmake/architecture.c
RUN_OUTPUT_VARIABLE ARCHITECTURE)

if(NOT ARCHITECTURE_COMPILE)
Expand Down Expand Up @@ -95,7 +127,7 @@ endif()
# Try to build our runpath2rpath program, if we are on Linux

if(NOT WIN32 AND NOT APPLE)
set(RUNPATH2RPATH ${CMAKE_BINARY_DIR}/runpath2rpath)
set(RUNPATH2RPATH ${PROJECT_BUILD_DIR}/runpath2rpath)

execute_process(COMMAND ${CMAKE_C_COMPILER} -O3 -o ${RUNPATH2RPATH} ${PROJECT_SOURCE_DIR}/cmake/runpath2rpath.c
RESULT_VARIABLE RESULT OUTPUT_QUIET ERROR_QUIET)
Expand All @@ -111,7 +143,7 @@ find_program(CLCACHE clcache)
find_program(CCACHE ccache)

if(CLCACHE)
set(CLCACHEWRAPPER ${CMAKE_BINARY_DIR}/clcachewrapper)
set(CLCACHEWRAPPER ${PROJECT_BUILD_DIR}/clcachewrapper)

execute_process(COMMAND ${CMAKE_C_COMPILER} /O2 /Fe${CLCACHEWRAPPER} ${PROJECT_SOURCE_DIR}/cmake/clcachewrapper.c
RESULT_VARIABLE RESULT OUTPUT_QUIET ERROR_QUIET)
Expand Down Expand Up @@ -168,38 +200,6 @@ endif()

set(PLATFORM_DIR ${PLATFORM})

# Determine the effective build directory

set(PROJECT_BUILD_DIR ${CMAKE_BINARY_DIR})

if(APPLE AND "${CMAKE_GENERATOR}" STREQUAL "Xcode")
# With Xcode, we have a configuration directory, but it messes up our build
# system, so ask for all the binaries to be generated in our build folder

set(XCODE TRUE)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BUILD_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BUILD_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BUILD_DIR})

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BUILD_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BUILD_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BUILD_DIR})

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BUILD_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BUILD_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BUILD_DIR})
else()
# Check whether there is a configuration directory (the case with MSVC) and,
# if so, make use of it

set(XCODE FALSE)

if(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
set(PROJECT_BUILD_DIR ${PROJECT_BUILD_DIR}/${CMAKE_CFG_INTDIR})
endif()
endif()

# Default location of external binaries and packages

if(WIN32)
Expand Down Expand Up @@ -255,7 +255,7 @@ include(${CMAKE_SOURCE_DIR}/cmake/common.cmake)

include(ExternalProject)

set(EXTERNAL_PROJECT_BUILD_DIR ${CMAKE_BINARY_DIR}/ext)
set(EXTERNAL_PROJECT_BUILD_DIR ${PROJECT_BUILD_DIR}/ext)

set_property(DIRECTORY PROPERTY EP_BASE ${EXTERNAL_PROJECT_BUILD_DIR})

Expand Down
23 changes: 11 additions & 12 deletions cmake/clcachewrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//==============================================================================

#include <stdio.h>
#include <stdlib.h>

//==============================================================================

Expand All @@ -33,28 +34,26 @@ int main(int pArgC, char *pArgV[])
#define STRING_SIZE 32768

char clcacheCommand[STRING_SIZE] = "clcache";
char clcacheArgument[STRING_SIZE];
int k = 6;

for (int i = 2; i < pArgC; ++i) {
int k = -1;
clcacheCommand[++k] = ' ';

for (int j = 0, jMax = strlen(pArgV[i]); j < jMax; ++j) {
for (int j = 0; pArgV[i][j]; ++j) {
if (pArgV[i][j] == '\\') {
clcacheArgument[++k] = '\\';
clcacheArgument[++k] = '\\';
clcacheCommand[++k] = '\\';
clcacheCommand[++k] = '\\';
} else if (pArgV[i][j] == '"') {
clcacheArgument[++k] = '\\';
clcacheArgument[++k] = '"';
clcacheCommand[++k] = '\\';
clcacheCommand[++k] = '"';
} else {
clcacheArgument[++k] = pArgV[i][j];
clcacheCommand[++k] = pArgV[i][j];
}
}

clcacheArgument[++k] = '\0';

sprintf(clcacheCommand, "%s %s", clcacheCommand, clcacheArgument);
}

clcacheCommand[++k] = '\0';

return system(clcacheCommand);
}

Expand Down
2 changes: 1 addition & 1 deletion cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ macro(add_plugin PLUGIN_NAME)
string(REPLACE "${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/" ""
PLUGIN_BUILD_DIR "${PROJECT_SOURCE_DIR}")

set(PLUGIN_BUILD_DIR ${CMAKE_BINARY_DIR}/${PLUGIN_BUILD_DIR})
set(PLUGIN_BUILD_DIR ${PROJECT_BUILD_DIR}/${PLUGIN_BUILD_DIR})

if(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
set(PLUGIN_BUILD_DIR ${PLUGIN_BUILD_DIR}/${CMAKE_CFG_INTDIR})
Expand Down
18 changes: 9 additions & 9 deletions src/3rdparty/QtWebKit/README.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
In order to build `QtWebKit <https://wiki.qt.io/QtWebKit>`_, we need to:
In order to build `QtWebKit <https://wiki.qt.io/QtWebKit>`__, we need to:

- **Windows:** install:

- `Perl 5.22 <http://www.activestate.com/activeperl/>`_;
- `Python 2.7 <https://www.python.org/>`_;
- `Ruby >= 1.9 <http://rubyinstaller.org/>`_;
- `Bison and Flex <https://sourceforge.net/projects/winflexbison/>`_ (make a copy of ``win_flex.exe`` and name it ``flex.exe``);
- `gperf <http://gnuwin32.sourceforge.net/packages/gperf.htm>`_; and
- `Perl 5.22 <http://www.activestate.com/activeperl/>`__;
- `Python 2.7 <https://www.python.org/>`__;
- `Ruby >= 1.9 <http://rubyinstaller.org/>`__;
- `Bison and Flex <https://sourceforge.net/projects/winflexbison/>`__ (make a copy of ``win_flex.exe`` and name it ``flex.exe``);
- `gperf <http://gnuwin32.sourceforge.net/packages/gperf.htm>`__; and

**Note:** the `GnuWin32 <http://gnuwin32.sourceforge.net/>`_ version of `Flex <http://gnuwin32.sourceforge.net/packages/flex.htm>`_ is not suitable, hence we must use `Win flex-bison <https://sourceforge.net/projects/winflexbison/>`_ instead.
**Note:** the `GnuWin32 <http://gnuwin32.sourceforge.net/>`__ version of `Flex <http://gnuwin32.sourceforge.net/packages/flex.htm>`__ is not suitable, hence we must use `Win flex-bison <https://sourceforge.net/projects/winflexbison/>`__ instead.

There are additional dependencies (``ICU``, ``libjpeg``, ``libpng``, ``libxml2``, ``libxslt``, ``SQLite`` and ``zlib``) that are automatically downloaded upon building QtWebKit.
(The prebuilt version of those binaries originally comes from `https://github.com/Vitallium/qtwebkit-libs-win/releases <https://github.com/Vitallium/qtwebkit-libs-win/releases>`_, to which we removed unneeded files.)
(The prebuilt version of those binaries originally comes from `https://github.com/Vitallium/qtwebkit-libs-win/releases <https://github.com/Vitallium/qtwebkit-libs-win/releases>`__, to which we removed unneeded files.)

- **Linux:** run the following command from the terminal:

::

sudo apt install bison gperf libsqlite3-dev libxml2-dev libxslt1-dev nasm ruby zlib1g-dev

- **macOS:** run the following command from the terminal (if needed, install `Homebrew <https://brew.sh/>`_):
- **macOS:** run the following command from the terminal (if needed, install `Homebrew <https://brew.sh/>`__):

::

Expand Down
6 changes: 3 additions & 3 deletions src/3rdparty/diff_match_patch/README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
The original `diff-match-patch <https://code.google.com/p/google-diff-match-patch/>`_ code used to be hosted on `Google Code <https://code.google.com/>`_, but that site has since been shut down.
A copy can still be found on the `author's website <https://neil.fraser.name/software/diff_match_patch/svn/trunk/cpp/>`_, but we still went for an `STL version <https://github.com/leutloff/diff-match-patch-cpp-stl>`_ of that code instead.
Indeed, not only is that `STL version <https://github.com/leutloff/diff-match-patch-cpp-stl>`_ maintained, but it is also supposed to be faster and it comes as a header file only, which makes it easier for us to use throughout OpenCOR (since it does not require creating a special plugin for it).
The original `diff-match-patch <https://code.google.com/p/google-diff-match-patch/>`__ code used to be hosted on `Google Code <https://code.google.com/>`__, but that site has since been shut down.
A copy can still be found on the `author's website <https://neil.fraser.name/software/diff_match_patch/svn/trunk/cpp/>`__, but we still went for an `STL version <https://github.com/leutloff/diff-match-patch-cpp-stl>`__ of that code instead.
Indeed, not only is that `STL version <https://github.com/leutloff/diff-match-patch-cpp-stl>`__ maintained, but it is also supposed to be faster and it comes as a header file only, which makes it easier for us to use throughout OpenCOR (since it does not require creating a special plugin for it).
6 changes: 3 additions & 3 deletions src/plugins/miscellaneous/Core/res/web-xslt/README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
There are two `XSL <https://www.w3.org/Style/XSL/>`_ files for converting `Content MathML <https://www.w3.org/TR/MathML3/chapter4.html>`_ to `Presentation MathML <https://www.w3.org/TR/MathML2/chapter2.html>`_: |ctop.xsl|_ and |ctopff.xsl|_.
There are two `XSL <https://www.w3.org/Style/XSL/>`__ files for converting `Content MathML <https://www.w3.org/TR/MathML3/chapter4.html>`__ to `Presentation MathML <https://www.w3.org/TR/MathML2/chapter2.html>`__: |ctop.xsl|_ and |ctopff.xsl|_.
The difference between the two is that |ctopff.xsl|_ uses a modified namespace and mode usage.
Those differences are necessary if we want to use the `XSL <https://www.w3.org/Style/XSL/>`_ file with `Firefox <https://www.mozilla.org/en-US/firefox/new/>`_ (hence the file name!) and, as it happens, they are also necessary for use with `Qt <https://www.qt.io/>`_ and `QtWebKit <https://wiki.qt.io/QtWebKit>`_ in particular.
Those differences are necessary if we want to use the `XSL <https://www.w3.org/Style/XSL/>`__ file with `Firefox <https://www.mozilla.org/en-US/firefox/new/>`__ (hence the file name!) and, as it happens, they are also necessary for use with `Qt <https://www.qt.io/>`__ and `QtWebKit <https://wiki.qt.io/QtWebKit>`__ in particular.
This is therefore the version we use here.
However, the `Presentation MathML <https://www.w3.org/TR/MathML2/chapter2.html>`_ it generates is not exactly what we want, so we edited the file quite a bit.
However, the `Presentation MathML <https://www.w3.org/TR/MathML2/chapter2.html>`__ it generates is not exactly what we want, so we edited the file quite a bit.

.. |ctop.xsl| replace:: ``ctop.xsl``
.. _ctop.xsl: https://github.com/davidcarlisle/web-xslt/blob/master/ctop/ctop.xsl
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/miscellaneous/HelpWindow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ project(HelpWindowPlugin)
# Generate the help files which will be embedded in the executable as a resource

execute_process(COMMAND ${QT_BINARY_DIR}/qcollectiongenerator ${PROJECT_BUILD_DIR}/doc/${CMAKE_PROJECT_NAME}.qhcp
-o ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.qhc
-o ${PROJECT_BUILD_DIR}/${CMAKE_PROJECT_NAME}.qhc
OUTPUT_QUIET)

keep_track_of_file(${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.qch)
keep_track_of_file(${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.qhc)
keep_track_of_file(${PROJECT_BUILD_DIR}/${CMAKE_PROJECT_NAME}.qch)
keep_track_of_file(${PROJECT_BUILD_DIR}/${CMAKE_PROJECT_NAME}.qhc)

# Add the plugin

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/support/ZIPSupport/README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Support for the `ZIP format <https://en.wikipedia.org/wiki/Zip_(file_format)>`_ is done through `Qt <https://www.qt.io/>`_'s undocumented (and inaccessible, by default) ``QZipReader`` and ``QZipWriter`` classes.
Support for the `ZIP format <https://en.wikipedia.org/wiki/Zip_(file_format)>`__ is done through `Qt <https://www.qt.io/>`__'s undocumented (and inaccessible, by default) ``QZipReader`` and ``QZipWriter`` classes.
For this, we rely on the following files:

- |[QtSource]/qtbase/src/gui/text/qzip.cpp|_;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/thirdParty/CellMLAPI/README.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Windows binaries for `omniidl <http://omniorb.sourceforge.net/>`_ can be found `here <http://sourceforge.net/projects/omniorb/files/omniORB/omniORB-4.1.5/>`_.
Windows binaries for `omniidl <http://omniorb.sourceforge.net/>`__ can be found `here <http://sourceforge.net/projects/omniorb/files/omniORB/omniORB-4.1.5/>`__.
2 changes: 1 addition & 1 deletion src/plugins/thirdParty/Qwt/README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
When building `Qwt <http://qwt.sourceforge.net/>`_, both `[OpenCOR]/build/ext/Build/QwtBuild/src/Makefile.Release` and `[OpenCOR]/build/ext/Build/QwtBuild/src/Makefile.Debug` get generated.
When building `Qwt <http://qwt.sourceforge.net/>`__, both `[OpenCOR]/build/ext/Build/QwtBuild/src/Makefile.Release` and `[OpenCOR]/build/ext/Build/QwtBuild/src/Makefile.Debug` get generated.
Towards the top of those files, there are two lines that read:

::
Expand Down
8 changes: 0 additions & 8 deletions src/plugins/widget/EditorWidget/i18n/EditorWidget_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,5 @@
<source>The search uses a regular expression</source>
<translation>La recherche utilise une expression régulière</translation>
</message>
<message>
<source>Clear Text</source>
<translation>Effacer Texte</translation>
</message>
<message>
<source>Clear the text</source>
<translation>Effacer le texte</translation>
</message>
</context>
</TS>
9 changes: 4 additions & 5 deletions src/plugins/widget/EditorWidget/res/EditorWidget_ui.qrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<RCC>
<qresource prefix="/EditorWidget">
<file>qtCreator/src/plugins/coreplugin/find/images/casesensitively.png</file>
<file>qtCreator/src/plugins/coreplugin/find/images/regexp.png</file>
<file>qtCreator/src/plugins/coreplugin/find/images/wholewords.png</file>
<file>qtCreator/src/plugins/coreplugin/images/editclear.png</file>
<file>qtCreator/src/plugins/coreplugin/images/magnifier.png</file>
<file>casesensitively.png</file>
<file>magnifier.png</file>
<file>regexp.png</file>
<file>wholewords.png</file>
</qresource>
</RCC>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/plugins/widget/EditorWidget/res/magnifier.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/plugins/widget/EditorWidget/res/regexp.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/plugins/widget/EditorWidget/res/wholewords.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4ded87b

Please sign in to comment.