Skip to content

Commit

Permalink
Fix debug build for XCode with CMake>=3.5.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
avm committed Apr 25, 2016
1 parent 994090f commit 26b4256
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions mtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,19 @@ endif(APPLE)

string(REPLACE ";" ";-I" INC "${QT_INCLUDES}")

if (APPLE)
if (APPLE AND (CMAKE_VERSION VERSION_LESS "3.5.0"))
set_target_properties (
testutils
PROPERTIES
COMPILE_FLAGS "-include all.h -D TESTROOT=\\\\\"${PROJECT_SOURCE_DIR}\\\\\" -g -Wall -Wextra"
)
else (APPLE)
else (APPLE AND (CMAKE_VERSION VERSION_LESS "3.5.0"))
set_target_properties (
testutils
PROPERTIES
COMPILE_FLAGS "-include all.h -D TESTROOT=\\\"${PROJECT_SOURCE_DIR}\\\" -g -Wall -Wextra"
)
endif(APPLE)
endif (APPLE AND (CMAKE_VERSION VERSION_LESS "3.5.0"))

# COMPILE_FLAGS "-include all.h -I ${INC} -D TESTROOT=\\\"${PROJECT_SOURCE_DIR}\\\" -g -Wall -Wextra"

Expand Down
10 changes: 9 additions & 1 deletion mtest/cmake.inc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ set_target_properties (
${TARGET}
PROPERTIES
AUTOMOC true
COMPILE_FLAGS "-include all.h -D QT_GUI_LIB -D TESTROOT=\\\\\"${PROJECT_SOURCE_DIR}\\\\\" -g -Wall -Wextra"
COMPILE_FLAGS "-include all.h -D QT_GUI_LIB -D TESTROOT=\\\"${PROJECT_SOURCE_DIR}\\\" -g -Wall -Wextra"
LINK_FLAGS "-g -stdlib=libc++"
)
else(APPLE)
Expand All @@ -69,4 +69,12 @@ set_target_properties (
)
endif(APPLE)

if (APPLE AND (CMAKE_VERSION VERSION_LESS "3.5.0"))
set_target_properties (
${TARGET}
PROPERTIES
COMPILE_FLAGS "-include all.h -D QT_GUI_LIB -D TESTROOT=\\\\\"${PROJECT_SOURCE_DIR}\\\\\" -g -Wall -Wextra"
)
endif (APPLE AND (CMAKE_VERSION VERSION_LESS "3.5.0"))

add_test(${TARGET} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET} -xunitxml -o result.xml)

0 comments on commit 26b4256

Please sign in to comment.