File tree 3 files changed +17
-24
lines changed
3 files changed +17
-24
lines changed Original file line number Diff line number Diff line change 1
- cmake_minimum_required (VERSION 2.6 )
1
+ cmake_minimum_required (VERSION 2.8.8 )
2
2
3
3
project (demo-rpg)
4
4
set (target demo-rpg)
@@ -9,9 +9,9 @@ IF(NOT MSVC)
9
9
ADD_DEFINITIONS (-std=c++0x -Werror=return-type )
10
10
ENDIF (NOT MSVC )
11
11
12
-
13
- find_package (Qt4 COMPONENTS QtCore QtGui QtXml REQUIRED )
14
- include ( ${QT_USE_FILE} )
12
+ set ( CMAKE_INCLUDE_CURRENT_DIR ON )
13
+ set ( CMAKE_AUTOMOC ON )
14
+ find_package (Qt5Core REQUIRED )
15
15
16
16
include_directories ("include" "lib/tmx/include" "lib/tmxrenderer/include" )
17
17
@@ -36,22 +36,12 @@ set(sources
36
36
src/MapEvent.cpp
37
37
)
38
38
39
- QT4_WRAP_CPP(moc_sources
40
- include /GameWidget.h
41
- include /GameRenderer.h
42
- include /Game.h
43
- include /Map.h
44
- include /EventTrigger.h
45
- include /Engine.h
46
- )
47
- #QT4_WRAP_UI(ui_headers ...)
48
-
49
39
add_subdirectory ("lib" )
50
40
51
- add_executable (${target} ${sources} ${moc_sources} ${headers} )
52
-
53
- target_link_libraries (${target} tmx tmxrenderer ${QT_LIBRARIES} )
41
+ add_executable (${target} ${sources} ${headers} )
54
42
43
+ target_link_libraries (${target} tmx tmxrenderer)
44
+ qt5_use_modules(${target} Widgets Xml)
55
45
56
46
#copy data
57
47
add_custom_command (
Original file line number Diff line number Diff line change @@ -7,9 +7,10 @@ IF(NOT MSVC)
7
7
ADD_DEFINITIONS (-std=c++0x -Werror=return-type )
8
8
ENDIF (NOT MSVC )
9
9
10
+ set (CMAKE_INCLUDE_CURRENT_DIR ON )
11
+ set (CMAKE_AUTOMOC ON )
12
+ find_package (Qt5Core REQUIRED)
10
13
find_package (ZLIB REQUIRED)
11
- find_package (Qt4 COMPONENTS QtCore QtXml REQUIRED)
12
- include (${QT_USE_FILE} )
13
14
14
15
include_directories ("include" )
15
16
@@ -37,4 +38,5 @@ set(sources
37
38
38
39
add_library (${target} SHARED ${sources} ${headers} )
39
40
40
- target_link_libraries (${target} ${QT_LIBRARIES} ${ZLIB_LIBRARIES} )
41
+ target_link_libraries (${target} ${ZLIB_LIBRARIES} )
42
+ qt5_use_modules(${target} Widgets Xml)
Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ IF(NOT MSVC)
7
7
ADD_DEFINITIONS (-std=c++0x -Werror=return-type )
8
8
ENDIF (NOT MSVC )
9
9
10
-
11
- find_package (Qt4 COMPONENTS QtCore REQUIRED )
12
- include ( ${QT_USE_FILE} )
10
+ set ( CMAKE_INCLUDE_CURRENT_DIR ON )
11
+ set ( CMAKE_AUTOMOC ON )
12
+ find_package (Qt5Core REQUIRED )
13
13
14
14
include_directories ("include" "../tmx/include" )
15
15
@@ -21,4 +21,5 @@ set(sources
21
21
22
22
add_library (${target} SHARED ${sources} ${headers} )
23
23
24
- target_link_libraries (${target} tmx ${QT_LIBRARIES} )
24
+ target_link_libraries (${target} tmx)
25
+ qt5_use_modules(${target} Widgets)
You can’t perform that action at this time.
0 commit comments