QTfrontend/CMakeLists.txt
branchsdl2transition
changeset 11342 ed5a6478e710
parent 11338 7a7611adf715
parent 10783 8e742c9ffdf8
child 11359 c481d087f653
--- a/QTfrontend/CMakeLists.txt	Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/CMakeLists.txt	Tue Nov 10 20:43:13 2015 +0100
@@ -1,5 +1,5 @@
 # Configure for Qt4
-set(QT_MIN_VERSION "4.5.0")
+set(QT_MIN_VERSION "4.7.0")
 include(CheckLibraryExists)
 
 set(QT_USE_QTCORE TRUE)
@@ -13,10 +13,11 @@
 find_package(Qt4 REQUIRED)
 include(${QT_USE_FILE})
 
+# https://bugreports.qt-project.org/browse/QTBUG-17333
 if(APPLE AND
    ${QTVERSION} VERSION_GREATER "4.7.0" AND
    ${QTVERSION} VERSION_LESS "4.7.4")
-    message(FATAL_ERROR "This version of QT is known *not* to work, please update or use a lower version")
+   message(FATAL_ERROR "This version of Qt is known *not* to work, please update or use a lower version")
 endif()
 
 find_package(SDL2 REQUIRED)
@@ -24,10 +25,10 @@
 include_directories(${SDL2_INCLUDE_DIR})
 include_directories(${SDL2MIXER_INCLUDE_DIR})
 
-if(${FFMPEG_FOUND})
+if(LIBAV_FOUND)
     add_definitions(-DVIDEOREC -D__STDC_CONSTANT_MACROS)
-    include_directories(${FFMPEG_INCLUDE_DIR})
-    list(APPEND HW_LINK_LIBS ${FFMPEG_LIBRARIES})
+    include_directories(${LIBAV_INCLUDE_DIR})
+    list(APPEND HW_LINK_LIBS ${LIBAV_LIBRARIES})
 endif()
 
 # server messages localization
@@ -61,9 +62,9 @@
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ui/widget)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/util)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/util/platform)
-include_directories(${PHYSFS_INCLUDE_DIR})
-include_directories(${PHYSLAYER_INCLUDE_DIR})
-
+include_directories(BEFORE ${PHYSFS_INCLUDE_DIR})
+include_directories(BEFORE ${PHYSLAYER_INCLUDE_DIR})
+include_directories(${LUA_INCLUDE_DIR}) #brought by physlayer hwpacksmounter.h
 
 if(UNIX)
     # HACK: in freebsd cannot find iconv.h included via SDL.h
@@ -152,10 +153,15 @@
 
 set(hwfr_rez hedgewars.qrc)
 
-if(${BUILD_ENGINE_LIBRARY})
+if(BUILD_ENGINE_LIBRARY)
     add_definitions(-DHWLIBRARY=1)
     set(hwlibname "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}hwengine${CMAKE_SHARED_LIBRARY_SUFFIX}")
     list(APPEND HW_LINK_LIBS ${hwlibname})
+
+    if(LIBAV_FOUND)
+#        add_subdirectory(avwrapper)
+        list(APPEND HW_LINK_LIBS avwrapper)
+    endif()
 endif()
 
 qt4_add_resources(hwfr_rez_src ${hwfr_rez})
@@ -184,9 +190,9 @@
 
 #when debugging, always prompt a console to see fronted messages
 #TODO: check it doesn't interfere on UNIX
-if(CMAKE_BUILD_TYPE MATCHES "RELEASE")
+if(CMAKE_BUILD_TYPE MATCHES "RELEASE" OR CMAKE_BUILD_TYPE MATCHES "RELWITHDEBINFO")
     set(console_access "WIN32")
-endif(CMAKE_BUILD_TYPE MATCHES "RELEASE")
+endif(CMAKE_BUILD_TYPE MATCHES "RELEASE" OR CMAKE_BUILD_TYPE MATCHES "RELWITHDEBINFO")
 
 add_executable(hedgewars ${console_access}
     ${hwfr_src}
@@ -204,7 +210,7 @@
     ${SDL2_LIBRARY}
     ${SDL2MIXER_LIBRARY}
     )
-
+    
 if(WIN32 AND NOT UNIX)
     if(NOT SDL_LIBRARY)
         list(APPEND HW_LINK_LIBS SDL)
@@ -218,6 +224,10 @@
         )
 endif()
 
+if(CMAKE_CXX_COMPILER MATCHES "clang*")
+    list(APPEND HW_LINK_LIBS stdc++ m)
+endif()
+
 target_link_libraries(hedgewars ${HW_LINK_LIBS})