Commit 8d88191b authored by Max Lyon's avatar Max Lyon

Merge branch 'master' into iterators

parents 12d5a6b4 2782a7ef
.project
.cproject
CMakeLists.txt.user
build*
*.swp
.settings
cppcheck.log
# gcov output files:
*.gcda
*.gcno
......@@ -21,38 +21,37 @@ cppcheck:
paths:
- cppcheck.log
VS2015-64-bit:
VS2017-64-bit:
variables:
BUILD_PLATFORM: "VS2015"
BUILD_PLATFORM: "VS2017"
ARCHITECTURE: "x64"
script: "CI\\Windows.bat"
tags:
- VS2015
VS2015-32-bit:
VS2017-32-bit:
variables:
BUILD_PLATFORM: "VS2015"
BUILD_PLATFORM: "VS2017"
ARCHITECTURE: "x32"
script: "CI\\Windows.bat"
tags:
- VS2015
- VS2017
VS2013-64-bit:
VS2015-64-bit:
variables:
BUILD_PLATFORM: "VS2013"
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x64"
script: "CI\\Windows.bat"
tags:
- VS2013
- VS2015
VS2013-32-bit:
VS2015-32-bit:
variables:
BUILD_PLATFORM: "VS2013"
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x32"
script: "CI\\Windows.bat"
tags:
- VS2013
- VS2015
doc:
script: "CI/ci-doc.sh"
......
Version X (?/?/?)
- !!!Break compatiblity with C++98, require C++11 as mininum!!!
- Renamed *T.cc into *T_impl.hh to avoid ugly problems ith several IDEs
- Fix bug in halfface reordering
- Track if garbage collection is necessary.
- Ignore non-serializable datatypes when saving properties instead of throwing exception.
......@@ -15,6 +16,8 @@ Version X (?/?/?)
- Made property handle constructors explicit
- Enable range iterators on MSVC
- Fix mesh copying by implementing copy constructors and clone methods
- Fix bug in edge split of tetrahedral meshes
- Ensure that halfface iterators start with a boundary halffaces when cells are deleted
......
......@@ -15,16 +15,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
)
IF "%ARCHITECTURE%" == "x32" (
set QT_INSTALL_PATH=E:\Qt\Qt5.3.1-vs2013-%STRING_ARCH%\5.3\msvc2013_opengl
set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.3.1-vs2013-%STRING_ARCH%\5.3\msvc2013_opengl
)
)
IF "%BUILD_PLATFORM%" == "VS2015" (
......@@ -33,21 +23,31 @@ 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
)
IF "%ARCHITECTURE%" == "x32" (
set QT_INSTALL_PATH=E:\Qt\Qt5.6.0-vs2015-%STRING_ARCH%\5.6\msvc2015
set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.6.0-vs2015-%STRING_ARCH%\5.6\msvc2015
)
)
IF "%BUILD_PLATFORM%" == "VS2017" (
set LIBPATH=E:\libs\VS2017
set GTESTVERSION=gtest-1.7.0
set GENERATOR=Visual Studio 15%ARCH_VS%
set VS_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.com"
)
ECHO "==============================================================="
ECHO "==============================================================="
ECHO "Building with :"
ECHO "ARCHITECTURE : %ARCHITECTURE%"
ECHO "BUILD_PLATFORM : %BUILD_PLATFORM%"
ECHO "GTESTVERSION : %GTESTVERSION%"
ECHO "GENERATOR : %GENERATOR%"
ECHO "CMAKE_CONFIGURATION : %CMAKE_CONFIGURATION%"
ECHO "VS_PATH : %VS_PATH%"
ECHO "LIBPATH : %LIBPATH%"
ECHO "==============================================================="
ECHO "==============================================================="
"cmake" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Release %CMAKE_CONFIGURATION% ..
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Release %CMAKE_CONFIGURATION% ..
%VS_PATH% /Build "Release" OpenVolumeMesh.sln /Project "ALL_BUILD"
......@@ -68,7 +68,7 @@ mkdir build-debug
cd build-debug
"cmake" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Debug %CMAKE_CONFIGURATION% ..
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Debug %CMAKE_CONFIGURATION% ..
%VS_PATH% /Build "Debug" OpenVolumeMesh.sln /Project "ALL_BUILD"
......
......@@ -13,22 +13,14 @@ WARNING='\033[0;93m'
echo -e "${OUTPUT}"
echo "=============================================================================="
echo "Running cppcheck"
echo -n "Version: "
cppcheck --version
echo "=============================================================================="
echo -e "${NC}"
echo "Please Wait ..."
# Run cppcheck and output into file
cppcheck --enable=all . -I src -i Doc/ --force --suppress=missingIncludeSystem --quiet -Umin -Umax -UBMPOSTFIX -DOPENVOLUMEMESHDLLEXPORT="" &> cppcheck.log
echo -e "${OUTPUT}"
echo "=============================================================================="
echo "CPPCHECK Messages"
echo "=============================================================================="
echo -e "${NC}"
# Echo output to command line for simple analysis via gitlab
cat cppcheck.log
cppcheck --enable=all . -I src -i Doc/ --force --suppress=missingIncludeSystem --inline-suppr --quiet -Umin -Umax -UBMPOSTFIX -DOPENVOLUMEMESHDLLEXPORT="" 2>&1 | tee cppcheck.log
COUNT=$(wc -l < cppcheck.log )
......
cmake_minimum_required (VERSION 2.6)
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
set(CMAKE_CXX_STANDARD 11)
if("${PROJECT_NAME}" STREQUAL "")
message("Setting project name to OpenVolumeMesh")
......@@ -13,6 +13,16 @@ endif()
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set (CMAKE_DEBUG_POSTFIX "d")
# Enable bigobj on MSVC Windows debug mode
if ( MSVC )
add_compile_options("$<IF:$<CXX_COMPILER_ID:MSVC>,$<$<CONFIG:DEBUG>:/bigobj>,>")
endif()
if (WIN32)
add_definitions( -D_USE_MATH_DEFINES -DNOMINMAX )
endif ()
# include our cmake files
include (ACGCommon)
......@@ -20,11 +30,6 @@ acg_get_version ()
include (ACGOutput)
if (WIN32)
add_definitions(
-D_USE_MATH_DEFINES -DNOMINMAX
)
endif ()
# ========================================================================
# Call the subdirectories with the projects
......
**License Information for OpenVolumeMesh**
OpenVolumeMesh is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version with the
following exceptions:
OpenVolumeMesh is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU LesserGeneral Public
License along with OpenVolumeMesh. If not,
see http://www.gnu.org/licenses/.
\ No newline at end of file
===========================================================================
-----
OpenVolumeMesh
Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen
Copyright (C) 2011-2018 by Computer Graphics Group, RWTH Aachen
www.openvolumemesh.org
---------------------------------------------------------------------------
-----
OpenVolumeMesh is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
......@@ -21,18 +19,17 @@
License along with OpenVolumeMesh. If not,
see <http://www.gnu.org/licenses/>.
===========================================================================
Overview:
# Overview:
0. Introduction
1. System Requirements
2. Building OpenVolumeMesh
3. License Information
===========================================================================
0. Introduction
# 0. Introduction
Thank you for downloading and using the OpenVolumeMesh library. OpenVolumeMesh
is a generic data structure for the comfortable handling of arbitrary
......@@ -65,24 +62,23 @@ a well-working, reliable, and useful library. Please feel free to commit
suggestions, bug reports, or patches to the OpenVolumeMesh project management
system (redmine), which you find at
<http://www.openvolumemesh.org/redmine/projects/openvolumemesh>,
<https://www.graphics.rwth-aachen.de:9000/OpenVolumeMesh/OpenVolumeMesh>,
or you can send them directly to my e-mail address which is
or you can send them directly to the following e-mail address which is
<mkremer@cs.rwth-aachen.de>.
<moebius@cs.rwth-aachen.de>.
===========================================================================
1. System Requirements
# 1. System Requirements
OpenVolumeMesh is shipped as source project and can be built on all common
architectures and operating systems including:
- Windows XP/2000/Vista/7 with Visual Studio 2008 SP1 or Visual Studio 2010.
- Windows 7/8/10 with Visual Studio 2013 or higher
- MacOSX 10.6. with XCode 4.3
- MacOSX with latest XCode
- Linux with GCC 4.5 and higher
- Linux with GCC 6 and higher
Note that OpenVolumeMesh uses CMake as build system, so make sure that
the latest version of CMake is installed on your computer. Download
......@@ -92,12 +88,11 @@ Note also that, in order to build the documentation, you will need to
have Doxygen installed on your computer. Download Doxygen under
<http://www.doxygen.org>. The use of Doxygen is not mandatory though.
===========================================================================
2. Building OpenVolumeMesh
# 2. Building OpenVolumeMesh
OpenVolumeMesh is equipped with a CMake build system <http://www.cmake.org>.
Make sure that at least version 2.6 of CMake is installed on your computer.
Make sure that at least version 3.7 of CMake is installed on your computer.
Once CMake is installed, perform the following steps (on Linux, Mac OSX):
- Create a build directory somewhere outside the source directory
......@@ -115,15 +110,14 @@ Once CMake is installed, perform the following steps (on Linux, Mac OSX):
by "sudo make install" in order to build and install the library.
On Windows, start the CMake gui tool and set the path to OpenVolumeMesh's
sources. Then select the target project type (Visual Studio 2008, 2010)
sources. Then select the target project type (Visual Studio 20xx)
and click on "Configure". Once everything is configured to your satisfaction,
click on "Generate". You will now find a Visual Studio project file
in the specified build folder (which is "Build" per default). Open this
file in Visual Studio and select "Build all".
===========================================================================
3. License Information
# 3. License Information
OpenVolumeMesh is free software licensed under the terms of the
GNU Lesser General Public License Version 3 as published by the Free Software
......
......@@ -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}")
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}")
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 "")
......@@ -321,7 +172,7 @@ macro (acg_openmp)
add_definitions(-DUSE_OPENMP)
else ()
set (OPENMP_NOTFOUND 1)
endif ()
endif()
endif ()
endmacro ()
......@@ -370,202 +221,11 @@ macro (acg_append_files_recursive ret ext)
endforeach ()
endmacro ()
# drop all "*T.cc" files from list
macro (acg_drop_templates list)
foreach (_file ${${list}})
if (_file MATCHES "T.cc$")
list (REMOVE_ITEM ${list} ${_file})
endif ()
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