summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/GetGitRevisionDescription.cmake150
-rw-r--r--cmake/GetGitRevisionDescription.cmake.in30
-rw-r--r--cmake/GitFunctions.cmake38
-rw-r--r--cmake/MacOSXBundleInfo.plist.in68
-rw-r--r--cmake/UnitTest.cmake80
-rw-r--r--cmake/UnitTest/TestUtil.h20
-rw-r--r--cmake/UnitTest/generate_test_data.cmake30
7 files changed, 208 insertions, 208 deletions
diff --git a/cmake/GetGitRevisionDescription.cmake b/cmake/GetGitRevisionDescription.cmake
index 85eae156..39c2707b 100644
--- a/cmake/GetGitRevisionDescription.cmake
+++ b/cmake/GetGitRevisionDescription.cmake
@@ -31,7 +31,7 @@
# http://www.boost.org/LICENSE_1_0.txt)
if(__get_git_revision_description)
- return()
+ return()
endif()
set(__get_git_revision_description YES)
@@ -40,91 +40,91 @@ set(__get_git_revision_description YES)
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
function(get_git_head_revision _refspecvar _hashvar)
- set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
- set(GIT_DIR "${GIT_PARENT_DIR}/.git")
- while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
- set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
- get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
- if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
- # We have reached the root directory, we are not in git
- set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
- set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
- return()
- endif()
- set(GIT_DIR "${GIT_PARENT_DIR}/.git")
- endwhile()
- # check if this is a submodule
- if(NOT IS_DIRECTORY ${GIT_DIR})
- file(READ ${GIT_DIR} submodule)
- string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule})
- get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
- get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE)
- endif()
- set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
- if(NOT EXISTS "${GIT_DATA}")
- file(MAKE_DIRECTORY "${GIT_DATA}")
- endif()
+ set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
+ set(GIT_DIR "${GIT_PARENT_DIR}/.git")
+ while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
+ set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
+ get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
+ if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
+ # We have reached the root directory, we are not in git
+ set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
+ set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
+ return()
+ endif()
+ set(GIT_DIR "${GIT_PARENT_DIR}/.git")
+ endwhile()
+ # check if this is a submodule
+ if(NOT IS_DIRECTORY ${GIT_DIR})
+ file(READ ${GIT_DIR} submodule)
+ string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule})
+ get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
+ get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE)
+ endif()
+ set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
+ if(NOT EXISTS "${GIT_DATA}")
+ file(MAKE_DIRECTORY "${GIT_DATA}")
+ endif()
- if(NOT EXISTS "${GIT_DIR}/HEAD")
- return()
- endif()
- set(HEAD_FILE "${GIT_DATA}/HEAD")
- configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
+ if(NOT EXISTS "${GIT_DIR}/HEAD")
+ return()
+ endif()
+ set(HEAD_FILE "${GIT_DATA}/HEAD")
+ configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
- configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
- "${GIT_DATA}/grabRef.cmake"
- @ONLY)
- include("${GIT_DATA}/grabRef.cmake")
+ configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
+ "${GIT_DATA}/grabRef.cmake"
+ @ONLY)
+ include("${GIT_DATA}/grabRef.cmake")
- set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
- set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
+ set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
+ set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
endfunction()
function(git_describe _var)
- if(NOT GIT_FOUND)
- find_package(Git QUIET)
- endif()
- get_git_head_revision(refspec hash)
- if(NOT GIT_FOUND)
- set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
- return()
- endif()
- if(NOT hash)
- set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
- return()
- endif()
+ if(NOT GIT_FOUND)
+ find_package(Git QUIET)
+ endif()
+ get_git_head_revision(refspec hash)
+ if(NOT GIT_FOUND)
+ set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
+ return()
+ endif()
+ if(NOT hash)
+ set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
+ return()
+ endif()
- # TODO sanitize
- #if((${ARGN}" MATCHES "&&") OR
- # (ARGN MATCHES "||") OR
- # (ARGN MATCHES "\\;"))
- # message("Please report the following error to the project!")
- # message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
- #endif()
+ # TODO sanitize
+ #if((${ARGN}" MATCHES "&&") OR
+ # (ARGN MATCHES "||") OR
+ # (ARGN MATCHES "\\;"))
+ # message("Please report the following error to the project!")
+ # message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
+ #endif()
- #message(STATUS "Arguments to execute_process: ${ARGN}")
+ #message(STATUS "Arguments to execute_process: ${ARGN}")
- execute_process(COMMAND
- "${GIT_EXECUTABLE}"
- describe
- ${hash}
- ${ARGN}
- WORKING_DIRECTORY
- "${CMAKE_CURRENT_SOURCE_DIR}"
- RESULT_VARIABLE
- res
- OUTPUT_VARIABLE
- out
- ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- if(NOT res EQUAL 0)
- set(out "${out}-${res}-NOTFOUND")
- endif()
+ execute_process(COMMAND
+ "${GIT_EXECUTABLE}"
+ describe
+ ${hash}
+ ${ARGN}
+ WORKING_DIRECTORY
+ "${CMAKE_CURRENT_SOURCE_DIR}"
+ RESULT_VARIABLE
+ res
+ OUTPUT_VARIABLE
+ out
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(NOT res EQUAL 0)
+ set(out "${out}-${res}-NOTFOUND")
+ endif()
- set(${_var} "${out}" PARENT_SCOPE)
+ set(${_var} "${out}" PARENT_SCOPE)
endfunction()
function(git_get_exact_tag _var)
- git_describe(out --exact-match ${ARGN})
- set(${_var} "${out}" PARENT_SCOPE)
+ git_describe(out --exact-match ${ARGN})
+ set(${_var} "${out}" PARENT_SCOPE)
endfunction()
diff --git a/cmake/GetGitRevisionDescription.cmake.in b/cmake/GetGitRevisionDescription.cmake.in
index 6d8b708e..04db9a8e 100644
--- a/cmake/GetGitRevisionDescription.cmake.in
+++ b/cmake/GetGitRevisionDescription.cmake.in
@@ -19,23 +19,23 @@ file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
if(HEAD_CONTENTS MATCHES "ref")
- # named branch
- string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
- if(EXISTS "@GIT_DIR@/${HEAD_REF}")
- configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
- else()
- configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
- file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
- if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
- set(HEAD_HASH "${CMAKE_MATCH_1}")
- endif()
- endif()
+ # named branch
+ string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
+ if(EXISTS "@GIT_DIR@/${HEAD_REF}")
+ configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
+ else()
+ configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
+ file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
+ if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
+ set(HEAD_HASH "${CMAKE_MATCH_1}")
+ endif()
+ endif()
else()
- # detached HEAD
- configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
+ # detached HEAD
+ configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
endif()
if(NOT HEAD_HASH)
- file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
- string(STRIP "${HEAD_HASH}" HEAD_HASH)
+ file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
+ string(STRIP "${HEAD_HASH}" HEAD_HASH)
endif()
diff --git a/cmake/GitFunctions.cmake b/cmake/GitFunctions.cmake
index 898e7b01..a055b5de 100644
--- a/cmake/GitFunctions.cmake
+++ b/cmake/GitFunctions.cmake
@@ -9,29 +9,29 @@ include(CMakeParseArguments)
if(GIT_FOUND)
function(git_run)
- set(oneValueArgs OUTPUT_VAR DEFAULT)
- set(multiValueArgs COMMAND)
- cmake_parse_arguments(GIT_RUN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+ set(oneValueArgs OUTPUT_VAR DEFAULT)
+ set(multiValueArgs COMMAND)
+ cmake_parse_arguments(GIT_RUN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
- execute_process(COMMAND ${GIT_EXECUTABLE} ${GIT_RUN_COMMAND}
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- RESULT_VARIABLE GIT_RESULTVAR
- OUTPUT_VARIABLE GIT_OUTVAR
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
+ execute_process(COMMAND ${GIT_EXECUTABLE} ${GIT_RUN_COMMAND}
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ RESULT_VARIABLE GIT_RESULTVAR
+ OUTPUT_VARIABLE GIT_OUTVAR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
- if(GIT_RESULTVAR EQUAL 0)
- set(${GIT_RUN_OUTPUT_VAR} "${GIT_OUTVAR}" PARENT_SCOPE)
- else()
- set(${GIT_RUN_OUTPUT_VAR} ${GIT_RUN_DEFAULT})
- message(STATUS "Failed to run Git: ${GIT_OUTVAR}")
- endif()
+ if(GIT_RESULTVAR EQUAL 0)
+ set(${GIT_RUN_OUTPUT_VAR} "${GIT_OUTVAR}" PARENT_SCOPE)
+ else()
+ set(${GIT_RUN_OUTPUT_VAR} ${GIT_RUN_DEFAULT})
+ message(STATUS "Failed to run Git: ${GIT_OUTVAR}")
+ endif()
endfunction()
else()
function(git_run)
- set(oneValueArgs OUTPUT_VAR DEFAULT)
- set(multiValueArgs COMMAND)
- cmake_parse_arguments(GIT_RUN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
- set(${GIT_RUN_OUTPUT_VAR} ${GIT_RUN_DEFAULT})
+ set(oneValueArgs OUTPUT_VAR DEFAULT)
+ set(multiValueArgs COMMAND)
+ cmake_parse_arguments(GIT_RUN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+ set(${GIT_RUN_OUTPUT_VAR} ${GIT_RUN_DEFAULT})
endfunction(git_run)
endif()
diff --git a/cmake/MacOSXBundleInfo.plist.in b/cmake/MacOSXBundleInfo.plist.in
index 809fab00..050123ee 100644
--- a/cmake/MacOSXBundleInfo.plist.in
+++ b/cmake/MacOSXBundleInfo.plist.in
@@ -2,39 +2,39 @@
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
- <key>NSHighResolutionCapable</key>
- <string>True</string>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>${MACOSX_BUNDLE_INFO_STRING}</string>
- <key>CFBundleIconFile</key>
- <string>${MACOSX_BUNDLE_ICON_FILE}</string>
- <key>CFBundleIdentifier</key>
- <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleLongVersionString</key>
- <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
- <key>CFBundleName</key>
- <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
- <key>CSResourcesFileMapped</key>
- <true/>
- <key>LSRequiresCarbon</key>
- <true/>
- <key>NSHumanReadableCopyright</key>
- <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+ <key>NSHighResolutionCapable</key>
+ <string>True</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+ <key>CFBundleGetInfoString</key>
+ <string>${MACOSX_BUNDLE_INFO_STRING}</string>
+ <key>CFBundleIconFile</key>
+ <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+ <key>CFBundleIdentifier</key>
+ <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleLongVersionString</key>
+ <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
+ <key>CFBundleName</key>
+ <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+ <key>CSResourcesFileMapped</key>
+ <true/>
+ <key>LSRequiresCarbon</key>
+ <true/>
+ <key>NSHumanReadableCopyright</key>
+ <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
</dict>
</plist>
diff --git a/cmake/UnitTest.cmake b/cmake/UnitTest.cmake
index 2552b32c..9f2bc269 100644
--- a/cmake/UnitTest.cmake
+++ b/cmake/UnitTest.cmake
@@ -5,44 +5,44 @@ set(TEST_RESOURCE_PATH ${CMAKE_CURRENT_LIST_DIR})
message(${TEST_RESOURCE_PATH})
function(add_unit_test name)
- set(options "")
- set(oneValueArgs DATA)
- set(multiValueArgs SOURCES LIBS)
-
- cmake_parse_arguments(OPT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
-
- if(WIN32)
- add_executable(${name}_test ${OPT_SOURCES} ${TEST_RESOURCE_PATH}/UnitTest/test.rc)
- else()
- add_executable(${name}_test ${OPT_SOURCES})
- endif()
-
- if(NOT "${OPT_DATA}" STREQUAL "")
- set(TEST_DATA_PATH "${CMAKE_CURRENT_BINARY_DIR}/data")
- set(TEST_DATA_PATH_SRC "${CMAKE_CURRENT_SOURCE_DIR}/${OPT_DATA}")
- message("From ${TEST_DATA_PATH_SRC} to ${TEST_DATA_PATH}")
- string(REGEX REPLACE "[/\\:]" "_" DATA_TARGET_NAME "${TEST_DATA_PATH_SRC}")
- if(UNIX)
- # on unix we get the third / from the filename
- set(TEST_DATA_URL "file://${TEST_DATA_PATH}")
- else()
- # we don't on windows, so we have to add it ourselves
- set(TEST_DATA_URL "file:///${TEST_DATA_PATH}")
- endif()
- if(NOT TARGET "${DATA_TARGET_NAME}")
- add_custom_target(${DATA_TARGET_NAME})
- add_dependencies(${name}_test ${DATA_TARGET_NAME})
- add_custom_command(
- TARGET ${DATA_TARGET_NAME}
- COMMAND ${CMAKE_COMMAND} "-DTEST_DATA_URL=${TEST_DATA_URL}" -DSOURCE=${TEST_DATA_PATH_SRC} -DDESTINATION=${TEST_DATA_PATH} -P ${TEST_RESOURCE_PATH}/UnitTest/generate_test_data.cmake
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- )
- endif()
- endif()
-
- target_link_libraries(${name}_test Qt5::Test ${OPT_LIBS})
-
- target_include_directories(${name}_test PRIVATE "${TEST_RESOURCE_PATH}/UnitTest/")
-
- add_test(NAME ${name} COMMAND ${name}_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+ set(options "")
+ set(oneValueArgs DATA)
+ set(multiValueArgs SOURCES LIBS)
+
+ cmake_parse_arguments(OPT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
+
+ if(WIN32)
+ add_executable(${name}_test ${OPT_SOURCES} ${TEST_RESOURCE_PATH}/UnitTest/test.rc)
+ else()
+ add_executable(${name}_test ${OPT_SOURCES})
+ endif()
+
+ if(NOT "${OPT_DATA}" STREQUAL "")
+ set(TEST_DATA_PATH "${CMAKE_CURRENT_BINARY_DIR}/data")
+ set(TEST_DATA_PATH_SRC "${CMAKE_CURRENT_SOURCE_DIR}/${OPT_DATA}")
+ message("From ${TEST_DATA_PATH_SRC} to ${TEST_DATA_PATH}")
+ string(REGEX REPLACE "[/\\:]" "_" DATA_TARGET_NAME "${TEST_DATA_PATH_SRC}")
+ if(UNIX)
+ # on unix we get the third / from the filename
+ set(TEST_DATA_URL "file://${TEST_DATA_PATH}")
+ else()
+ # we don't on windows, so we have to add it ourselves
+ set(TEST_DATA_URL "file:///${TEST_DATA_PATH}")
+ endif()
+ if(NOT TARGET "${DATA_TARGET_NAME}")
+ add_custom_target(${DATA_TARGET_NAME})
+ add_dependencies(${name}_test ${DATA_TARGET_NAME})
+ add_custom_command(
+ TARGET ${DATA_TARGET_NAME}
+ COMMAND ${CMAKE_COMMAND} "-DTEST_DATA_URL=${TEST_DATA_URL}" -DSOURCE=${TEST_DATA_PATH_SRC} -DDESTINATION=${TEST_DATA_PATH} -P ${TEST_RESOURCE_PATH}/UnitTest/generate_test_data.cmake
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+ endif()
+ endif()
+
+ target_link_libraries(${name}_test Qt5::Test ${OPT_LIBS})
+
+ target_include_directories(${name}_test PRIVATE "${TEST_RESOURCE_PATH}/UnitTest/")
+
+ add_test(NAME ${name} COMMAND ${name}_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endfunction()
diff --git a/cmake/UnitTest/TestUtil.h b/cmake/UnitTest/TestUtil.h
index 84f18a2e..a478bdde 100644
--- a/cmake/UnitTest/TestUtil.h
+++ b/cmake/UnitTest/TestUtil.h
@@ -11,16 +11,16 @@
class TestsInternal
{
public:
- static QByteArray readFile(const QString &fileName)
- {
- QFile f(fileName);
- f.open(QFile::ReadOnly);
- return f.readAll();
- }
- static QString readFileUtf8(const QString &fileName)
- {
- return QString::fromUtf8(readFile(fileName));
- }
+ static QByteArray readFile(const QString &fileName)
+ {
+ QFile f(fileName);
+ f.open(QFile::ReadOnly);
+ return f.readAll();
+ }
+ static QString readFileUtf8(const QString &fileName)
+ {
+ return QString::fromUtf8(readFile(fileName));
+ }
};
#define MULTIMC_GET_TEST_FILE(file) TestsInternal::readFile(QFINDTESTDATA(file))
diff --git a/cmake/UnitTest/generate_test_data.cmake b/cmake/UnitTest/generate_test_data.cmake
index d9250fab..d0bd4ab1 100644
--- a/cmake/UnitTest/generate_test_data.cmake
+++ b/cmake/UnitTest/generate_test_data.cmake
@@ -2,22 +2,22 @@
# variables. Create destination directory if it does not exist.
function(configure_files srcDir destDir)
- make_directory(${destDir})
+ make_directory(${destDir})
- file(GLOB templateFiles RELATIVE ${srcDir} ${srcDir}/*)
- foreach(templateFile ${templateFiles})
- set(srcTemplatePath ${srcDir}/${templateFile})
- if(NOT IS_DIRECTORY ${srcTemplatePath})
- configure_file(
- ${srcTemplatePath}
- ${destDir}/${templateFile}
- @ONLY
- NEWLINE_STYLE LF
- )
- else()
- configure_files("${srcTemplatePath}" "${destDir}/${templateFile}")
- endif()
- endforeach()
+ file(GLOB templateFiles RELATIVE ${srcDir} ${srcDir}/*)
+ foreach(templateFile ${templateFiles})
+ set(srcTemplatePath ${srcDir}/${templateFile})
+ if(NOT IS_DIRECTORY ${srcTemplatePath})
+ configure_file(
+ ${srcTemplatePath}
+ ${destDir}/${templateFile}
+ @ONLY
+ NEWLINE_STYLE LF
+ )
+ else()
+ configure_files("${srcTemplatePath}" "${destDir}/${templateFile}")
+ endif()
+ endforeach()
endfunction()
configure_files(${SOURCE} ${DESTINATION}) \ No newline at end of file