Commit b7604290 authored by Cyrille Berger Skott's avatar Cyrille Berger Skott

check for marble that does not involve building anything or using grep.

tested by Elvis Stansvik on KDE 4.8
parent 44f0848a
......@@ -254,15 +254,8 @@ if( MARBLE_FOUND )
##
find_file(MARBLECONTROLBOX_H MarbleControlBox.h ${MARBLE_INCLUDE_DIR})
if( MARBLECONTROLBOX_H )
INCLUDE(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_INCLUDES_SWAP ${CMAKE_REQUIRED_INCLUDES})
set(CMAKE_REQUIRED_LIBRARIES_SWAP ${CMAKE_REQUIRED_LIBRARIES})
set(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${MARBLE_LIBRARIES})
CHECK_CXX_SOURCE_COMPILES ( "#include <${MARBLECONTROLBOX_H}>\nint main(){Marble::MarbleControlBox*p; p->setMarbleWidget(0); return 0;}" SETMARBLEWIDGET)
# subsequent tests will fail if this is not set back.
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SWAP})
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SWAP})
file(READ ${MARBLECONTROLBOX_H} MARBLECONTROLBOX_H_CONTENT)
string(REGEX MATCH "setMarbleWidget" SETMARBLEWIDGET ${MARBLECONTROLBOX_H_CONTENT})
if( SETMARBLEWIDGET )
add_definitions(-DHAVE_SETMARBLEWIDGET)
endif( SETMARBLEWIDGET)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment