Skip to content
This repository
Browse code

New CMakeLists.txt Style

With this new CMakeLists.txt, you can compile the whole Open Hexagon
project in a few clicks!
  • Loading branch information...
commit 9abdef9400516db4cbe2acce0ec4b608cd5c442f 1 parent 7e90608
Mischa Aster Alff Mischa-Alff authored

Showing 2 changed files with 297 additions and 70 deletions. Show diff stats Hide diff stats

  1. +4 0 .gitignore
  2. +293 70 CMakeLists.txt
4 .gitignore
... ... @@ -1,4 +1,8 @@
1 1 /lib
  2 +CMakeFiles/
  3 +Makefile
  4 +CMakeCache.*
  5 +cmake_install.cmake
2 6
3 7 #################
4 8 ## Eclipse
363 CMakeLists.txt
@@ -5,12 +5,6 @@ set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type." FORCE)
5 5 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" CACHE STRING "" FORCE)
6 6
7 7 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/;${CMAKE_MODULE_PATH}")
8   -set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}/extlibs/SSVUtils/cmake/Modules/")
9   -set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}/extlibs/SSVUtilsJson/cmake/Modules/")
10   -set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}/extlibs/SSVMenuSystem/cmake/Modules/")
11   -set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}/extlibs/SSVLuaWrapper/cmake/Modules/")
12   -set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}/extlibs/SSVEntitySystem/cmake/Modules/")
13   -set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}/extlibs/SSVStart/cmake/Modules/")
14 8
15 9 if(SFML_STATIC_LIBS)
16 10 set(SFML_STATIC_LIBS TRUE)
@@ -20,7 +14,12 @@ find_package(SFML 2 COMPONENTS audio graphics window system network)
20 14 if(SFML_FOUND)
21 15 include_directories(${SFML_INCLUDE_DIR})
22 16 else()
23   - set(SFML_ROOT "" CACHE PATH "SFML top-level directory")
  17 + set(SFML_ROOT "" CACHE PATH "SFML top-level directory" )
  18 + set(SFML_INCLUDE_DIR "" CACHE STRING "SFML2 include directory" )
  19 + set(SFML_WINDOW_LIBRARY "" CACHE STRING "SFML2 Window library file" )
  20 + set(SFML_GRAPHICS_LIBRARY "" CACHE STRING "SFML2 Graphics library file" )
  21 + set(SFML_NETWORK_LIBRARY "" CACHE STRING "SFML2 Network library file" )
  22 + set(SFML_AUDIO_LIBRARY "" CACHE STRING "SFML2 Audio library file" )
24 23 message("\n-> SFML directory not found. Set SFML_ROOT to SFML's top-level path (containing both \"include\" and \"lib\" directories).")
25 24 endif()
26 25
@@ -40,84 +39,302 @@ else()
40 39 message("\n-> LUA directory not found. Set LUA_ROOT to LUA's top-level path (containing both \"include\" and \"lib\" directories).")
41 40 endif()
42 41
43   -find_package(SSVUtils)
44   -if(SSVUTILS_FOUND)
45   - include_directories(${SSVUTILS_INCLUDE_DIR})
  42 +##############################################################
  43 +######### BUILD DEPENDENCIES ##############
  44 +##############################################################
  45 +
  46 +# DEPENDENCY : SSVUTILS
  47 +# --> DEPENDS: STL
  48 +
  49 +if(SSVUTILS_BUILD_SHARED_LIB)
  50 + set(SSVUTILS_LIB_TYPE SHARED)
  51 +else()
  52 + set(SSVUTILS_LIB_TYPE STATIC)
  53 +endif()
  54 +
  55 +set(SSVUTILS_SRC_DIR "extlibs/SSVUtils/src")
  56 +set(SSVUTILS_INC_DIR "extlibs/SSVUtils/include")
  57 +
  58 +set(
  59 + SSVUTILS_SOURCES
  60 + ${SSVUTILS_INC_DIR}/SSVUtils/Delegate/Delegate.h
  61 + ${SSVUTILS_INC_DIR}/SSVUtils/Encryption/Base64.h
  62 + ${SSVUTILS_INC_DIR}/SSVUtils/Encryption/MD5.h
  63 + ${SSVUTILS_INC_DIR}/SSVUtils/Encryption/ObfuscatedValue.h
  64 + ${SSVUTILS_INC_DIR}/SSVUtils/FileSystem/FileSystem.h
  65 + ${SSVUTILS_INC_DIR}/SSVUtils/Log/Log.h
  66 + ${SSVUTILS_INC_DIR}/SSVUtils/MemoryManager/MemoryManager.h
  67 + ${SSVUTILS_INC_DIR}/SSVUtils/MemoryManager/Traits/Traits.h
  68 + ${SSVUTILS_INC_DIR}/SSVUtils/Timeline/Command.h
  69 + ${SSVUTILS_INC_DIR}/SSVUtils/Timeline/Do.h
  70 + ${SSVUTILS_INC_DIR}/SSVUtils/Timeline/Go.h
  71 + ${SSVUTILS_INC_DIR}/SSVUtils/Timeline/Timeline.h
  72 + ${SSVUTILS_INC_DIR}/SSVUtils/Timeline/TimelineManager.h
  73 + ${SSVUTILS_INC_DIR}/SSVUtils/Timeline/Wait.h
  74 + ${SSVUTILS_INC_DIR}/SSVUtils/Utils/Utils.h
  75 + ${SSVUTILS_INC_DIR}/SSVUtils/Utils/UtilsContainers.h
  76 + ${SSVUTILS_INC_DIR}/SSVUtils/Utils/UtilsMath.h
  77 + ${SSVUTILS_INC_DIR}/SSVUtils/Utils/UtilsString.h
  78 + ${SSVUTILS_SRC_DIR}/SSVUtils/Encryption/Base64.cpp
  79 + ${SSVUTILS_SRC_DIR}/SSVUtils/Encryption/MD5.cpp
  80 + ${SSVUTILS_SRC_DIR}/SSVUtils/FileSystem/FileSystem.cpp
  81 + ${SSVUTILS_SRC_DIR}/SSVUtils/Log/Log.cpp
  82 + ${SSVUTILS_SRC_DIR}/SSVUtils/Timeline/Command.cpp
  83 + ${SSVUTILS_SRC_DIR}/SSVUtils/Timeline/Do.cpp
  84 + ${SSVUTILS_SRC_DIR}/SSVUtils/Timeline/Go.cpp
  85 + ${SSVUTILS_SRC_DIR}/SSVUtils/Timeline/Timeline.cpp
  86 + ${SSVUTILS_SRC_DIR}/SSVUtils/Timeline/TimelineManager.cpp
  87 + ${SSVUTILS_SRC_DIR}/SSVUtils/Timeline/Wait.cpp
  88 + ${SSVUTILS_SRC_DIR}/SSVUtils/Utils/Utils.cpp
  89 + ${SSVUTILS_SRC_DIR}/SSVUtils/Utils/UtilsContainers.cpp
  90 + ${SSVUTILS_SRC_DIR}/SSVUtils/Utils/UtilsMath.cpp
  91 + ${SSVUTILS_SRC_DIR}/SSVUtils/Utils/UtilsString.cpp
  92 +)
  93 +
  94 +include_directories(${SSVUTILS_INC_DIR})
  95 +add_library(SSVUtils ${SSVUTILS_LIB_TYPE} ${SSVUTILS_SOURCES})
  96 +
  97 +if(SSVUTILS_BUILD_SHARED_LIB)
  98 + set_target_properties(SSVUtils PROPERTIES DEBUG_POSTFIX -d)
46 99 else()
47   - set(SSVUTILS_ROOT "" CACHE PATH "SSVUtils top-level directory")
48   - message("\n-> SSVUtils directory not found. Set SSVUTILS_ROOT to SSVUtils' top-level path (containing both \"include\" and \"lib\" directories).")
  100 + set_target_properties(SSVUtils PROPERTIES DEBUG_POSTFIX -s-d)
  101 + set_target_properties(SSVUtils PROPERTIES RELEASE_POSTFIX -s)
49 102 endif()
50 103
51   -find_package(SSVMenuSystem)
52   -if(SSVMENUSYSTEM_FOUND)
53   - include_directories(${SSVMENUSYSTEM_INCLUDE_DIR})
  104 +if(SSVUTILS_BUILD_SHARED_LIB)
  105 + set(SSVUTILS_LIBRARIES ${CMAKE_CURRENT_SOURCE_DIR}/libSSVUtils.a)
  106 +else()
  107 + set(SSVUTILS_LIBRARIES ${CMAKE_CURRENT_SOURCE_DIR}/libSSVUtils-s.a)
  108 +endif()
  109 +
  110 +message(${SSVUTILS_LIBRARIES})
  111 +
  112 +#DEPENDENCY : SSVUtilsJson
  113 +#--> DEPENDS: SSVUtils jsoncpp
  114 +
  115 +if(SSVUTILSJSON_BUILD_SHARED_LIB)
  116 + set(SSVUTILSJSON_LIB_TYPE SHARED)
  117 +else()
  118 + set(SSVUTILSJSON_LIB_TYPE STATIC)
  119 +endif()
  120 +
  121 +set(SSVUTILSJSON_SRC_DIR "extlibs/SSVUtilsJson/src")
  122 +set(SSVUTILSJSON_INC_DIR "extlibs/SSVUtilsJson/include")
  123 +
  124 +set(
  125 + SSVUTILSJSON_SOURCES
  126 + ${SSVUTILSJSON_INC_DIR}/SSVUtilsJson/Utils/UtilsJson.h
  127 + ${SSVUTILSJSON_SRC_DIR}/SSVUtilsJson/Utils/UtilsJson.cpp
  128 +)
  129 +
  130 +include_directories(${SSVUTILSJSON_INC_DIR})
  131 +add_library(SSVUtilsJson ${SSVUTILSJSON_LIB_TYPE} ${SSVUTILSJSON_SOURCES})
  132 +
  133 +target_link_libraries( SSVUtilsJson SSVUtils)
  134 +target_link_libraries( SSVUtilsJson ${JSONCPP_LIBRARIES} )
  135 +
  136 +if(SSVUTILSJSON_BUILD_SHARED_LIB)
  137 + set_target_properties(SSVUtilsJson PROPERTIES DEBUG_POSTFIX -d)
54 138 else()
55   - set(SSVUTILS_ROOT "" CACHE PATH "SSVUtils top-level directory")
56   - message("\n-> SSVMenuSystem directory not found. Set SSVMENUSYSTEM_ROOT to SSVMenuSystem's top-level path (containing both \"include\" and \"lib\" directories).")
  139 + set_target_properties(SSVUtilsJson PROPERTIES DEBUG_POSTFIX -s-d)
  140 + set_target_properties(SSVUtilsJson PROPERTIES RELEASE_POSTFIX -s)
57 141 endif()
58 142
59   -find_package(SSVEntitySystem)
60   -if(SSVENTITYSYSTEM_FOUND)
61   - include_directories(${SSVENTITYSYSTEM_INCLUDE_DIR})
  143 +if(SSVUTILSJSON_BUILD_SHARED_LIB)
  144 + set(SSVUTILSJSON_LIBRARIES ${CMAKE_BINARY_DIR}/libSSVUtilsJson.a)
62 145 else()
63   - set(SSVENTITYSYSTEM_ROOT "" CACHE PATH "SSVEntitySystem top-level directory")
64   - message("\n-> SSVMenuSystem directory not found. Set SSVENEITYSYSTEM_ROOT to SSVEntitySystem's top-level path (containing both \"include\" and \"lib\" directories).")
  146 + set(SSVUTILSJSON_LIBRARIES ${CMAKE_BINARY_DIR}/libSSVUtilsJson-s.a)
65 147 endif()
66 148
67   -find_package(SSVStart)
68   -if(SSVSTART_FOUND)
69   - include_directories(${SSVSTART_INCLUDE_DIR})
  149 +#DEPENDENCY : SSVStart
  150 +#--> DEPENDS: SSVUtils SSVUtilsJson SFML
  151 +
  152 +if(SSVSTART_BUILD_SHARED_LIB)
  153 + set(SSVSTART_LIB_TYPE SHARED)
70 154 else()
71   - set(SSVSTART_ROOT "" CACHE PATH "SSVStart top-level directory")
72   - message("\n-> SSVStart directory not found. Set SSVSTART_ROOT to SSVStart's top-level path (containing both \"include\" and \"lib\" directories).")
  155 + set(SSVSTART_LIB_TYPE STATIC)
73 156 endif()
74 157
75   -find_package(SSVLuaWrapper)
76   -if(SSVLUAWRAPPER_FOUND)
77   - include_directories(${SSVLUAWRAPPER_INCLUDE_DIR})
  158 +set(SSVSTART_SRC_DIR "extlibs/SSVStart/src")
  159 +set(SSVSTART_INC_DIR "extlibs/SSVStart/include")
  160 +
  161 +set(
  162 + SSVSTART_SOURCES
  163 + ${SSVSTART_INC_DIR}/SSVStart/Assets/AssetFolder.h
  164 + ${SSVSTART_INC_DIR}/SSVStart/Assets/AssetManager.h
  165 + ${SSVSTART_INC_DIR}/SSVStart/Camera/Camera.h
  166 + ${SSVSTART_INC_DIR}/SSVStart/GameSystem/GameState.h
  167 + ${SSVSTART_INC_DIR}/SSVStart/GameSystem/GameWindow.h
  168 + ${SSVSTART_INC_DIR}/SSVStart/GameSystem/Timers.h
  169 + ${SSVSTART_INC_DIR}/SSVStart/Input/Combo.h
  170 + ${SSVSTART_INC_DIR}/SSVStart/Input/Manager.h
  171 + ${SSVSTART_INC_DIR}/SSVStart/Input/Trigger.h
  172 + ${SSVSTART_INC_DIR}/SSVStart/Tileset/Tileset.h
  173 + ${SSVSTART_INC_DIR}/SSVStart/Utils/ThreadWrapper.h
  174 + ${SSVSTART_INC_DIR}/SSVStart/Utils/Utils.h
  175 + ${SSVSTART_SRC_DIR}/SSVStart/Assets/AssetFolder.cpp
  176 + ${SSVSTART_SRC_DIR}/SSVStart/Assets/AssetManager.cpp
  177 + ${SSVSTART_SRC_DIR}/SSVStart/Camera/Camera.cpp
  178 + ${SSVSTART_SRC_DIR}/SSVStart/GameSystem/GameState.cpp
  179 + ${SSVSTART_SRC_DIR}/SSVStart/GameSystem/GameWindow.cpp
  180 + ${SSVSTART_SRC_DIR}/SSVStart/GameSystem/GWProperties.cpp
  181 + ${SSVSTART_SRC_DIR}/SSVStart/Input/Combo.cpp
  182 + ${SSVSTART_SRC_DIR}/SSVStart/Input/Manager.cpp
  183 + ${SSVSTART_SRC_DIR}/SSVStart/Input/Trigger.cpp
  184 + ${SSVSTART_SRC_DIR}/SSVStart/Tileset/Tileset.cpp
  185 + ${SSVSTART_SRC_DIR}/SSVStart/Utils/Utils.cpp
  186 +)
  187 +
  188 +include_directories(${SSVSTART_INC_DIR})
  189 +add_library(SSVStart ${SSVSTART_LIB_TYPE} ${SSVSTART_SOURCES})
  190 +
  191 +target_link_libraries( SSVStart SSVUtils )
  192 +target_link_libraries( SSVStart ${SFML_LIBRARIES} )
  193 +
  194 +if(SSVSTART_BUILD_SHARED_LIB)
  195 + set_target_properties(SSVStart PROPERTIES DEBUG_POSTFIX -d)
78 196 else()
79   - set(SSVLUAWRAPPER_ROOT "" CACHE PATH "SSVLuaWrapper top-level directory")
80   - message("\n-> SSVLuaWrapper directory not found. Set SSVLUAWRAPPER_ROOT to SSVLuaWrapper's top-level path (containing both \"include\" and \"lib\" directories).")
  197 + set_target_properties(SSVStart PROPERTIES DEBUG_POSTFIX -s-d)
  198 + set_target_properties(SSVStart PROPERTIES RELEASE_POSTFIX -s)
81 199 endif()
82 200
83   -find_package(SSVUtilsJson)
84   -if(SSVUTILSJSON_FOUND)
85   - include_directories(${SSVUTILSJSON_INCLUDE_DIR})
  201 +if(SSVSTART_BUILD_SHARED_LIB)
  202 + set(SSVSTART_LIBRARIES ${CMAKE_BINARY_DIR}/libSSVStart.a)
86 203 else()
87   - set(SSVUTILSJSON_ROOT "" CACHE PATH "SSVUtilsJson top-level directory")
88   - message("\n-> SSVUtilsJson directory not found. Set SSVUTILSJSON_ROOT to SSVUtilsJson's top-level path (containing both \"include\" and \"lib\" directories).")
  204 + set(SSVSTART_LIBRARIES ${CMAKE_BINARY_DIR}/libSSVStart-s.a)
89 205 endif()
90 206
91   -set(SSVUTILS_STATIC_LIBS "" CACHE BOOL "Check to link SSVUtils statically.")
92   -set(SSVUTILS_INCLUDE_DIR "" CACHE STRING "SSVUtils include directory")
93   -set(SSVUTILS_LIBRARY "" CACHE STRING "SSVUtils library file")
  207 +#DEPENDENCY : SSVLuaWrapper
  208 +#--> DEPENDS: LUA51
94 209
95   -set(SSVUTILSJSON_STATIC_LIBS "" CACHE BOOL "Check to link SSVUtilsJson statically.")
96   -set(SSVUTILSJSON_INCLUDE_DIR "" CACHE STRING "SSVUtilsJson include directory")
97   -set(SSVUTILSJSON_LIBRARY "" CACHE STRING "SSVUtilsJson library file")
  210 +if(SSVLUAWRAPPER_BUILD_SHARED_LIB)
  211 + set(SSVLUAWRAPPER_LIB_TYPE SHARED)
  212 +else()
  213 + set(SSVLUAWRAPPER_LIB_TYPE STATIC)
  214 +endif()
98 215
99   -set(SSVSTART_STATIC_LIBS "" CACHE BOOL "Check to link SSVStart statically.")
100   -set(SSVSTART_INCLUDE_DIR "" CACHE STRING "SSVStart include directory")
101   -set(SSVSTART_LIBRARY "" CACHE STRING "SSVStart library file")
  216 +set(SSVLUAWRAPPER_SRC_DIR "extlibs/SSVLuaWrapper/src")
  217 +set(SSVLUAWRAPPER_INC_DIR "extlibs/SSVLuaWrapper/include")
102 218
103   -set(SSVLUAWRAPPER_STATIC_LIBS "" CACHE BOOL "Check to link SSVLuaWrapper statically.")
104   -set(SSVLUAWRAPPER_INCLUDE_DIR "" CACHE STRING "SSVLuaWrapper include directory")
105   -set(SSVLUAWRAPPER_LIBRARY "" CACHE STRING "SSVLuaWrapper library file")
  219 +set(
  220 + SSVLUAWRAPPER_SOURCES
  221 + ${SSVLUAWRAPPER_INC_DIR}/SSVLuaWrapper/LuaContext/LuaContext.h
  222 + ${SSVLUAWRAPPER_SRC_DIR}/SSVLuaWrapper/LuaContext/LuaContext.cpp
  223 +)
106 224
107   -set(SSVENTITYSYSTEM_STATIC_LIBS "" CACHE BOOL "Check to link SSVEntitySystem statically.")
108   -set(SSVENTITYSYSTEM_INCLUDE_DIR "" CACHE STRING "SSVEntitySystem include directory")
109   -set(SSVENTITYSYSTEM_LIBRARY "" CACHE STRING "SSVEntitySystem library file")
  225 +include_directories(${SSVLUAWRAPPER_INC_DIR})
  226 +add_library(SSVLuaWrapper ${SSVLUAWRAPPER_LIB_TYPE} ${SSVLUAWRAPPER_SOURCES})
110 227
111   -set(SSVMENUSYSTEM_STATIC_LIBS "" CACHE BOOL "Check to link SSVMenuSystem statically.")
112   -set(SSVMENUSYSTEM_INCLUDE_DIR "" CACHE STRING "SSVMenuSystem include directory")
113   -set(SSVMENUSYSTEM_LIBRARY "" CACHE STRING "SSVMenuSystem library file")
  228 +target_link_libraries(SSVLuaWrapper ${LUA_LIBRARIES})
114 229
115   -set(SFML_INCLUDE_DIR "" CACHE STRING "SFML2 include directory")
116   -set(SFML_SYSTEM_LIBRARY "" CACHE STRING "SFML2 System library file")
117   -set(SFML_WINDOW_LIBRARY "" CACHE STRING "SFML2 Window library file")
118   -set(SFML_GRAPHICS_LIBRARY "" CACHE STRING "SFML2 Graphics library file")
119   -set(SFML_NETWORK_LIBRARY "" CACHE STRING "SFML2 Network library file")
120   -set(SFML_AUDIO_LIBRARY "" CACHE STRING "SFML2 Audio library file")
  230 +if(SSVLUAWRAPPER_BUILD_SHARED_LIB)
  231 + set_target_properties(SSVLuaWrapper PROPERTIES DEBUG_POSTFIX -d)
  232 +else()
  233 + set_target_properties(SSVLuaWrapper PROPERTIES DEBUG_POSTFIX -s-d)
  234 + set_target_properties(SSVLuaWrapper PROPERTIES RELEASE_POSTFIX -s)
  235 +endif()
  236 +
  237 +if(SSVSTART_BUILD_SHARED_LIB)
  238 + set(SSVSTART_LIBRARIES ${CMAKE_BINARY_DIR}/libSSVLuaWrapper.a)
  239 +else()
  240 + set(SSVSTART_LIBRARIES ${CMAKE_BINARY_DIR}/libSSVLuaWrapper-s.a)
  241 +endif()
  242 +
  243 +#DEPENDENCY : SSVEntitySystem
  244 +#--> DEPENDS: GoogleSparsehash SSVUtils
  245 +
  246 +if(SSVENTITYSYSTEM_BUILD_SHARED_LIB)
  247 + set(SSVENTITYSYSTEM_LIB_TYPE SHARED)
  248 +else()
  249 + set(SSVENTITYSYSTEM_LIB_TYPE STATIC)
  250 +endif()
  251 +
  252 +set(SSVENTITYSYSTEM_SRC_DIR "extlibs/SSVEntitySystem/src")
  253 +set(SSVENTITYSYSTEM_INC_DIR "extlibs/SSVEntitySystem/include")
  254 +
  255 +set(
  256 + SSVENTITYSYSTEM_SOURCES
  257 + ${SSVENTITYSYSTEM_INC_DIR}/SSVEntitySystem/Core/Component.h
  258 + ${SSVENTITYSYSTEM_INC_DIR}/SSVEntitySystem/Core/Entity.h
  259 + ${SSVENTITYSYSTEM_INC_DIR}/SSVEntitySystem/Core/Manager.h
  260 + ${SSVENTITYSYSTEM_INC_DIR}/SSVEntitySystem/Utils/Repository.h
  261 + ${SSVENTITYSYSTEM_INC_DIR}/SSVEntitySystem/Utils/Utils.h
  262 + ${SSVENTITYSYSTEM_SRC_DIR}/SSVEntitySystem/Core/Component.cpp
  263 + ${SSVENTITYSYSTEM_SRC_DIR}/SSVEntitySystem/Core/Entity.cpp
  264 + ${SSVENTITYSYSTEM_SRC_DIR}/SSVEntitySystem/Core/Manager.cpp
  265 + ${SSVENTITYSYSTEM_SRC_DIR}/SSVEntitySystem/Utils/Utils.cpp
  266 +)
  267 +
  268 +include_directories(${SSVENTITYSYSTEM_INC_DIR})
  269 +add_library(SSVEntitySystem ${SSVENTITYSYSTEM_LIB_TYPE} ${SSVENTITYSYSTEM_SOURCES})
  270 +
  271 +target_link_libraries(SSVEntitySystem ${SPARSEHASH_LIBRARIES})
  272 +target_link_libraries(SSVEntitySystem SSVUtils)
  273 +
  274 +if(SSVENTITYSYSTEM_BUILD_SHARED_LIB)
  275 + set_target_properties(SSVEntitySystem PROPERTIES DEBUG_POSTFIX -d)
  276 +else()
  277 + set_target_properties(SSVEntitySystem PROPERTIES DEBUG_POSTFIX -s-d)
  278 + set_target_properties(SSVEntitySystem PROPERTIES RELEASE_POSTFIX -s)
  279 +endif()
  280 +
  281 +if(SSVENTITYSYSTEM_BUILD_SHARED_LIB)
  282 + set(SSVENTITYSYSTEM_LIBRARIES ${CMAKE_BINARY_DIR}/libSSVEntitySystem.a)
  283 +else()
  284 + set(SSVENTITYSYSTEM_LIBRARIES ${CMAKE_BINARY_DIR}/libSSVEntitySystem-s.a)
  285 +endif()
  286 +
  287 +
  288 +#DEPENDENCY : SSVMenuSystem
  289 +#--> DEPENDS: GoogleSparsehash SSVUtils
  290 +
  291 +if(SSVMENUSYSTEM_BUILD_SHARED_LIB)
  292 + set(SSVMENUSYSTEM_LIB_TYPE SHARED)
  293 +else()
  294 + set(SSVMENUSYSTEM_LIB_TYPE STATIC)
  295 +endif()
  296 +
  297 +set(SSVMENUSYSTEM_SRC_DIR "extlibs/SSVMenuSystem/src")
  298 +set(SSVMENUSYSTEM_INC_DIR "extlibs/SSVMenuSystem/include")
  299 +
  300 +set(
  301 + SSVMENUSYSTEM_SOURCES
  302 + ${SSVMENUSYSTEM_INC_DIR}/SSVMenuSystem/Menu/Category.h
  303 + ${SSVMENUSYSTEM_INC_DIR}/SSVMenuSystem/Menu/ItemBase.h
  304 + ${SSVMENUSYSTEM_INC_DIR}/SSVMenuSystem/Menu/Menu.h
  305 + ${SSVMENUSYSTEM_INC_DIR}/SSVMenuSystem/Items/Goto.h
  306 + ${SSVMENUSYSTEM_INC_DIR}/SSVMenuSystem/Items/Single.h
  307 + ${SSVMENUSYSTEM_INC_DIR}/SSVMenuSystem/Items/Slider.h
  308 + ${SSVMENUSYSTEM_INC_DIR}/SSVMenuSystem/Items/Toggle.h
  309 + ${SSVMENUSYSTEM_SRC_DIR}/SSVMenuSystem/Menu/Category.cpp
  310 + ${SSVMENUSYSTEM_SRC_DIR}/SSVMenuSystem/Menu/ItemBase.cpp
  311 + ${SSVMENUSYSTEM_SRC_DIR}/SSVMenuSystem/Menu/Menu.cpp
  312 + ${SSVMENUSYSTEM_SRC_DIR}/SSVMenuSystem/Items/Goto.cpp
  313 + ${SSVMENUSYSTEM_SRC_DIR}/SSVMenuSystem/Items/Single.cpp
  314 + ${SSVMENUSYSTEM_SRC_DIR}/SSVMenuSystem/Items/Slider.cpp
  315 + ${SSVMENUSYSTEM_SRC_DIR}/SSVMenuSystem/Items/Toggle.cpp
  316 +)
  317 +
  318 +include_directories(${SSVMENUSYSTEM_INC_DIR})
  319 +add_library(SSVMenuSystem ${SSVMENUSYSTEM_LIB_TYPE} ${SSVMENUSYSTEM_SOURCES})
  320 +
  321 +if(SSVMENUSYSTEM_BUILD_SHARED_LIB)
  322 + set_target_properties(SSVMenuSystem PROPERTIES DEBUG_POSTFIX -d)
  323 +else()
  324 + set_target_properties(SSVMenuSystem PROPERTIES DEBUG_POSTFIX -s-d)
  325 + set_target_properties(SSVMenuSystem PROPERTIES RELEASE_POSTFIX -s)
  326 +endif()
  327 +
  328 +if(SSVMENUSYSTEM_BUILD_SHARED_LIB)
  329 + set(SSVMENUSYSTEM_LIBRARIES ${CMAKE_BINARY_DIR}/libSSVMenuSystem.a)
  330 +else()
  331 + set(SSVMENUSYSTEM_LIBRARIES ${CMAKE_BINARY_DIR}/libSSVMenuSystem-s.a)
  332 +endif()
  333 +
  334 +
  335 +##############################################################
  336 +######### BUILD OPENHEXAGON ##############
  337 +##############################################################
121 338
122 339 set(SRC_DIR "src")
123 340 set(INC_DIR "include")
@@ -134,7 +351,7 @@ set(
134 351 ${INC_DIR}/${PROJECT_NAME}/Data/LevelData.h
135 352 ${INC_DIR}/${PROJECT_NAME}/Data/MusicData.h
136 353 ${INC_DIR}/${PROJECT_NAME}/Data/PackData.h
137   - ${INC_DIR}/${PROJECT_NAME}/Data/PatternData.h
  354 + #${INC_DIR}/${PROJECT_NAME}/Data/PatternData.h
138 355 ${INC_DIR}/${PROJECT_NAME}/Data/ProfileData.h
139 356 ${INC_DIR}/${PROJECT_NAME}/Data/StyleData.h
140 357 ${INC_DIR}/${PROJECT_NAME}/Global/Assets.h
@@ -168,6 +385,7 @@ set(
168 385 ${SRC_DIR}/${PROJECT_NAME}/Utils/Utils.cpp
169 386 )
170 387
  388 +include_directories(${INC_DIR})
171 389 include_directories(${INC_DIR}/${PROJECT_NAME})
172 390 include_directories(${INC_DIR}/${PROJECT_NAME}/Core)
173 391 include_directories(${INC_DIR}/${PROJECT_NAME}/Data)
@@ -175,12 +393,12 @@ include_directories(${INC_DIR}/${PROJECT_NAME}/Utils)
175 393
176 394 add_executable(SSVOpenHexagon ${SOURCES})
177 395
178   -target_link_libraries(SSVOpenHexagon ${SSVUTILS_LIBRARIES})
179   -target_link_libraries(SSVOpenHexagon ${SSVUTILSJSON_LIBRARIES})
180   -target_link_libraries(SSVOpenHexagon ${SSVSTART_LIBRARIES})
181   -target_link_libraries(SSVOpenHexagon ${SSVLUAWRAPPER_LIBRARIES})
182   -target_link_libraries(SSVOpenHexagon ${SSVENTITYSYSTEM_LIBRARIES})
183   -target_link_libraries(SSVOpenHexagon ${SSVMENUSYSTEM_LIBRARIES})
  396 +target_link_libraries(SSVOpenHexagon SSVUtils)
  397 +target_link_libraries(SSVOpenHexagon SSVUtilsJson)
  398 +target_link_libraries(SSVOpenHexagon SSVStart)
  399 +target_link_libraries(SSVOpenHexagon SSVLuaWrapper)
  400 +target_link_libraries(SSVOpenHexagon SSVEntitySystem)
  401 +target_link_libraries(SSVOpenHexagon SSVMenuSystem)
184 402 target_link_libraries(SSVOpenHexagon ${JSONCPP_LIBRARIES})
185 403 target_link_libraries(SSVOpenHexagon ${SFML_LIBRARIES})
186 404 target_link_libraries(SSVOpenHexagon ${LUA_LIBRARIES})
@@ -188,7 +406,7 @@ target_link_libraries(SSVOpenHexagon ${SSVMENUSYSTEM_LIBRARIES})
188 406
189 407 if(UNIX)
190 408 install(TARGETS SSVOpenHexagon
191   - RUNTIME DESTINATION /usr/local/games/SSVOpenHexagon/
  409 + RUNTIME DESTINATION /usr/local/games/SSVOpenHexagon/
192 410 )
193 411
194 412 install(DIRECTORY _RELEASE/
@@ -201,5 +419,10 @@ if(UNIX)
201 419 )
202 420 else(WIN32)
203 421 install(TARGETS SSVOpenHexagon
204   - RUNTIME DESTINATION ./_RELEASE/)
  422 + RUNTIME DESTINATION .
  423 + )
  424 +
  425 + install(DIRECTORY _RELEASE/
  426 + DESTINATION "C:/Program Files (x86)/SSVOpenHexagon/"
  427 + )
205 428 endif()

0 comments on commit 9abdef9

Please sign in to comment.
Something went wrong with that request. Please try again.