-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
88 lines (73 loc) · 3.52 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
if (APP AND EDITOR)
# TODO Multiple definition errors on linking
if (NOT WIN32)
add_executable(wc3editor wc3editor.cpp)
target_link_libraries(wc3editor ${wc3lib_CORE_LIBRARIES} wc3libeditor wc3libtextureeditor wc3libtriggereditor wc3libobjecteditor wc3libmpqeditor)
if (MDLX AND USE_OGREBLP)
target_link_libraries(wc3editor wc3libmodeleditor)
endif ()
install(TARGETS wc3editor DESTINATION bin)
endif ()
add_executable(wc3object wc3object.cpp)
target_link_libraries(wc3object ${wc3lib_CORE_LIBRARIES} wc3libobjecteditor)
install(TARGETS wc3object DESTINATION bin)
add_executable(wc3objectvalidate wc3objectvalidate.cpp)
target_link_libraries(wc3objectvalidate ${wc3lib_CORE_LIBRARIES} wc3libobjecteditor)
install(TARGETS wc3objectvalidate DESTINATION bin)
add_executable(wc3texture wc3texture.cpp)
target_link_libraries(wc3texture ${wc3lib_CORE_LIBRARIES} wc3libtextureeditor)
install(TARGETS wc3texture DESTINATION bin)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../mpqeditor)
add_executable(wc3mpq wc3mpq.cpp)
target_link_libraries(wc3mpq ${wc3lib_CORE_LIBRARIES} wc3libmpqeditor)
install(TARGETS wc3mpq DESTINATION bin)
if (MDLX AND USE_OGREBLP)
add_executable(wc3terrain wc3terrain.cpp)
target_link_libraries(wc3terrain ${wc3lib_CORE_LIBRARIES} wc3libterraineditor)
install(TARGETS wc3terrain DESTINATION bin)
add_executable(wc3model wc3model.cpp)
target_link_libraries(wc3model ${wc3lib_CORE_LIBRARIES} wc3libmodeleditor)
install(TARGETS wc3model DESTINATION bin)
endif ()
add_executable(wc3trigger wc3trigger.cpp)
target_link_libraries(wc3trigger ${wc3lib_CORE_LIBRARIES} wc3libtriggereditor)
install(TARGETS wc3trigger DESTINATION bin)
add_executable(wc3ability wc3ability.cpp)
target_link_libraries(wc3ability ${wc3lib_CORE_LIBRARIES} wc3libobjecteditor)
install(TARGETS wc3ability DESTINATION bin)
add_executable(wc3unit wc3unit.cpp)
target_link_libraries(wc3unit ${wc3lib_CORE_LIBRARIES} wc3libobjecteditor)
install(TARGETS wc3unit DESTINATION bin)
if (DEBUG)
configure_file(ogre.cfg ogre.cfg COPYONLY)
configure_file(plugins.cfg plugins.cfg COPYONLY)
endif ()
# Install all depending libraries which are not statically linked.
# TODO For Qt5 on Windows this is a workaround since the deployment program is not available on Fedora.
if (WIN32)
find_package(JPEG REQUIRED)
message(STATUS "Windows install libraries:")
message(STATUS "JPEG libraries: ${JPEG_LIBRARIES}")
install(FILES ${JPEG_LIBRARIES} DESTINATION bin)
message(STATUS "Boost libraries: ${Boost_LIBRARIES}")
install(FILES ${Boost_LIBRARIES} DESTINATION bin)
message(STATUS "Gettext libraries: ${GETTEXT_LIBRARIES}")
install(FILES ${Boost_LIBRARIES} DESTINATION bin)
get_property(Qt5_Core_LIBRARY TARGET Qt5::Core PROPERTY LOCATION)
message(STATUS "Qt5 core libraries: ${Qt5_Core_LIBRARY}")
install(FILES ${Qt5_Core_LIBRARY} DESTINATION bin)
get_property(Qt5_Widgets_LIBRARY TARGET Qt5::Widgets PROPERTY LOCATION)
message(STATUS "Qt5 widgets libraries: ${Qt5_Widgets_LIBRARY}")
install(FILES ${Qt5_Widgets_LIBRARY} DESTINATION bin)
get_property(Qt5_Multimedia_LIBRARY TARGET Qt5::Multimedia PROPERTY LOCATION)
message(STATUS "Qt5 multimedia libraries: ${Qt5_Multimedia_LIBRARY}")
install(FILES ${Qt5_Multimedia_LIBRARY} DESTINATION bin)
#${GETTEXT_LIBRARIES} ${Boost_LIBRARIES} Qt5::Core Qt5::Widgets Qt5::Multimedia
find_package(ZLIB REQUIRED)
message(STATUS "ZLIB libraries ${ZLIB_LIBRARIES}")
install(FILES ${ZLIB_LIBRARIES} DESTINATION bin)
endif ()
if (DEBUG)
add_subdirectory(test)
endif ()
endif ()