summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-04-06 20:56:40 +0200
committerPetr Mrázek <peterix@gmail.com>2014-04-06 20:56:40 +0200
commit17d4947b30f00a347d7fb8648040271e4b65f966 (patch)
tree2a67eb53d6a72a39119adec905db5b899f691e3e /cmake
parent6ef38d0873bc424ff72d0eb5363924b00b0cadc2 (diff)
parenteb246c4fa744bd50e008455f5f8363114b4de3eb (diff)
downloadMultiMC-17d4947b30f00a347d7fb8648040271e4b65f966.tar
MultiMC-17d4947b30f00a347d7fb8648040271e4b65f966.tar.gz
MultiMC-17d4947b30f00a347d7fb8648040271e4b65f966.tar.lz
MultiMC-17d4947b30f00a347d7fb8648040271e4b65f966.tar.xz
MultiMC-17d4947b30f00a347d7fb8648040271e4b65f966.zip
Merge remote-tracking branch 'origin/feature_dotcmake' into develop
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Coverage.cmake13
-rw-r--r--cmake/QMakeQuery.cmake14
-rw-r--r--cmake/UseCXX11.cmake13
3 files changed, 40 insertions, 0 deletions
diff --git a/cmake/Coverage.cmake b/cmake/Coverage.cmake
new file mode 100644
index 00000000..28efbf1c
--- /dev/null
+++ b/cmake/Coverage.cmake
@@ -0,0 +1,13 @@
+if(__COVERAGE_CMAKE__)
+ return()
+endif()
+set(__COVERAGE_CMAKE__ TRUE)
+
+if(MultiMC_CODE_COVERAGE)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 --coverage")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 --coverage")
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 --coverage")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O0 --coverage")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -O0 --coverage")
+ set(CMAKE_BUILD_TYPE "Debug")
+endif(MultiMC_CODE_COVERAGE)
diff --git a/cmake/QMakeQuery.cmake b/cmake/QMakeQuery.cmake
new file mode 100644
index 00000000..bf0fe967
--- /dev/null
+++ b/cmake/QMakeQuery.cmake
@@ -0,0 +1,14 @@
+if(__QMAKEQUERY_CMAKE__)
+ return()
+endif()
+set(__QMAKEQUERY_CMAKE__ TRUE)
+
+get_target_property(QMAKE_EXECUTABLE Qt5::qmake LOCATION)
+
+function(QUERY_QMAKE VAR RESULT)
+ exec_program(${QMAKE_EXECUTABLE} ARGS "-query ${VAR}" RETURN_VALUE return_code OUTPUT_VARIABLE output )
+ if(NOT return_code)
+ file(TO_CMAKE_PATH "${output}" output)
+ set(${RESULT} ${output} PARENT_SCOPE)
+ endif(NOT return_code)
+endfunction(QUERY_QMAKE)
diff --git a/cmake/UseCXX11.cmake b/cmake/UseCXX11.cmake
new file mode 100644
index 00000000..e94de2bb
--- /dev/null
+++ b/cmake/UseCXX11.cmake
@@ -0,0 +1,13 @@
+if(__USECXX11_CMAKE__)
+ return()
+endif()
+set(__USECXX11_CMAKE__ TRUE)
+
+if(APPLE)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+elseif(UNIX)
+ # assume GCC, add C++0x/C++11 stuff
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+elseif(MINGW)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
+endif()