2013-08-22 17:22:49 +03:00
|
|
|
project(vcmilauncher)
|
|
|
|
cmake_minimum_required(VERSION 2.8.7)
|
|
|
|
|
2016-08-12 08:38:26 +02:00
|
|
|
include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_HOME_DIRECTORY}/include ${CMAKE_CURRENT_SOURCE_DIR})
|
2014-10-12 16:33:38 +03:00
|
|
|
include_directories(${ZLIB_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS})
|
2016-08-30 20:54:37 +02:00
|
|
|
include_directories(${SDL_INCLUDE_DIR})
|
2013-08-22 17:22:49 +03:00
|
|
|
|
|
|
|
set(launcher_modmanager_SRCS
|
2013-08-24 23:11:51 +03:00
|
|
|
modManager/cdownloadmanager_moc.cpp
|
2013-08-22 17:22:49 +03:00
|
|
|
modManager/cmodlist.cpp
|
2013-08-24 23:11:51 +03:00
|
|
|
modManager/cmodlistmodel_moc.cpp
|
|
|
|
modManager/cmodlistview_moc.cpp
|
2013-08-22 17:22:49 +03:00
|
|
|
modManager/cmodmanager.cpp
|
2014-03-29 15:46:41 +03:00
|
|
|
modManager/imageviewer_moc.cpp
|
2013-08-22 17:22:49 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
set(launcher_settingsview_SRCS
|
2013-08-24 23:11:51 +03:00
|
|
|
settingsView/csettingsview_moc.cpp
|
2013-08-22 17:22:49 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
set(launcher_SRCS
|
2014-02-05 23:25:36 +03:00
|
|
|
StdInc.cpp
|
2013-08-22 17:22:49 +03:00
|
|
|
${launcher_modmanager_SRCS}
|
|
|
|
${launcher_settingsview_SRCS}
|
|
|
|
main.cpp
|
2013-08-24 23:11:51 +03:00
|
|
|
mainwindow_moc.cpp
|
2013-08-22 17:22:49 +03:00
|
|
|
launcherdirs.cpp
|
2013-09-21 21:29:26 +03:00
|
|
|
jsonutils.cpp
|
2016-08-30 20:54:37 +02:00
|
|
|
sdldisplayquery.cpp
|
2013-08-22 17:22:49 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
set(launcher_FORMS
|
2013-08-24 23:11:51 +03:00
|
|
|
modManager/cmodlistview_moc.ui
|
2014-03-29 15:46:41 +03:00
|
|
|
modManager/imageviewer_moc.ui
|
2013-08-24 23:11:51 +03:00
|
|
|
settingsView/csettingsview_moc.ui
|
|
|
|
mainwindow_moc.ui
|
2013-08-22 17:22:49 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
# Tell CMake to run moc when necessary:
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
|
|
|
|
# As moc files are generated in the binary dir, tell CMake
|
|
|
|
# to always look for includes there:
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
|
|
|
# We need add -DQT_WIDGETS_LIB when using QtWidgets in Qt 5.
|
|
|
|
add_definitions(${Qt5Widgets_DEFINITIONS})
|
|
|
|
add_definitions(${Qt5Network_DEFINITIONS})
|
|
|
|
|
|
|
|
# Executables fail to build with Qt 5 in the default configuration
|
|
|
|
# without -fPIE. We add that here.
|
|
|
|
set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS} ${CMAKE_CXX_FLAGS}")
|
|
|
|
|
|
|
|
qt5_wrap_ui(launcher_UI_HEADERS ${launcher_FORMS})
|
|
|
|
|
2014-07-11 00:57:17 +03:00
|
|
|
if(WIN32)
|
2014-10-12 16:32:02 +03:00
|
|
|
add_executable(vcmilauncher WIN32 ${launcher_SRCS} ${launcher_UI_HEADERS} VCMI_launcher.rc)
|
2014-07-11 01:09:00 +03:00
|
|
|
set_target_properties(vcmilauncher PROPERTIES OUTPUT_NAME VCMI_launcher)
|
2014-07-11 00:57:17 +03:00
|
|
|
else()
|
|
|
|
add_executable(vcmilauncher ${launcher_SRCS} ${launcher_UI_HEADERS})
|
|
|
|
endif()
|
2013-08-22 17:22:49 +03:00
|
|
|
|
2014-10-12 16:40:49 +03:00
|
|
|
if(MSVC)
|
|
|
|
# Fix _WinMain@16 linking error
|
2016-08-30 20:54:37 +02:00
|
|
|
target_link_libraries(vcmilauncher vcmi ${Qt5Core_QTMAIN_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES} ${SDL_LIBRARY})
|
2014-10-12 16:40:49 +03:00
|
|
|
else()
|
|
|
|
# The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
|
2016-08-30 20:54:37 +02:00
|
|
|
target_link_libraries(vcmilauncher vcmi ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES} ${SDL_LIBRARY})
|
2014-10-12 16:40:49 +03:00
|
|
|
endif()
|
2013-08-22 17:22:49 +03:00
|
|
|
|
2014-03-23 19:36:16 +03:00
|
|
|
# temporary(?) disabled - generation of PCH takes too much time since cotire is trying to collect all Qt headers
|
|
|
|
#set_target_properties(vcmilauncher PROPERTIES ${PCH_PROPERTIES})
|
|
|
|
#cotire(vcmilauncher)
|
2014-02-01 16:37:26 +03:00
|
|
|
|
2013-08-22 17:22:49 +03:00
|
|
|
if (NOT APPLE) # Already inside bundle
|
2014-07-11 11:01:03 +03:00
|
|
|
install(TARGETS vcmilauncher DESTINATION ${BIN_DIR})
|
2013-09-05 02:00:51 +03:00
|
|
|
# copy whole directory but .svn control files
|
|
|
|
install(DIRECTORY icons DESTINATION ${DATA_DIR}/launcher PATTERN ".svn" EXCLUDE)
|
2013-08-22 17:22:49 +03:00
|
|
|
endif()
|
|
|
|
|