2018-09-26 14:40:41 +00:00
macro ( import_qt_modules )
set ( REQUIRED_QT_VERSION "5.9.1" )
set ( QTCONFIGROOT ${ QTROOT } /lib/cmake/Qt5 )
foreach ( COMP ${ USED_QT_MODULES } )
set ( mod Qt5 ${ COMP } )
# look for the config files in the QtConfigRoot defined above
set ( ${ mod } _DIR ${ QTCONFIGROOT } ${ COMP } )
# look for the actual package
find_package ( ${ mod } ${ REQUIRED_QT_VERSION } REQUIRED )
#message("${mod}_INCLUDE_DIRS: include_directories(${${mod}_INCLUDE_DIRS})")
include_directories ( ${ ${mod } _INCLUDE_DIRS} )
2018-12-15 18:57:00 +00:00
if ( ${ COMP } STREQUAL "Quick" )
# We need to include the private headers for QZipWriter. If in the future we can't use that class anymore, we can always resort to the QuaZIP OSS library
include_directories ( ${ ${mod } _PRIVATE_INCLUDE_DIRS} )
endif ( )
2018-09-26 14:40:41 +00:00
list ( APPEND QT5_LIBRARIES ${ ${mod } _LIBRARIES} )
list ( APPEND QT5_CFLAGS ${ ${mod } _EXECUTABLE_COMPILE_FLAGS} )
endforeach ( COMP ${ USED_QT_MODULES } )
endmacro ( import_qt_modules )
if ( WIN32 )
# Download automatically, you can also just copy the conan.cmake file
# TODO: Create packages of qt5 for Linux and MacOS too, so that we can rely strictly on this branch of code
if ( NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake" )
message ( STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan" )
2018-11-20 13:07:34 +00:00
file ( DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/9cc97acda619b7917f140415241785a864482b11/conan.cmake"
2018-09-26 14:40:41 +00:00
" $ { C M A K E _ B I N A R Y _ D I R } / c o n a n . c m a k e " )
endif ( )
include ( ${ CMAKE_BINARY_DIR } /conan.cmake )
conan_check ( )
if ( USE_QTWEBKIT )
set ( _QT_PACKAGE_OPTIONS "qt5-mxe:webkit=True" )
endif ( )
conan_cmake_run ( REQUIRES qt5-mxe/5.11.2@status-im/stable
P R O F I L E . . / n o d e _ m o d u l e s / s t a t u s - c o n a n / p r o f i l e s / s t a t u s - m i n g w 3 2 - x 8 6 _ 6 4
2018-11-20 13:07:34 +00:00
S E T T I N G S " q t 5 - m x e : o s = W i n d o w s " " q t 5 - m x e : a r c h = x 8 6 _ 6 4 "
2018-09-26 14:40:41 +00:00
O P T I O N S $ { _ Q T _ P A C K A G E _ O P T I O N S }
B U I L D n e v e r )
set ( QTROOT "${CONAN_QT5-MXE_ROOT}" )
else ( WIN32 )
set ( QTROOT "$ENV{QT_PATH}" )
endif ( WIN32 )
if ( NOT EXISTS ${ QTROOT } /bin/qt.conf )
if ( EXISTS ${ QTROOT } /gcc_64/bin/qt.conf )
set ( QTROOT "${QTROOT}/gcc_64" )
2018-11-15 09:08:40 +00:00
elseif ( EXISTS ${ QTROOT } /clang_64/bin/qt.conf )
set ( QTROOT "${QTROOT}/clang_64" )
2018-09-26 14:40:41 +00:00
else ( )
2018-11-15 09:08:40 +00:00
message ( FATAL_ERROR "Could not find qt.conf in ${QTROOT}/bin nor in ${QTROOT}/clang_64/bin nor in ${QTROOT}/gcc_64/bin. Is QTROOT correctly defined?" )
2018-09-26 14:40:41 +00:00
endif ( )
endif ( )
if ( WIN32 )
set ( WINARCHSTR ARCHSTR windows-x86_64 )
endif ( WIN32 )
message ( STATUS "Qt root directory: ${QTROOT}" )
list ( APPEND CMAKE_FIND_ROOT_PATH ${ QTROOT } )
list ( APPEND CMAKE_PREFIX_PATH ${ QTROOT } )
include_directories ( ${ QTROOT } /include )
import_qt_modules ( )
if ( QT5_CFLAGS )
list ( REMOVE_DUPLICATES QT5_CFLAGS )
if ( WIN32 )
list ( REMOVE_ITEM QT5_CFLAGS -fPIC )
endif ( WIN32 )
endif ( QT5_CFLAGS )
message ( STATUS "Qt version: ${Qt5Core_VERSION_STRING}" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${QT5_CFLAGS}" )
set ( CMAKE_REQUIRED_LIBRARIES ${ QT5_LIBRARIES } )