From f68dc6210fe9b5f84c1f9fb3e57fc6285d71856c Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 27 Jun 2014 09:24:11 +0200 Subject: Moved CodeCoverage into a separate cmake condition. --- SetFlags.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'SetFlags.cmake') diff --git a/SetFlags.cmake b/SetFlags.cmake index 6e2417a51..b01643f4e 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -26,10 +26,14 @@ endmacro() macro(set_flags) - # Add the preprocessor macros used for distinguishing between debug and release builds (CMake does this automatically for MSVC): - if (NOT MSVC) + # Add coverage processing, if requested: + if (BUILD_WITH_COVERAGE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/lib/cmake-coverage/") include(CodeCoverage) + endif() + + # Add the preprocessor macros used for distinguishing between debug and release builds (CMake does this automatically for MSVC): + if (NOT MSVC) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG") set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_COVERAGE} -D_DEBUG") -- cgit v1.2.3 From 78442edf1d1c10e473741497d17342e7e330a964 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 27 Jun 2014 11:02:28 +0200 Subject: CMake: Added log message for coverage. --- SetFlags.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'SetFlags.cmake') diff --git a/SetFlags.cmake b/SetFlags.cmake index b01643f4e..903ae0ca8 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -28,6 +28,7 @@ endmacro() macro(set_flags) # Add coverage processing, if requested: if (BUILD_WITH_COVERAGE) + message("Including CodeCoverage") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/lib/cmake-coverage/") include(CodeCoverage) endif() -- cgit v1.2.3 From 62669f64dec3f615518af56a864a72d5c18280b8 Mon Sep 17 00:00:00 2001 From: worktycho Date: Fri, 27 Jun 2014 10:27:02 +0100 Subject: Update SetFlags.cmake --- SetFlags.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'SetFlags.cmake') diff --git a/SetFlags.cmake b/SetFlags.cmake index 903ae0ca8..3f91e3d9c 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -27,7 +27,7 @@ endmacro() macro(set_flags) # Add coverage processing, if requested: - if (BUILD_WITH_COVERAGE) + if (CMAKE_BUILD_TYPE STREQUALS "COVERAGE") message("Including CodeCoverage") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/lib/cmake-coverage/") include(CodeCoverage) -- cgit v1.2.3 From 9e1829e4e6de6cf3c6686a8add8317706968bd46 Mon Sep 17 00:00:00 2001 From: worktycho Date: Fri, 27 Jun 2014 10:45:43 +0100 Subject: Update SetFlags.cmake --- SetFlags.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'SetFlags.cmake') diff --git a/SetFlags.cmake b/SetFlags.cmake index 3f91e3d9c..0b5593b19 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -27,7 +27,7 @@ endmacro() macro(set_flags) # Add coverage processing, if requested: - if (CMAKE_BUILD_TYPE STREQUALS "COVERAGE") + if (${CMAKE_BUILD_TYPE} STREQUAL "COVERAGE") message("Including CodeCoverage") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/lib/cmake-coverage/") include(CodeCoverage) -- cgit v1.2.3 From 833d3284356972b06c6f34d7b91d1360a9570c5e Mon Sep 17 00:00:00 2001 From: worktycho Date: Fri, 27 Jun 2014 11:07:03 +0100 Subject: Added MSVC guard --- SetFlags.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'SetFlags.cmake') diff --git a/SetFlags.cmake b/SetFlags.cmake index 0b5593b19..e37dcd82c 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -27,10 +27,12 @@ endmacro() macro(set_flags) # Add coverage processing, if requested: - if (${CMAKE_BUILD_TYPE} STREQUAL "COVERAGE") - message("Including CodeCoverage") - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/lib/cmake-coverage/") - include(CodeCoverage) + if (NOT MSVC) + if (${CMAKE_BUILD_TYPE} STREQUAL "COVERAGE") + message("Including CodeCoverage") + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/lib/cmake-coverage/") + include(CodeCoverage) + endif() endif() # Add the preprocessor macros used for distinguishing between debug and release builds (CMake does this automatically for MSVC): -- cgit v1.2.3 From 9c29afb300200b661e35e3de3b6f26900f43517c Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 27 Jun 2014 12:15:24 +0200 Subject: CMake: pthread is used only on Unix. --- SetFlags.cmake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'SetFlags.cmake') diff --git a/SetFlags.cmake b/SetFlags.cmake index 6e2417a51..290804fb6 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -63,12 +63,16 @@ macro(set_flags) else() # Let gcc / clang know that we're compiling a multi-threaded app: - add_flags_cxx("-pthread") + if (UNIX) + add_flags_cxx("-pthread") + endif() + + # Make CLang use C++11, otherwise MSVC2008-supported extensions don't work ("override" keyword etc.): if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11") set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_COVERAGE} -std=c++11") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11") endif() # We use a signed char (fixes #640 on RasPi) -- cgit v1.2.3 From 6f0a538385ee3fce2fa3e3ffd11bf23dd8db278c Mon Sep 17 00:00:00 2001 From: archshift Date: Wed, 2 Jul 2014 21:19:09 -0700 Subject: SetFlags.cmake: don't use ${} expansion on if STREQUAL See http://stackoverflow.com/questions/19982340/cmake-compare-to-empty-string-with-strequal-failed --- SetFlags.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'SetFlags.cmake') diff --git a/SetFlags.cmake b/SetFlags.cmake index 339174e5c..bf467ca01 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -28,7 +28,8 @@ endmacro() macro(set_flags) # Add coverage processing, if requested: if (NOT MSVC) - if (${CMAKE_BUILD_TYPE} STREQUAL "COVERAGE") + + if (CMAKE_BUILD_TYPE STREQUAL "COVERAGE") message("Including CodeCoverage") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/lib/cmake-coverage/") include(CodeCoverage) -- cgit v1.2.3