QTfrontend/CMakeLists.txt
changeset 8350 14b938faec69
parent 8347 716c05f19401
child 8363 0b4ac686fc44
child 8381 588a8e6e2041
equal deleted inserted replaced
8345:9d9b498cfb03 8350:14b938faec69
    60 file(GLOB NetCpp net/*.cpp)
    60 file(GLOB NetCpp net/*.cpp)
    61 file(GLOB ModelCpp model/*.cpp)
    61 file(GLOB ModelCpp model/*.cpp)
    62 file(GLOB_RECURSE UIcpp ui/*.cpp)
    62 file(GLOB_RECURSE UIcpp ui/*.cpp)
    63 file(GLOB UtilCpp util/*.cpp)
    63 file(GLOB UtilCpp util/*.cpp)
    64 
    64 
    65 set(hwfr_src
    65 list(APPEND hwfr_src
    66     ${ModelCpp}
    66     ${ModelCpp}
    67     ${NetCpp}
    67     ${NetCpp}
    68     ${UIcpp}
    68     ${UIcpp}
    69     ${UtilCpp}
    69     ${UtilCpp}
    70     achievements.cpp
    70     achievements.cpp
    81     ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp
    81     ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp
    82     )
    82     )
    83 
    83 
    84 #xfire integration
    84 #xfire integration
    85 if(WIN32)
    85 if(WIN32)
    86     set(hwfr_src ${hwfr_src} xfire.cpp ../misc/xfire/xfiregameclient.cpp)
    86     list(APPEND hwfr_src xfire.cpp ../misc/xfire/xfiregameclient.cpp)
    87 endif(WIN32)
    87 endif(WIN32)
    88 
    88 
    89 if(MINGW)
    89 if(MINGW)
    90     # resource compilation for mingw
    90     # resource compilation for mingw
    91     add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o
    91     add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o
    92                        COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR}
    92                        COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR}
    93                                -i ${CMAKE_CURRENT_SOURCE_DIR}/hedgewars.rc
    93                                -i ${CMAKE_CURRENT_SOURCE_DIR}/hedgewars.rc
    94                                -o ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o)
    94                                -o ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o)
    95     set(hwfr_src ${hwfr_src} ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o)
    95     list(APPEND hwfr_src ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o)
    96 else(MINGW)
    96 else(MINGW)
    97     set(hwfr_src ${hwfr_src} hedgewars.rc)
    97     list(APPEND hwfr_src hedgewars.rc)
    98 endif(MINGW)
    98 endif(MINGW)
    99 
    99 
   100 file(GLOB ModelHdr model/*.h)
   100 file(GLOB ModelHdr model/*.h)
   101 file(GLOB NetHdr net/*.h)
   101 file(GLOB NetHdr net/*.h)
   102 file(GLOB_RECURSE UIhdr ui/*.h)
   102 file(GLOB_RECURSE UIhdr ui/*.h)
   131 set(hwfr_rez hedgewars.qrc)
   131 set(hwfr_rez hedgewars.qrc)
   132 
   132 
   133 if(${BUILD_ENGINE_LIBRARY})
   133 if(${BUILD_ENGINE_LIBRARY})
   134     add_definitions(-DHWLIBRARY=1)
   134     add_definitions(-DHWLIBRARY=1)
   135     set(hwlibname "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}hwengine${CMAKE_SHARED_LIBRARY_SUFFIX}")
   135     set(hwlibname "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}hwengine${CMAKE_SHARED_LIBRARY_SUFFIX}")
   136     set(HW_LINK_LIBS ${hwlibname} ${HW_LINK_LIBS})
   136     list(APPEND HW_LINK_LIBS ${hwlibname})
   137 endif()
   137 endif()
   138 
   138 
   139 qt4_add_resources(hwfr_rez_src ${hwfr_rez})
   139 qt4_add_resources(hwfr_rez_src ${hwfr_rez})
   140 
   140 
   141 qt4_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs})
   141 qt4_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs})
   142 
   142 
   143 
   143 
   144 if(APPLE)
   144 if(APPLE)
   145     find_library(iokit_framework NAMES IOKit)
   145     find_library(iokit_framework NAMES IOKit)
   146     set(HW_LINK_LIBS ${iokit_framework} ${HW_LINK_LIBS})
   146     list(APPEND HW_LINK_LIBS ${iokit_framework})
   147     set(hwfr_src ${hwfr_src} CocoaInitializer.mm
   147     list(APPEND hwfr_src CocoaInitializer.mm
   148                              InstallController.cpp
   148                              InstallController.cpp
   149                              M3Panel.mm
   149                              M3Panel.mm
   150                              M3InstallController.m
   150                              M3InstallController.m
   151                              NSWorkspace_RBAdditions.m
   151                              NSWorkspace_RBAdditions.m
   152                              )
   152                              )
   153     if(NOT NOAUTOUPDATE)
   153     if(NOT NOAUTOUPDATE)
   154         find_package(Sparkle)
   154         find_package(Sparkle)
   155         if(SPARKLE_FOUND)
   155         if(SPARKLE_FOUND)
   156             add_definitions(-DSPARKLE_ENABLED)
   156             add_definitions(-DSPARKLE_ENABLED)
   157             set(hwfr_src ${hwfr_src} AutoUpdater.cpp SparkleAutoUpdater.mm)
   157             list(APPEND hwfr_src AutoUpdater.cpp SparkleAutoUpdater.mm)
   158             set(HW_LINK_LIBS ${SPARKLE_LIBRARY} ${HW_LINK_LIBS})
   158             list(APPEND HW_LINK_LIBS ${SPARKLE_LIBRARY})
   159         endif()
   159         endif()
   160     endif()
   160     endif()
   161 endif()
   161 endif()
   162 
   162 
   163 #when debugging, always prompt a console to see fronted messages
   163 #when debugging, always prompt a console to see fronted messages
   175 
   175 
   176 if((UNIX AND NOT APPLE) AND ${BUILD_ENGINE_LIBRARY})
   176 if((UNIX AND NOT APPLE) AND ${BUILD_ENGINE_LIBRARY})
   177     set_target_properties(hedgewars PROPERTIES LINK_FLAGS "-Wl,-rpath,${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}")
   177     set_target_properties(hedgewars PROPERTIES LINK_FLAGS "-Wl,-rpath,${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}")
   178 endif()
   178 endif()
   179 
   179 
   180 set(HW_LINK_LIBS
   180 list(APPEND HW_LINK_LIBS
   181     physfs
   181     physfs
   182     ${QT_LIBRARIES}
   182     ${QT_LIBRARIES}
   183     ${SDL_LIBRARY}
   183     ${SDL_LIBRARY}
   184     ${SDLMIXER_LIBRARY}
   184     ${SDLMIXER_LIBRARY}
   185     ${FFMPEG_LIBRARIES}
   185     ${FFMPEG_LIBRARIES}
   186     ${HW_LINK_LIBS}
       
   187     )
   186     )
   188 
   187 
   189 if(WIN32 AND NOT UNIX)
   188 if(WIN32 AND NOT UNIX)
   190     if(NOT SDL_LIBRARY)
   189     if(NOT SDL_LIBRARY)
   191         set(HW_LINK_LIBS ${HW_LINK_LIBS} SDL)
   190         list(APPEND HW_LINK_LIBS SDL)
   192     endif()
   191     endif()
   193 
   192 
   194     set(HW_LINK_LIBS
   193     list(APPEND HW_LINK_LIBS
   195         ${HW_LINK_LIBS}
       
   196         ole32
   194         ole32
   197         oleaut32
   195         oleaut32
   198         winspool
   196         winspool
   199         uuid
   197         uuid
   200         )
   198         )