QTfrontend/CMakeLists.txt
changeset 2652 67d0344aea9f
parent 2641 b08cafb86797
child 2663 d53918cd22bb
equal deleted inserted replaced
2651:9977d8bd95a3 2652:67d0344aea9f
    29 
    29 
    30 
    30 
    31 if(WIN32 AND NOT UNIX)
    31 if(WIN32 AND NOT UNIX)
    32 	set(HEDGEWARS_BINDIR ".")
    32 	set(HEDGEWARS_BINDIR ".")
    33 	set(HEDGEWARS_DATADIR "../share/")
    33 	set(HEDGEWARS_DATADIR "../share/")
    34 else(WIN32 AND NOT UNIX)
    34 else()
    35 	set(HEDGEWARS_BINDIR ${CMAKE_INSTALL_PREFIX})
    35 	set(HEDGEWARS_BINDIR ${CMAKE_INSTALL_PREFIX})
    36 	if(DEFINED DATA_INSTALL_DIR)
    36 	if(DEFINED DATA_INSTALL_DIR)
    37 		set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR})
    37 		set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR})
    38 	else(DEFINED DATA_INSTALL_DIR)
    38 	else()
    39 		set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/share/)
    39 		set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/share/)
    40 	endif(DEFINED DATA_INSTALL_DIR)
    40 	endif()
    41 endif(WIN32 AND NOT UNIX)
    41 endif(WIN32 AND NOT UNIX)
    42 
    42 
    43 
    43 
    44 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hwconsts.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp)
    44 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hwconsts.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp)
    45 
    45 
   138 	ammoSchemeModel.h
   138 	ammoSchemeModel.h
   139 	togglebutton.h
   139 	togglebutton.h
   140 	bgwidget.h
   140 	bgwidget.h
   141 	)
   141 	)
   142 
   142 
   143 if(APPLE)
       
   144 	find_package(Sparkle)
       
   145 
       
   146 	set(hwfr_src ${hwfr_src} InstallController.cpp CocoaInitializer.mm M3Panel.mm M3InstallController.m NSWorkspace_RBAdditions.m)
       
   147 	if(SPARKLE_FOUND)
       
   148 		set(hwfr_src ${hwfr_src} AutoUpdater.cpp SparkleAutoUpdater.mm)
       
   149 	endif()
       
   150 endif()
       
   151 
       
   152 set(	hwfr_hdrs
   143 set(	hwfr_hdrs
   153 	binds.h
   144 	binds.h
   154 	ui_hwform.h
   145 	ui_hwform.h
   155 	predefteams.h
   146 	predefteams.h
   156 	KB.h
   147 	KB.h
   157 	hwconsts.h
   148 	hwconsts.h
   158 )
   149 	)
   159 
   150 
   160 set(hwfr_rez hedgewars.qrc)
   151 set(hwfr_rez hedgewars.qrc)
   161 
   152 
   162 qt4_add_resources(hwfr_rez_src ${hwfr_rez})
   153 qt4_add_resources(hwfr_rez_src ${hwfr_rez})
   163 
   154 
   164 qt4_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs})
   155 qt4_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs})
       
   156 
       
   157 
       
   158 if(APPLE)
       
   159 	set(hwfr_src ${hwfr_src} InstallController.cpp CocoaInitializer.mm M3Panel.mm M3InstallController.m NSWorkspace_RBAdditions.m)
       
   160 	set(HW_LINK_LIBS IOKit)
       
   161 
       
   162 	find_package(Sparkle)
       
   163 	if(SPARKLE_FOUND)
       
   164                 add_definitions(-DSPARKLE_ENABLED)
       
   165 		set(hwfr_src ${hwfr_src} AutoUpdater.cpp SparkleAutoUpdater.mm)
       
   166                 set(HW_LINK_LIBS ${SPARKLE_LIBRARY} ${HW_LINK_LIBS})
       
   167 	endif()
       
   168 endif()
       
   169 
   165 
   170 
   166 add_executable(hedgewars WIN32
   171 add_executable(hedgewars WIN32
   167 	${hwfr_src}
   172 	${hwfr_src}
   168 	${hwfr_moc_srcs}
   173 	${hwfr_moc_srcs}
   169 	${hwfr_hdrs}
   174 	${hwfr_hdrs}
   170 	${hwfr_rez_src}
   175 	${hwfr_rez_src}
   171 	)
   176 	)
   172 
   177 
   173 
   178 
   174 set(HW_LINK_LIBS 
   179 set(	HW_LINK_LIBS 
   175 	${QT_LIBRARIES}
   180 	${QT_LIBRARIES}
   176 	${SDL_LIBRARY}
   181 	${SDL_LIBRARY}
   177 	${SDLMIXER_LIBRARY}
   182 	${SDLMIXER_LIBRARY}
   178 	)
   183 	${HW_LINK_LIBS}
   179 
   184 	)
   180 if(APPLE)
       
   181 	set(HW_LINK_LIBS IOKit ${HW_LINK_LIBS})
       
   182         if (SPARKLE_FOUND)
       
   183                 set(HW_LINK_LIBS ${HW_LINK_LIBS} ${SPARKLE_LIBRARY})
       
   184                 add_definitions(-DSPARKLE_ENABLED)
       
   185         endif()
       
   186 endif()
       
   187 
       
   188 
   185 
   189 if(WIN32 AND NOT UNIX)
   186 if(WIN32 AND NOT UNIX)
   190 	if(NOT SDL_LIBRARY)
   187 	if(NOT SDL_LIBRARY)
   191 		set(HW_LINK_LIBS ${HW_LINK_LIBS} SDL)
   188 		set(HW_LINK_LIBS ${HW_LINK_LIBS} SDL)
   192 	endif(NOT SDL_LIBRARY)
   189 	endif(NOT SDL_LIBRARY)
   193 
   190 
   194 	set(HW_LINK_LIBS 
   191 	set(	HW_LINK_LIBS 
   195 		${HW_LINK_LIBS}
   192 		${HW_LINK_LIBS}
   196 		ole32
   193 		ole32
   197 		oleaut32
   194 		oleaut32
   198 		winspool
   195 		winspool
   199 		uuid
   196 		uuid