...
 
Commits (43)
stages:
- build
- deploy
gcc-c++11:
stage: build
script: "CI/ci-linux.sh gcc C++11"
tags:
- Linux
clang-c++11:
stage: build
script: "CI/ci-linux.sh clang C++11"
tags:
- Linux
gcc-c++14:
stage: build
script: "CI/ci-linux.sh gcc C++14"
tags:
- Linux
clang-c++14:
stage: build
script: "CI/ci-linux.sh clang C++14"
tags:
- Linux
macos-c++11:
stage: build
script: "CI/ci-mac.sh C++11"
tags:
- Apple
......@@ -28,6 +37,7 @@ macos-c++11:
- build-release-cpp11/*.tar.gz
macos-c++98:
stage: build
script: "CI/ci-mac.sh C++14"
tags:
- Apple
......@@ -37,68 +47,47 @@ macos-c++98:
- build-release-cpp14/*.tar.gz
cppcheck:
stage: build
script: "CI/ci-cppcheck.sh"
tags:
- Linux
artifacts:
paths:
- cppcheck.log
.VS2015-64-bit-shared-apps:
VS2017-64-bit-shared-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2015"
BUILD_PLATFORM: "VS2017"
ARCHITECTURE: "x64"
SHARED: "TRUE"
APPS: "ON"
script: "CI\\Windows.bat"
tags:
- VS2015
artifacts:
paths:
- build-release/*.exe
.VS2015-32-bit-shared-apps:
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x32"
SHARED: "TRUE"
APPS: "ON"
script: "CI\\Windows.bat"
tags:
- VS2015
- VS2017
- Qt5101
artifacts:
paths:
- build-release/*.exe
.VS2015-64-bit-static-apps:
- build-release/*.exe
VS2017-64-bit-static-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2015"
BUILD_PLATFORM: "VS2017"
ARCHITECTURE: "x64"
SHARED: "FALSE"
APPS: "ON"
script: "CI\\Windows.bat"
tags:
- VS2015
artifacts:
paths:
- build-release/*.exe
.VS2015-32-bit-static-apps:
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x32"
SHARED: "FALSE"
APPS: "ON"
script: "CI\\Windows.bat"
tags:
- VS2015
- VS2017
- Qt5101
artifacts:
paths:
- build-release/*.exe
VS2017-64-bit-shared-no-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2017"
ARCHITECTURE: "x64"
......@@ -113,6 +102,7 @@ VS2017-64-bit-shared-no-apps:
VS2017-32-bit-shared-no-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2017"
ARCHITECTURE: "x32"
......@@ -127,6 +117,7 @@ VS2017-32-bit-shared-no-apps:
VS2017-64-bit-static-no-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2017"
ARCHITECTURE: "x64"
......@@ -141,6 +132,7 @@ VS2017-64-bit-static-no-apps:
VS2017-32-bit-static-no-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2017"
ARCHITECTURE: "x32"
......@@ -154,6 +146,7 @@ VS2017-32-bit-static-no-apps:
- build-release/*.exe
VS2015-64-bit-shared-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x64"
......@@ -168,6 +161,7 @@ VS2015-64-bit-shared-apps:
VS2015-64-bit-shared-no-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x64"
......@@ -181,6 +175,7 @@ VS2015-64-bit-shared-no-apps:
- build-release/*.exe
VS2015-32-bit-shared-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x32"
......@@ -194,6 +189,7 @@ VS2015-32-bit-shared-apps:
- build-release/*.exe
VS2015-32-bit-shared-no-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x32"
......@@ -207,6 +203,7 @@ VS2015-32-bit-shared-no-apps:
- build-release/*.exe
VS2015-64-bit-static-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x64"
......@@ -220,6 +217,7 @@ VS2015-64-bit-static-apps:
- build-release/*.exe
VS2015-64-bit-static-no-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x64"
......@@ -233,6 +231,7 @@ VS2015-64-bit-static-no-apps:
- build-release/*.exe
VS2015-32-bit-static-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x32"
......@@ -246,6 +245,7 @@ VS2015-32-bit-static-apps:
- build-release/*.exe
VS2015-32-bit-static-no-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x32"
......@@ -261,6 +261,7 @@ VS2015-32-bit-static-no-apps:
VS2013-64-bit-shared-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x64"
......@@ -274,6 +275,7 @@ VS2013-64-bit-shared-apps:
- build-release/*.exe
VS2013-64-bit-shared-no-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x64"
......@@ -287,6 +289,7 @@ VS2013-64-bit-shared-no-apps:
- build-release/*.exe
VS2013-32-bit-shared-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x32"
......@@ -300,6 +303,7 @@ VS2013-32-bit-shared-apps:
- build-release/*.exe
VS2013-32-bit-shared-no-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x32"
......@@ -313,6 +317,7 @@ VS2013-32-bit-shared-no-apps:
- build-release/*.exe
VS2013-64-bit-static-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x64"
......@@ -326,6 +331,7 @@ VS2013-64-bit-static-apps:
- build-release/*.exe
VS2013-64-bit-static-no-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x64"
......@@ -339,6 +345,7 @@ VS2013-64-bit-static-no-apps:
- build-release/*.exe
VS2013-32-bit-static-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x32"
......@@ -352,6 +359,7 @@ VS2013-32-bit-static-apps:
- build-release/*.exe
VS2013-32-bit-static-no-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x32"
......@@ -365,8 +373,21 @@ VS2013-32-bit-static-no-apps:
- build-release/*.exe
Doc-publish:
stage: deploy
only:
- master
script: "CI/ci-doc.sh"
tags:
- Linux
Sources:
stage: deploy
only:
- master
script: "CI/ci-source.sh"
artifacts:
paths:
- OpenMesh*.zip
- OpenMesh*.tar.bz2
- OpenMesh*.tar.gz
......@@ -21,7 +21,6 @@ IF "%BUILD_PLATFORM%" == "VS2012" (
set GTESTVERSION=gtest-1.6.0
set GENERATOR=Visual Studio 11%ARCH_VS%
set VS_PATH="C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.com"
set QT_VERSION=
IF "%ARCHITECTURE%" == "x64" (
set QT_INSTALL_PATH=E:\Qt\4.8.5-vs2012-%STRING_ARCH%\
set QT_BASE_CONFIG=-DQT_QMAKE_EXECUTABLE=E:\Qt\4.8.5-vs2012-%STRING_ARCH%\bin\qmake.exe
......@@ -38,7 +37,6 @@ IF "%BUILD_PLATFORM%" == "VS2013" (
set GTESTVERSION=gtest-1.6.0
set GENERATOR=Visual Studio 12%ARCH_VS%
set VS_PATH="C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.com"
set QT_VERSION=
IF "%ARCHITECTURE%" == "x64" (
set QT_INSTALL_PATH=E:\Qt\Qt5.3.1-vs2013-%STRING_ARCH%\5.3\msvc2013_64_opengl
set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.3.1-vs2013-%STRING_ARCH%\5.3\msvc2013_64_opengl
......@@ -56,7 +54,6 @@ IF "%BUILD_PLATFORM%" == "VS2015" (
set GENERATOR=Visual Studio 14%ARCH_VS%
set VS_PATH="C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.com"
set QT_VERSION=
IF "%ARCHITECTURE%" == "x64" (
set QT_INSTALL_PATH=E:\Qt\Qt5.6.0-vs2015-%STRING_ARCH%\5.6\msvc2015_64
set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.6.0-vs2015-%STRING_ARCH%\5.6\msvc2015_64
......@@ -75,7 +72,6 @@ IF "%BUILD_PLATFORM%" == "VS2017" (
set GENERATOR=Visual Studio 15%ARCH_VS%
set VS_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.com"
set QT_VERSION=
IF "%ARCHITECTURE%" == "x64" (
set QT_INSTALL_PATH=E:\Qt\Qt5.10.1\5.10.1\msvc2017_64
set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.10.1\5.10.1\msvc2017_64
......@@ -93,19 +89,29 @@ IF "%APPS%" == "ON" (
REM Copy the platform plugins subdirectory for the qt plugins required to run the gui apps
xcopy /Y %QT_INSTALL_PATH%\plugins\platforms Build\plugins\platforms
IF "%BUILD_PLATFORM%" == "VS2015" (
set CMAKE_CONFIGURATION=%QT_BASE_CONFIG% -DGLUT_INCLUDE_DIR="%LIBPATH%\%ARCHITECTURE%\freeglut-3.0.0\include" -DGLUT_glut_LIBRARY="%LIBPATH%\%ARCHITECTURE%\freeglut-3.0.0\lib\freeglut.lib"
) ELSE (
set CMAKE_CONFIGURATION=%QT_BASE_CONFIG% -DGLUT_INCLUDE_DIR="%LIBPATH%\%ARCHITECTURE%\freeglut-2.8.1\include" -DGLUT_glut_LIBRARY="%LIBPATH%\%ARCHITECTURE%\freeglut-2.8.1\lib\freeglut.lib"
)
set CMAKE_CONFIGURATION=%QT_BASE_CONFIG%
) ELSE (
set STRING_APPS=-no-apps
set CMAKE_CONFIGURATION=
)
ECHO "============================================================="
ECHO "============================================================="
ECHO "Building with :"
ECHO "ARCHITECTURE : %ARCHITECTURE%"
ECHO "BUILD_PLATFORM : %BUILD_PLATFORM%"
ECHO "GTESTVERSION : %GTESTVERSION%"
ECHO "GENERATOR : %GENERATOR%"
ECHO "VS_PATH : %VS_PATH%"
ECHO "LIBPATH : %LIBPATH%"
ECHO "APPS : %APPS%"
ECHO "SHARED : %SHARED%"
ECHO "QT_INSTALL_PATH : %QT_INSTALL_PATH%"
ECHO "CMAKE_CONFIGURATION : %CMAKE_CONFIGURATION%"
ECHO "============================================================="
ECHO "============================================================="
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Release -DBUILD_APPS=%APPS% -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DCMAKE_WINDOWS_LIBS_DIR="e:\libs" -DOPENMESH_BUILD_SHARED=%SHARED% %CMAKE_CONFIGURATION% ..
......@@ -163,7 +169,7 @@ del *.exe
IF %errorlevel% NEQ 0 exit /b %errorlevel%
move OpenMesh-*.exe "OpenMesh-7.0-Git-Master-%CI_BUILD_REF%-%BUILD_PLATFORM%-%STRING_ARCH%%STRING_DLL%%STRING_APPS%.exe"
move OpenMesh-*.exe "OpenMesh-7.1-Git-Master-%CI_BUILD_REF%-%BUILD_PLATFORM%-%STRING_ARCH%%STRING_DLL%%STRING_APPS%.exe"
# This script just creates compressed files of OpenMesh sources
# Create Build directory and Build documentation
mkdir build-doc
cd build-doc
cmake ..
make doc
cd ..
# Extract Version Information
VERSION=OpenMesh-$(cat VERSION | grep VERSION | tr -d "VERSION=")
# Create Publishing directory
mkdir $VERSION
# Move all files into Publishing directory
mv CHANGELOG.md $VERSION/
mv cmake $VERSION/
mv CMakeLists.txt $VERSION/
mv debian $VERSION/
mv Doc $VERSION/
mv LICENSE $VERSION/
mv README.md $VERSION/
mv src $VERSION/
mv VERSION $VERSION/
mv build-doc/Build/share/OpenMesh/Doc/html/ $VERSION/Documentation
tar cjf $VERSION.tar.bz2 $VERSION
tar czf $VERSION.tar.gz $VERSION
zip -9 -q -r $VERSION.zip $VERSION
cmake_minimum_required (VERSION 2.6)
# Set and enforce C++-11 flags
set( CMAKE_CXX_STANDARD_REQUIRED TRUE )
set( CMAKE_CXX_STANDARD 11 )
enable_testing()
# Only set project name if OpenMesh is built as stand-alone library
......@@ -41,6 +46,7 @@ if(${PROJECT_NAME} MATCHES "OpenMesh")
endif()
include (ACGOutput)
include(ACGQt)
# ========================================================================
# Definitions
......
......@@ -7,12 +7,29 @@
<!-- --------------------------------------------------------------------- -->
<tr valign=top><td><b>7.1</b> (?/?/?)</td><td>
<tr valign=top><td><b>7.2</b> (?/?/?)</td><td>
</tr>
<b>General</b>
<tr valign=top><td><b>7.1</b> (2018/05/29)</td><td>
<b>IO</b>
<ul>
<li>Fixed slow OBJ reader (Thanks to Etienne Danvoye for the patch) </li>
</ul>
<b>Documentation</b>
<ul>
<li>Updated build instructions.</li>
</ul>
<b>Build System</b>
<ul>
<li>Default to C++11 in cmake files</li>
<li>Remove old qmake project files. Unmaintained for a very long time</li>
<li>Replaced Qt finders</li>
<li>Added VS 2017 to CI builds</li>
</ul>
</tr>
......
//-----------------------------------------------------------------------------
/** \page compiling Compiling OpenMesh
\section compilers Tested compilers
%OpenMesh has been successfully tested for the following operating
systems / compilers. This is only a list of tested compilers.
More might be supported but are not tested. Make sure that your compiler
supports at least C++11
<table>
<tr><td> Linux </td><td>
gcc >= 4.8.x<br>
clang >= 3.3<br>
</td></tr>
<tr><td> Windows </td><td>
Microsoft Visual Studio 2013<br>
Microsoft Visual Studio 2015<br>
Microsoft Visual Studio 2017<br>
</td></tr>
<tr><td> Tested MacOS X Compilers</td>
<td>
XCode <br>
</td></tr>
</table>
\section req_libs Required libraries (Only if you want to build the included Apps)
Install the following external libraries / frameworks if you want to use the included Applications:<br><br>
<table>
<tr><td>Qt5</td><td><a href="http://qt-project.org/downloads" target="_blank">https://www.qt.io/download</a></td></tr>
</table><br>
\section build_systems Chosing build system
%OpenMesh can be built using the <b>cmake</b> build system.
<br>
<br>
\section sec_compiling_unix Unix
\subsection linux_using_cmake Compiling OpenMesh using CMake
In order to compile %OpenMesh, create a directory named e.g. "build" in
OpenMesh's root directory. <b>Change to the newly created directory</b> and type
<br/><br/>
<tt>
cmake&nbsp;..&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Generates the appropriate Makefiles<br>
make&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Builds the project<br>
</tt><br>
\warning If your compiler does not support c++11 natively, you might have to enable it by changing the cmake call to: <br>
<tt>cmake .. -DCMAKE_CXX_FLAGS=-std=c++98</tt>
You can choose the build type by using cmake with the flag<br>
<b>-DCMAKE_BUILD_TYPE=(Debug|Release)</b> The default is: Release <br>
Other flags are:<br/>
<b>-DBUILD_APPS=OFF</b> to disable build of applications and<br/>
<b>-DCMAKE_INSTALL_PREFIX=&lt;path&gt;</b> to specify the install path.<br/>
When calling <b>make install</b> cmake will install %OpenMesh into this
directory using the subdirectories lib/include/bin.
CMake builds both shared and static under Linux.
Everything will then be build in the <b>Build</b> subdirectory containing the libraries in <b>lib</b> and the binaries in <b>bin</b>.
There are some additional targets:<br>
<b>doc</b>: Builds the Documentation<br>
<b>doc-install</b>: Builds the Documentation and installs it<br>
<br>
\note When you link against the static libraries of OpenMesh and get the error "can not be used when making a
shared object; recompile with -fPIC" you need to add "-fPIC" to the CMAKE_CXX_FLAGS. (This is usually added automatically)
\section sec_compiling_windows Windows
\subsection windows_using_cmake Compiling OpenMesh using CMake
Building OpenMesh on Windows requires cmake to generate the project files for Visual Studio.
<ul>
<li> Get Visual Studio ( 2013-2017 ) </li>
<li> Extract %OpenMesh source code. </li>
<li> Get all required libraries and install them ( including headers! ).</li>
<li> Download and install cmake: <a href="https://cmake.org/download/">www.cmake.org</a>.<br> </li>
<li> Start the cmake gui and open the %OpenMesh toplevel directory as source directory </li>
<li> Choose a build directory (e.g. create a directory called "build" in OpenMesh's root folder) </li>
<li> Click on configure .... If any libraries are left unconfigured, you can adjust the path manually. Rerun configure until everything is configured correctly. <br>
Attention: Some build variables are only visible in advanced view mode. Select Visual Studio 9 (2008), Visual Studio 10(2010), Visual Studio 11 (2012), Visual Studio 12 (2013) (Depending on your version) as
generator. </li>
<li> Click generate to create the visual studio project files </li>
<li> You can now find a Visual Studio solution file (OpenMesh.sln) in the <b>build</b> directory you chose in cmake </li>
<li> Now you can build %OpenMesh from within Visual Studio using the newly created project file. </li>
</ul>
<br>
<br>
\section sec_compiling_macosx MacOS X
Download and install required libraries as stated above.
You can download %OpenMesh's sources from <tt>www.openmesh.org</tt> or check out the latest repository via GIT:<br/>
<tt>https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh</tt>.<br/><br/>
\subsection mac_using_cmake Compiling OpenMesh using CMake
We recommend you to use CMake >= 3.7 as build system. This can also easily be installed
via MacPorts as well as the Qt >= 5.6 library which is used for some example applications
in %OpenMesh.<br/>
Once installed, change to %OpenMesh's root directory and create a directory
named e.g. "buildDebug" (assuming you want to build with debug symbols).<br/>
Then type in the following command to initially set up the build environment:
<br/><br/>
<tt>
cmake&nbsp;..&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Generates the appropriate Makefiles<br>
</tt>
<br/>
Note: If the build directory is not a subdirectory of %OpenMesh's root folder, replace ".." with %OpenMesh's
absolute (or relative) path.
In order to manually set specific build variables, just type:
<br/><br/>
<tt>
ccmake&nbsp;.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Configure build environment<br>
</tt>
<br/>
This opens the CMake configure tool. Change the CMAKE_BUILD_TYPE variable to "Release" in order to prepare build
for release configuration. Now, when everything is set up, just type:
<br/><br/>
<tt>
make&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Build %OpenMesh<br>
</tt>
<br/>
And optionally:
<br/><br/>
<tt>
make&nbsp;doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Build %OpenMesh's documentation<br>
</tt>
<br>
The mac application bundle will be found under "Build" in the recently created build folder.
It automatically contains all needed shared objects (libs, fonts, textures, etc.).
CMake builds both shared and static under MacOS X.
**/
//-----------------------------------------------------------------------------
......@@ -27,167 +27,4 @@ The following naming conventions are used for the %OpenMesh code:
**/
//-----------------------------------------------------------------------------
/** \page compiling Compiling OpenMesh
\section compilers Tested compilers
%OpenMesh has been successfully tested for the following operating
systems / compilers. This is only a list of tested compilers. More might be supported but are not tested.
<table>
<tr><td> Linux </td><td>
gcc 4.6.x<br>
gcc 4.7.x<br>
gcc 4.8.x<br>
gcc 4.9.x<br>
clang 3.3<br>
clang 3.4<br>
</td></tr>
<tr><td> Windows </td><td>
Microsoft Visual Studio 2008<br>
Microsoft Visual Studio 2010<br>
Microsoft Visual Studio 2012<br>
Microsoft Visual Studio 2013<br>
Microsoft Visual Studio 2015<br>
</td></tr>
<tr><td> Tested MacOS X Compilers</td>
<td>
XCode 4.3 <br>
XCode 4.4 <br>
XCode 4.5 <br>
XCode 5.1.1 <br>
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) <br>
</td></tr>
</table>
\section req_libs Required libraries (Only for included Apps)
Install the following external libraries / frameworks if you want to use the included Applications:<br><br>
<table>
<tr><td>Qt4/Qt5</td><td><a href="http://qt-project.org/downloads" target="_blank">http://qt-project.org/downloads</a></td></tr>
</table><br>
\section build_systems Chosing build system
%OpenMesh can be built using the <b>cmake</b> build system.
<br>
<br>
\section sec_compiling_unix Unix
\subsection linux_using_cmake Compiling OpenMesh using CMake
In order to compile %OpenMesh, create a directory named e.g. "build" in
OpenMesh's root directory. <b>Change to the newly created directory</b> and type
<br/><br/>
<tt>
cmake&nbsp;..&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Generates the appropriate Makefiles<br>
make&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Builds the project<br>
</tt><br>
You can choose the build type by using cmake with the flag<br>
<b>-DCMAKE_BUILD_TYPE=(Debug|Release)</b><br>
The default is: Debug
<br>
Other flags are:<br/>
<b>-DBUILD_APPS=OFF</b> to disable build of applications and<br/>
<b>-DCMAKE_INSTALL_PREFIX=&lt;path&gt;</b> to specify the install path.
<br/>
When calling <b>make install</b> cmake will install %OpenMesh into this
directory using the subdirectories lib/include/bin.
CMake builds both shared and static under Linux.
Everything will then be build in the <b>Build</b> subdirectory containing the libraries in <b>lib</b> and the binaries in <b>bin</b>.
There are some additional targets:<br>
<b>doc</b>: Builds the Documentation<br>
<b>doc-install</b>: Builds the Documentation and installs it<br>
<br>
\note When you link against the static libraries of OpenMesh and get the error "can not be used when making a
shared object; recompile with -fPIC" you need to add "-fPIC" to the CMAKE_CXX_FLAGS. (This is usually added automatically)
\section sec_compiling_windows Windows
\subsection windows_using_cmake Compiling OpenMesh using CMake
If you want to use cmake to build your Visual Studio 2008 solution file,<br>
download and install CMake from <a href="http://www.cmake.org/cmake/resources/software.html">www.cmake.org</a>.<br>
(Note: This is not mandatory since there are already VS2008 solution files included in %OpenMesh).<br><br>
<ul>
<li> Get Visual Studio ( 2008-2013 ) </li>
<li> Extract %OpenMesh source code. </li>
<li> Get all required libraries and install them ( including headers! ).</li>
<li> Get cmake for windows from http://www.cmake.org/cmake/resources/software.html </li>
<li> Start the cmake gui and open the %OpenMesh toplevel directory as source directory </li>
<li> Choose a build directory (e.g. create a directory called "build" in OpenMesh's root folder) </li>
<li> Click on configure .... If any libraries are left unconfigured, you can adjust the path manually. Rerun configure until everything is configured correctly.
Attention: Some build variables are only visible in advanced view mode. Select Visual Studio 9 (2008), Visual Studio 10(2010), Visual Studio 11 (2012), Visual Studio 12 (2013) (Depending on your version) as
generator. </li>
<li> Click generate to create the visual studio project files </li>
<li> You can now find a Visual Studio solution file (OpenMesh.sln) in the <b>build</b> directory you chose in cmake </li>
<li> Now you can build %OpenMesh from within Visual Studio using the newly created project file. </li>
</ul>
Note: Set the CMAKE_BUILD_TYPE variable to "Release" if you want %OpenMesh to be built as release.
In Visual Studio choose "Release" in the appropriate select box and build the solution afterwards.
<br>
<br>
\section sec_compiling_macosx MacOS X
Download and install required libraries as stated above.
You can download %OpenMesh's sources from <tt>www.openmesh.org</tt> or check out the latest repository via SVN:<br/>
<tt>svn co http://www.openmesh.org/svnrepo/OpenMesh/trunk %OpenMesh</tt>.<br/><br/>
\subsection mac_using_cmake Compiling OpenMesh using CMake
We recommend you to use CMake >= 2.8 as build system. This can also easily be installed
via MacPorts as well as the Qt >= 4.7 library which is used for some example applications
in %OpenMesh.<br/>
Once installed, change to %OpenMesh's root directory and create a directory
named e.g. "buildDebug" (assuming you want to build with debug symbols).<br/>
Then type in the following command to initially set up the build environment:
<br/><br/>
<tt>
cmake&nbsp;..&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Generates the appropriate Makefiles<br>
</tt>
<br/>
Note: If the build directory is not a subdirectory of %OpenMesh's root folder, replace ".." with %OpenMesh's
absolute (or relative) path.
In order to manually set specific build variables, just type:
<br/><br/>
<tt>
ccmake&nbsp;.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Configure build environment<br>
</tt>
<br/>
This opens the CMake configure tool. Change the CMAKE_BUILD_TYPE variable to "Release" in order to prepare build
for release configuration. Now, when everything is set up, just type:
<br/><br/>
<tt>
make&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Build %OpenMesh<br>
</tt>
<br/>
And optionally:
<br/><br/>
<tt>
make&nbsp;doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Build %OpenMesh's documentation<br>
</tt>
<br>
The mac application bundle will be found under "Build" in the recently created build folder.
It automatically contains all needed shared objects (libs, fonts, textures, etc.).
CMake builds both shared and static under MacOS X.
**/
//-----------------------------------------------------------------------------
# OpenMesh, 7.0
# OpenMesh, 7.2
[![](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/badges/master/pipeline.svg)](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/commits/master)
......@@ -21,15 +21,19 @@ https://www.graphics.rwth-aachen.de:9000/OpenMesh/openmesh-python
| Visual Studio Version: | 2017 | 2015 | 2013 |
| -------- | -------- |-------- |-------- |
| 64-Bit shared, with apps | - | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-64-bit-shared-apps) | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-64-bit-shared-apps) |
| 64-Bit shared, with apps | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2017-64-bit-shared-apps) | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-64-bit-shared-apps) | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-64-bit-shared-apps) |
| 32-Bit shared, with apps | - | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-32-bit-shared-apps) | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-32-bit-shared-apps) |
| 64-Bit static, with apps | - | [Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-64-bit-static-apps) | [Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-64-bit-static-apps) |
| 64-Bit static, with apps | [Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2017-64-bit-static-apps) | [Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-64-bit-static-apps) | [Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-64-bit-static-apps) |
| 32-Bit static, with apps | - | [ Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-32-bit-static-apps) | [ Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-32-bit-static-apps) |
| 64-Bit shared, no apps | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2017-64-bit-shared-no-apps) | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-64-bit-shared-no-apps) | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-64-bit-shared-no-apps) |
| 32-Bit shared, no apps | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2017-32-bit-shared-no-apps) | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-32-bit-shared-no-apps) | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-32-bit-shared-no-apps) |
| 64-Bit static, no apps | [Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2017-64-bit-static-no-apps) | [Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-64-bit-static-no-apps) | [Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-64-bit-static-no-apps) |
| 32-Bit static, no apps | [ Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2017-32-bit-static-no-apps) | [ Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-32-bit-static-no-apps) | [ Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-32-bit-static-no-apps) |
## Download Sources
[ Download Sources](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/?job=Sources )
## Installing
Unpack the tar-ball to a suitable place.
......
VERSION=7.1
VERSION=7.2
MAJOR=7
MINOR=1
MINOR=2
PATCH=0
ID=OPENMESH
......@@ -3,10 +3,10 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.cmake)
endif ()
# prevent build in source directory
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
message (SEND_ERROR "Building in the source directory is not supported.")
message (FATAL_ERROR "Please remove the created \"CMakeCache.txt\" file, the \"CMakeFiles\" directory and create a build directory and call \"${CMAKE_COMMAND} <path to the sources>\".")
endif ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
message (SEND_ERROR "Building in the source directory is not supported.")
message (FATAL_ERROR "Please remove the created \"CMakeCache.txt\" file, the \"CMakeFiles\" directory and create a build directory and call \"${CMAKE_COMMAND} <path to the sources>\".")
endif ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
# allow only Debug and Release builds
set (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "")
......@@ -132,7 +132,7 @@ macro (acg_set_target_props target)
#BUILD_WITH_INSTALL_RPATH 1
SKIP_BUILD_RPATH 0
)
endif(NOT (CMAKE_MAJOR_VERSION LESS 3))
endif(NOT (CMAKE_MAJOR_VERSION LESS 3) )
elseif (NOT APPLE)
set_target_properties (
......@@ -152,155 +152,6 @@ include (ACGCompiler)
# define INCLUDE_TEMPLATES for everything we build
add_definitions (-DINCLUDE_TEMPLATES)
#unset cached qt variables which are set by all qt versions. version is the major number of the qt version (e.g. 4 or 5, not 4.8)
macro (acg_unset_qt_shared_variables version)
if (ACG_INTERNAL_QT_LAST_VERSION)
if (NOT ${ACG_INTERNAL_QT_LAST_VERSION} EQUAL ${version})
unset(QT_BINARY_DIR)
unset(QT_PLUGINS_DIR)
unset(ACG_INTERNAL_QT_LAST_VERSION)
endif()
endif()
set (ACG_INTERNAL_QT_LAST_VERSION "${version}" CACHE INTERNAL "Qt Version, which was used on the last time")
endmacro()
# look for selected qt dependencies
macro (acg_qt4)
if (NOT QT4_FOUND)
acg_unset_qt_shared_variables(4)
find_package (Qt4 COMPONENTS QtCore QtGui ${ARGN})
set (QT_USE_QTOPENGL 1)
set (QT_USE_QTNETWORK 1)
set (QT_USE_QTSCRIPT 1)
set (QT_USE_QTSQL 1)
set (QT_USE_QTXML 1)
set (QT_USE_QTXMLPATTERNS 1)
set (QT_USE_QTHELP 1)
set (QT_USE_QTWEBKIT 1)
set (QT_USE_QTUITOOLS 1)
include (${QT_USE_FILE})
endif ()
endmacro ()
macro (acg_qt5)
if(POLICY CMP0020)
# Automatically link Qt executables to qtmain target on Windows
cmake_policy(SET CMP0020 NEW)
endif(POLICY CMP0020)
#if (NOT QT5_FOUND)
#set (QT_MIN_VERSION ${ARGN})
#try to find qt5 automatically
#for custom installation of qt5, dont use any of these variables
set (QT5_INSTALL_PATH "" CACHE PATH "Path to Qt5 directory which contains lib and include folder")
if (EXISTS "${QT5_INSTALL_PATH}")
set (CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${QT5_INSTALL_PATH}")
set (QT5_INSTALL_PATH_EXISTS TRUE)
endif()
find_package (Qt5Core QUIET)
#find WINDOWS_SDK to avoid qt error. This must be done BEFORE Qt5Widgets is searched
if (Qt5Core_FOUND AND WIN32)
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${Qt5Core_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${Qt5Core_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${Qt5Core_VERSION_STRING}")
if ( (QT_VERSION_MAJOR EQUAL 5) AND (QT_VERSION_MINOR LESS 3 OR ( QT_VERSION_MINOR EQUAL 3 AND QT_VERSION_PATCH EQUAL 0 )) ) # for all Qt version > 5.0.0 and < 5.3.1
#glu32.lib is needed by qt5 opengl version. it cannot find it by itself so we help qt
#this block has to be executed, before Qt5Gui is searched, otherwise we will end up with the (not so useful) QT5 error message
set(WINDOWS_SDK_LIBS "COULD_NOT_FOUND" CACHE PATH "Path to the latest windows sdk libs which includes glu32.lib. Used by Qt5.")
if (EXISTS "${WINDOWS_SDK_LIBS}\\glu32.lib")
set (CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${WINDOWS_SDK_LIBS}")
elseif(QT5_INSTALL_PATH_EXISTS) #trying to install qt5. notify about missing sdk before the qt message comes
message(FATAL_ERROR "Could not find glu32.lib. This is necessary for QT5 OpenGL version for windows, spleace specify glu32.lib in WINDOWS_SDK_LIB or install Qt version >= 5.3.1")
endif()
endif()
endif(Qt5Core_FOUND AND WIN32)
find_package (Qt5Gui QUIET)
find_package (Qt5OpenGL QUIET)
if (Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5OpenGL_FOUND)
set (QT5_FOUND TRUE)
endif()
if (QT5_FOUND)
acg_unset_qt_shared_variables(5)
#set plugin dir
list(GET Qt5Gui_PLUGINS 0 _plugin)
if (_plugin)
get_target_property(_plugin_full ${_plugin} LOCATION)
get_filename_component(_plugin_dir ${_plugin_full} PATH)
set (QT_PLUGINS_DIR "${_plugin_dir}/../" CACHE PATH "Path to the qt plugin directory")
elseif(QT5_INSTALL_PATH_EXISTS)
set (QT_PLUGINS_DIR "${QT5_INSTALL_PATH}/plugins/" CACHE PATH "Path to the qt plugin directory")
elseif()
set (QT_PLUGINS_DIR "QT_PLUGIN_DIR_NOT_FOUND" CACHE PATH "Path to the qt plugin directory")
endif(_plugin)
#set binary dir for fixupbundle
if(QT5_INSTALL_PATH_EXISTS)
set(_QT_BINARY_DIR "${QT5_INSTALL_PATH}/bin")
else()
get_target_property(_QT_BINARY_DIR ${Qt5Widgets_UIC_EXECUTABLE} LOCATION)
get_filename_component(_QT_BINARY_DIR ${_QT_BINARY_DIR} PATH)
endif(QT5_INSTALL_PATH_EXISTS)
set (QT_BINARY_DIR "${_QT_BINARY_DIR}" CACHE PATH "Qt5 binary Directory")
mark_as_advanced(QT_BINARY_DIR)
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
include_directories(${Qt5Core_INCLUDE_DIRS})
include_directories(${Qt5Gui_INCLUDE_DIRS})
include_directories(${Qt5OpenGL_INCLUDE_DIRS})
add_definitions(${Qt5Core_DEFINITIONS})
add_definitions(${Qt5Gui_DEFINITIONS})
add_definitions(${Qt5OpenGL_DEFINITIONS})
if ( NOT MSVC )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
set (QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES}
${Qt5Gui_LIBRARIES} ${Qt5OpenGL_LIBRARIES})
if (MSVC)
set (QT_LIBRARIES ${QT_LIBRARIES} ${Qt5Core_QTMAIN_LIBRARIES})
endif()
#add_definitions(-DQT_NO_OPENGL)
#adding QT_NO_DEBUG to all release modes.
# Note: for multi generators like msvc you cannot set this definition depending of
# the current build type, because it may change in the future inside the ide and not via cmake
if (MSVC_IDE)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
set(CMAKE_CXX_FLAGS_MINSITEREL "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
else(MSVC_IDE)
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DQT_NO_DEBUG)
endif()
endif(MSVC_IDE)
endif ()
endmacro ()
# unsets the given variable
macro (acg_unset var)
set (${var} "" CACHE INTERNAL "")
......@@ -314,14 +165,14 @@ endmacro ()
# test for OpenMP
macro (acg_openmp)
if (NOT OPENMP_NOTFOUND)
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
add_definitions(-DUSE_OPENMP)
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
add_definitions(-DUSE_OPENMP)
else ()
set (OPENMP_NOTFOUND 1)
endif ()
endif()
endif ()
endmacro ()
......@@ -380,192 +231,11 @@ macro (acg_drop_templates list)
endforeach ()
endmacro ()
# generate moc targets for sources in list
macro (acg_qt4_automoc moc_SRCS)
qt4_get_moc_flags (_moc_INCS)
set (_matching_FILES )
foreach (_current_FILE ${ARGN})
get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE)
# if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
# here. this is required to make bouic work correctly:
# we need to add generated .cpp files to the sources (to compile them),
# but we cannot let automoc handle them, as the .cpp files don't exist yet when
# cmake is run for the very first time on them -> however the .cpp files might
# exist at a later run. at that time we need to skip them, so that we don't add two
# different rules for the same moc file
get_source_file_property (_skip ${_abs_FILE} SKIP_AUTOMOC)
if ( NOT _skip AND EXISTS ${_abs_FILE} )
file (READ ${_abs_FILE} _contents)
get_filename_component (_abs_PATH ${_abs_FILE} PATH)
string (REGEX MATCHALL "Q_OBJECT" _match "${_contents}")
if (_match)
get_filename_component (_basename ${_current_FILE} NAME_WE)
set (_header ${_abs_FILE})
set (_moc ${CMAKE_CURRENT_BINARY_DIR}/moc_${_basename}.cpp)
add_custom_command (OUTPUT ${_moc}
COMMAND ${QT_MOC_EXECUTABLE}
ARGS ${_moc_INCS} ${_header} -o ${_moc}
DEPENDS ${_header}
)
add_file_dependencies (${_abs_FILE} ${_moc})
set (${moc_SRCS} ${${moc_SRCS}} ${_moc})
endif ()
endif ()
endforeach ()
endmacro ()
# generate moc targets for sources in list
macro (acg_qt5_automoc moc_SRCS)
qt5_get_moc_flags (_moc_INCS)
list(REMOVE_DUPLICATES _moc_INCS)
set (_matching_FILES )
foreach (_current_FILE ${ARGN})
get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE)
# if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
# here. this is required to make bouic work correctly:
# we need to add generated .cpp files to the sources (to compile them),
# but we cannot let automoc handle them, as the .cpp files don't exist yet when
# cmake is run for the very first time on them -> however the .cpp files might
# exist at a later run. at that time we need to skip them, so that we don't add two
# different rules for the same moc file
get_source_file_property (_skip ${_abs_FILE} SKIP_AUTOMOC)
if ( NOT _skip AND EXISTS ${_abs_FILE} )
file (READ ${_abs_FILE} _contents)
get_filename_component (_abs_PATH ${_abs_FILE} PATH)
string (REGEX MATCHALL "Q_OBJECT" _match "${_contents}")
if (_match)
get_filename_component (_basename ${_current_FILE} NAME_WE)
set (_header ${_abs_FILE})
set (_moc ${CMAKE_CURRENT_BINARY_DIR}/moc_${_basename}.cpp)
add_custom_command (OUTPUT ${_moc}
COMMAND ${QT_MOC_EXECUTABLE}
ARGS ${_moc_INCS} ${_header} -o ${_moc}
DEPENDS ${_header}
)
add_file_dependencies (${_abs_FILE} ${_moc})
set (${moc_SRCS} ${${moc_SRCS}} ${_moc})
endif ()
endif ()
endforeach ()
endmacro ()
# generate uic targets for sources in list
macro (acg_qt4_autouic uic_SRCS)
set (_matching_FILES )
foreach (_current_FILE ${ARGN})
get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE)
if ( EXISTS ${_abs_FILE} )
file (READ ${_abs_FILE} _contents)
get_filename_component (_abs_PATH ${_abs_FILE} PATH)
get_filename_component (_basename ${_current_FILE} NAME_WE)
string (REGEX REPLACE "Ui$" "" _cbasename ${_basename})
set (_outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${_basename}.hh)
set (_header ${_basename}.hh)
set (_source ${_abs_PATH}/${_cbasename}.cc)
add_custom_command (OUTPUT ${_outfile}
COMMAND ${QT_UIC_EXECUTABLE}
ARGS -o ${_outfile} ${_abs_FILE}
DEPENDS ${_abs_FILE})
add_file_dependencies (${_source} ${_outfile})
set (${uic_SRCS} ${${uic_SRCS}} ${_outfile})
endif ()
endforeach ()
endmacro ()
# generate uic targets for sources in list
macro (acg_qt5_autouic uic_SRCS)
set (_matching_FILES )
foreach (_current_FILE ${ARGN})
get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE)
if ( EXISTS ${_abs_FILE} )
file (READ ${_abs_FILE} _contents)
get_filename_component (_abs_PATH ${_abs_FILE} PATH)
get_filename_component (_basename ${_current_FILE} NAME_WE)
string (REGEX REPLACE "Ui$" "" _cbasename ${_basename})
set (_outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${_basename}.hh)
set (_header ${_basename}.hh)
set (_source ${_abs_PATH}/${_cbasename}.cc)
add_custom_command (OUTPUT ${_outfile}
COMMAND ${Qt5Widgets_UIC_EXECUTABLE}
ARGS -o ${_outfile} ${_abs_FILE}
MAIN_DEPENDENCY ${_abs_FILE} VERBATIM)
add_file_dependencies (${_source} ${_outfile})
set (${uic_SRCS} ${${uic_SRCS}} ${_outfile})
endif ()
endforeach ()
endmacro ()
# generate qrc targets for sources in list
macro (acg_qt4_autoqrc qrc_SRCS)
set (_matching_FILES )
foreach (_current_FILE ${ARGN})
get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE)
if ( EXISTS ${_abs_FILE} )
file (READ ${_abs_FILE} _contents)
get_filename_component (_abs_PATH ${_abs_FILE} PATH)
get_filename_component (_basename ${_current_FILE} NAME_WE)
set (_outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${_basename}.cpp)
add_custom_command (OUTPUT ${_outfile}
COMMAND ${QT_RCC_EXECUTABLE}
ARGS -o ${_outfile} ${_abs_FILE}
DEPENDS ${_abs_FILE})
add_file_dependencies (${_source} ${_outfile})
set (${qrc_SRCS} ${${qrc_SRCS}} ${_outfile})
endif ()
endforeach ()
endmacro ()
# get all files in directory, but ignore svn
macro (acg_get_files_in_dir ret dir)
file (GLOB_RECURSE __files RELATIVE "${dir}" "${dir}/*")
foreach (_file ${__files})
if (NOT _file MATCHES ".*svn.*")
if ( (NOT _file MATCHES ".*svn.*") AND (NOT _file MATCHES ".DS_Store") )
list (APPEND ${ret} "${_file}")
endif ()
endforeach ()
......@@ -600,7 +270,7 @@ function (acg_add_executable _target)
# set common target properties defined in common.cmake
acg_set_target_props (${_target})
if (WIN32 OR (APPLE AND NOT ACG_PROJECT_MACOS_BUNDLE))
add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
......@@ -656,7 +326,7 @@ function (acg_add_library _target _libtype)
copy_if_different
$<TARGET_FILE:${_target}>
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/$<TARGET_FILE_NAME:${_target}>)
add_custom_command (TARGET ${_target} POST_BUILD
add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
$<TARGET_LINKER_FILE:${_target}>
......@@ -671,22 +341,22 @@ function (acg_add_library _target _libtype)
$<TARGET_FILE:${_target}>
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}/$<TARGET_FILE_NAME:${_target}>)
elseif (${_type} STREQUAL STATIC)
add_custom_command (TARGET ${_target} POST_BUILD
add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
$<TARGET_FILE:${_target}>
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/$<TARGET_FILE_NAME:${_target}>)
endif()
# make an extra copy for windows into the binary directory
endif()
# make an extra copy for windows into the binary directory
if (${_type} STREQUAL SHARED AND WIN32)
add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
$<TARGET_FILE:${_target}>
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}/$<TARGET_FILE_NAME:${_target}>)
endif ()
endif ()
endif( (WIN32 AND MSVC) OR (APPLE AND NOT ACG_PROJECT_MACOS_BUNDLE))
......@@ -720,57 +390,3 @@ function (acg_add_library _target _libtype)
endfunction ()
#generates qt translations
function (acg_add_translations _target _languages _sources)
string (TOUPPER ${_target} _TARGET)
# generate/use translation files
# run with UPDATE_TRANSLATIONS set to on to build qm files
option (UPDATE_TRANSLATIONS_${_TARGET} "Update source translation *.ts files (WARNING: make clean will delete the source .ts files! Danger!)")
set (_new_ts_files)
set (_ts_files)
foreach (lang ${_languages})
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/translations/${_target}_${lang}.ts" OR UPDATE_TRANSLATIONS_${_TARGET})
list (APPEND _new_ts_files "translations/${_target}_${lang}.ts")
else ()
list (APPEND _ts_files "translations/${_target}_${lang}.ts")
endif ()
endforeach ()
set (_qm_files)
if ( _new_ts_files )
qt4_create_translation(_qm_files ${_sources} ${_new_ts_files})
endif ()
if ( _ts_files )
qt4_add_translation(_qm_files2 ${_ts_files})
list (APPEND _qm_files ${_qm_files2})
endif ()
# create a target for the translation files ( and object files )
# Use this target, to update only the translations
add_custom_target (translations_target_${_target} DEPENDS ${_qm_files})
# Build translations with the application
add_dependencies(${_target} translations_target_${_target} )
if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Translations)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Translations )
endif ()
foreach (_qm ${_qm_files})
get_filename_component (_qm_name "${_qm}" NAME)
add_custom_command (TARGET translations_target_${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
${_qm}
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Translations/${_qm_name})
endforeach ()
if (NOT ACG_PROJECT_MACOS_BUNDLE OR NOT APPLE)
install (FILES ${_qm_files} DESTINATION "${ACG_PROJECT_DATADIR}/Translations")
endif ()
endfunction ()
#unset cached qt variables which are set by all qt versions. version is the major number of the qt version (e.g. 4 or 5, not 4.8)
macro (acg_unset_qt_shared_variables version)
if (ACG_INTERNAL_QT_LAST_VERSION)
if (NOT ${ACG_INTERNAL_QT_LAST_VERSION} EQUAL ${version})
unset(QT_BINARY_DIR)
unset(QT_PLUGINS_DIR)
unset(ACG_INTERNAL_QT_LAST_VERSION)
endif()
endif()
set (ACG_INTERNAL_QT_LAST_VERSION "${version}" CACHE INTERNAL "Qt Version, which was used on the last time")
endmacro()
macro (acg_qt5)
if(POLICY CMP0020)
# Automatically link Qt executables to qtmain target on Windows
cmake_policy(SET CMP0020 NEW)
endif(POLICY CMP0020)
#if (NOT QT5_FOUND)
#set (QT_MIN_VERSION ${ARGN})
#try to find qt5 automatically
#for custom installation of qt5, dont use any of these variables
set (QT5_INSTALL_PATH "" CACHE PATH "Path to Qt5 directory which contains lib and include folder")
if (EXISTS "${QT5_INSTALL_PATH}")
set (CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${QT5_INSTALL_PATH}")
set (QT5_INSTALL_PATH_EXISTS TRUE)
endif(EXISTS "${QT5_INSTALL_PATH}")
set(QT5_FINDER_FLAGS "" CACHE STRING "Flags for the Qt finder e.g.
NO_DEFAULT_PATH if no system installed Qt shall be found")
# compute default search paths
set(SUPPORTED_QT_VERSIONS 5.9 5.8 5.7 5.6)
foreach (suffix gcc_64 clang_64)
foreach(version ${SUPPORTED_QT_VERSIONS})
list(APPEND QT_DEFAULT_PATH "~/sw/Qt/${version}/${suffix}")
endforeach()
endforeach()
find_package (Qt5Core PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
if(Qt5Core_FOUND)
if(Qt5Core_VERSION) # use the new version variable if it is set
set(Qt5Core_VERSION_STRING ${Qt5Core_VERSION})
endif(Qt5Core_VERSION)
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${Qt5Core_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${Qt5Core_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${Qt5Core_VERSION_STRING}")
find_package (Qt5Widgets QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5Gui QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5OpenGL QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5Network QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5Sql QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5Script QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5ScriptTools QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5Xml QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5XmlPatterns QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5Help QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5UiTools QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5Svg QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5PrintSupport QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5Concurrent QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
#do noot look for Webkit and qt declarative on qt version 5.6 or newer
if(${QT_VERSION_MINOR} LESS 6)
find_package (Qt5Declarative QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5WebKit QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
endif(${QT_VERSION_MINOR} LESS 6)
if (NOT WIN32 AND NOT APPLE)
find_package (Qt5X11Extras QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
endif ()
if(${QT_VERSION_MINOR} GREATER 5)
if (Qt5Core_FOUND AND Qt5Widgets_FOUND
AND Qt5Gui_FOUND AND Qt5OpenGL_FOUND AND Qt5Network_FOUND
AND Qt5Script_FOUND AND Qt5ScriptTools_FOUND AND Qt5Sql_FOUND
AND Qt5Xml_FOUND AND Qt5XmlPatterns_FOUND AND Qt5Help_FOUND
AND Qt5UiTools_FOUND AND Qt5Concurrent_FOUND
AND Qt5PrintSupport_FOUND)
set (QT5_FOUND TRUE)
endif()
else(${QT_VERSION_MINOR} GREATER 5)
if (Qt5Core_FOUND AND Qt5Declarative_FOUND AND Qt5Widgets_FOUND
AND Qt5Gui_FOUND AND Qt5OpenGL_FOUND AND Qt5Network_FOUND
AND Qt5Script_FOUND AND Qt5ScriptTools_FOUND AND Qt5Sql_FOUND
AND Qt5Xml_FOUND AND Qt5XmlPatterns_FOUND AND Qt5Help_FOUND
AND Qt5WebKit_FOUND AND Qt5UiTools_FOUND AND Qt5Concurrent_FOUND
AND Qt5PrintSupport_FOUND)
set (QT5_FOUND TRUE)
endif()
endif(${QT_VERSION_MINOR} GREATER 5)
endif(Qt5Core_FOUND)
if (QT5_FOUND)
acg_unset_qt_shared_variables(5)
#set plugin dir
list(GET Qt5Gui_PLUGINS 0 _plugin)
if (_plugin)
get_target_property(_plugin_full ${_plugin} LOCATION)
get_filename_component(_plugin_dir ${_plugin_full} PATH)
set (QT_PLUGINS_DIR "${_plugin_dir}/../" CACHE PATH "Path to the qt plugin directory")
elseif(QT5_INSTALL_PATH_EXISTS)
set (QT_PLUGINS_DIR "${QT5_INSTALL_PATH}/plugins/" CACHE PATH "Path to the qt plugin directory")
elseif()
set (QT_PLUGINS_DIR "QT_PLUGIN_DIR_NOT_FOUND" CACHE PATH "Path to the qt plugin directory")
endif(_plugin)
#set binary dir for fixupbundle
if(QT5_INSTALL_PATH_EXISTS)
set(_QT_BINARY_DIR "${QT5_INSTALL_PATH}/bin")
else()
get_target_property(_QT_BINARY_DIR ${Qt5Widgets_UIC_EXECUTABLE} LOCATION)
get_filename_component(_QT_BINARY_DIR ${_QT_BINARY_DIR} PATH)
endif(QT5_INSTALL_PATH_EXISTS)
set (QT_BINARY_DIR "${_QT_BINARY_DIR}" CACHE PATH "Qt5 binary Directory")
mark_as_advanced(QT_BINARY_DIR)
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
include_directories(${Qt5Core_INCLUDE_DIRS})
include_directories(${Qt5Declarative_INCLUDE_DIRS})
include_directories(${Qt5Widgets_INCLUDE_DIRS})
include_directories(${Qt5Gui_INCLUDE_DIRS})
include_directories(${Qt5OpenGL_INCLUDE_DIRS})
include_directories(${Qt5Network_INCLUDE_DIRS})
include_directories(${Qt5Script_INCLUDE_DIRS})
include_directories(${Qt5ScriptTools_INCLUDE_DIRS})
include_directories(${Qt5Sql_INCLUDE_DIRS})
include_directories(${Qt5Xml_INCLUDE_DIRS})
include_directories(${Qt5XmlPatterns_INCLUDE_DIRS})
include_directories(${Qt5Help_INCLUDE_DIRS})
include_directories(${Qt5WebKit_INCLUDE_DIRS})
include_directories(${Qt5UiTools_INCLUDE_DIRS})
include_directories(${Qt5Concurrent_INCLUDE_DIRS})
include_directories(${Qt5PrintSupport_INCLUDE_DIRS})
add_definitions(${Qt5Core_DEFINITIONS})
add_definitions(${Qt5Widgets_DEFINITIONS})
add_definitions(${Qt5Gui_DEFINITIONS})
add_definitions(${Qt5OpenGL_DEFINITIONS})
add_definitions(${Qt5Network_DEFINITIONS})
add_definitions(${Qt5Script_DEFINITIONS})
add_definitions(${Qt5ScriptTools_DEFINITIONS})
add_definitions(${Qt5Sql_DEFINITIONS})
add_definitions(${Qt5Xml_DEFINITIONS})
add_definitions(${Qt5XmlPatterns_DEFINITIONS})
add_definitions(${Qt5Help_DEFINITIONS})
add_definitions(${Qt5WebKit_DEFINITIONS})
add_definitions(${Qt5UiTools_DEFINITIONS})
add_definitions(${Qt5Concurrent_DEFINITIONS})
add_definitions(${Qt5PrintSupport_DEFINITIONS})
if (Qt5X11Extras_FOUND)
include_directories(${Qt5X11Extras_INCLUDE_DIRS})
add_definitions(${Qt5X11Extras_DEFINITIONS})
endif ()
if ( NOT MSVC )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
set (QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Declarative_LIBRARIES} ${Qt5Widgets_LIBRARIES}
${Qt5Gui_LIBRARIES} ${Qt5OpenGL_LIBRARIES} ${Qt5Network_LIBRARIES}
${Qt5Script_LIBRARIES} ${Qt5ScriptTools_LIBRARIES} ${Qt5Sql_LIBRARIES}
${Qt5Xml_LIBRARIES} ${Qt5XmlPatterns_LIBRARIES} ${Qt5Help_LIBRARIES}
${Qt5WebKit_LIBRARIES} ${Qt5UiTools_LIBRARIES} ${Qt5Concurrent_LIBARIES}