CMakeLists.txt
branchtransitional_engine
changeset 15975 2146cb7be36f
parent 15900 128ace913837
parent 15952 28b692ef6f15
child 16009 7544a7d7c819
equal deleted inserted replaced
15928:772a43d88e6b 15975:2146cb7be36f
       
     1 cmake_minimum_required(VERSION 2.6.4)
       
     2 
     1 project(hedgewars)
     3 project(hedgewars)
     2 
     4 
     3 
       
     4 #initialise cmake environment
     5 #initialise cmake environment
     5 cmake_minimum_required(VERSION 2.6.4)
       
     6 foreach(hwpolicy CMP0003 CMP0012 CMP0017 CMP0018)
     6 foreach(hwpolicy CMP0003 CMP0012 CMP0017 CMP0018)
     7     if(POLICY ${hwpolicy})
     7     if(POLICY ${hwpolicy})
     8         cmake_policy(SET ${hwpolicy} NEW)
     8         cmake_policy(SET ${hwpolicy} NEW)
     9     endif()
     9     endif()
    10 endforeach()
    10 endforeach()
   175     list(APPEND haskell_flags "-Wall"       # all warnings
   175     list(APPEND haskell_flags "-Wall"       # all warnings
   176                               "-debug"      # debug mode
   176                               "-debug"      # debug mode
   177                               "-fno-warn-unused-do-bind"
   177                               "-fno-warn-unused-do-bind"
   178                               "-O0"
   178                               "-O0"
   179                               )
   179                               )
       
   180     set(USE_DEBUG_LIBRARIES TRUE)
   180 else()
   181 else()
   181     list(APPEND haskell_flags "-w" # no warnings
   182     list(APPEND haskell_flags "-w" # no warnings
   182                               "-O2"
   183                               "-O2"
   183                               )
   184                               )
   184 endif()
   185 endif()
   247 endif()
   248 endif()
   248 
   249 
   249 if(PHYSFS_LIBRARY AND PHYSFS_INCLUDE_DIR)
   250 if(PHYSFS_LIBRARY AND PHYSFS_INCLUDE_DIR)
   250     #use an IMPORTED tharget so that we can just use 'physfs' to link
   251     #use an IMPORTED tharget so that we can just use 'physfs' to link
   251     add_library(physfs UNKNOWN IMPORTED)
   252     add_library(physfs UNKNOWN IMPORTED)
   252     set_target_properties(physfs PROPERTIES IMPORTED_LOCATION ${PHYSFS_LIBRARY})
   253     if (DEFINED PHYSFS_LIBRARY_RELEASE)
       
   254         if (${USE_DEBUG_LIBRARIES})
       
   255             set_target_properties(physfs PROPERTIES IMPORTED_LOCATION ${PHYSFS_LIBRARY_DEBUG})
       
   256         else()    
       
   257             set_target_properties(physfs PROPERTIES IMPORTED_LOCATION ${PHYSFS_LIBRARY_RELEASE})
       
   258         endif()
       
   259     else()
       
   260         set_target_properties(physfs PROPERTIES IMPORTED_LOCATION ${PHYSFS_LIBRARY})
       
   261     endif()
   253 else()
   262 else()
   254     message(FATAL_ERROR "Missing PhysFS! Install PhysFS to fix this.")
   263     message(FATAL_ERROR "Missing PhysFS! Install PhysFS to fix this.")
   255 endif()
   264 endif()
   256 
   265 
   257 find_package_or_disable_msg(LIBAV NOVIDEOREC "Video recording will not be built")
   266 find_package_or_disable_msg(LIBAV NOVIDEOREC "Video recording will not be built")