summaryrefslogtreecommitdiff
blob: def5c80340bad3f97db5f2c55843acb6d8b8787b (plain)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
* Unbundle remaining libraries: GLEW, zlib, png, jpeg
* Add -DAS_DEPRECATED for Angelscript
* Remove definition of debug macros
* Build bundled Irrlicht with user flags

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -110,43 +110,11 @@
 include_directories(${ENET_INCLUDE_DIR})
 
 # Build glew library
 if(NOT USE_GLES2 AND NOT SERVER_ONLY)
+    find_package(GLEW REQUIRED)
+    include_directories(${GLEW_INCLUDE_DIRS})
     add_definitions(-DGLEW_NO_GLU)
-    add_subdirectory("${PROJECT_SOURCE_DIR}/lib/glew")
-    include_directories("${PROJECT_SOURCE_DIR}/lib/glew/include")
 endif()

-if(MSVC OR APPLE)
-    if (NOT APPLE)
-    # Build zlib library
-    add_subdirectory("${PROJECT_SOURCE_DIR}/lib/zlib")
-    include_directories("${PROJECT_SOURCE_DIR}/lib/zlib")
-
-    set(ZLIB_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/zlib" "${PROJECT_BINARY_DIR}/lib/zlib/")
-    set(ZLIB_LIBRARY zlibstatic)
-    endif()
-
-    # Build png library
-    set(SKIP_INSTALL_ALL TRUE)
-    set(PNG_STATIC TRUE CACHE BOOL "Build static lib")
-    set(PNG_TESTS FALSE CACHE BOOL "Build libpng tests")
-    set(PNG_SHARED FALSE CACHE BOOL "Build shared lib")
-    add_subdirectory("${PROJECT_SOURCE_DIR}/lib/libpng")
-    include_directories("${PROJECT_SOURCE_DIR}/lib/libpng")
-
-    set(PNG_PNG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/libpng/")
-    set(PNG_LIBRARY png_static)
-endif()
-
-# Add jpeg library
-if (APPLE)
-    add_subdirectory("${PROJECT_SOURCE_DIR}/lib/jpeglib")
-    include_directories("${PROJECT_SOURCE_DIR}/lib/jpeglib")
-    set(JPEG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/jpeglib/")
-    set(JPEG_LIBRARY jpeglib)
-else()
-    find_package(JPEG REQUIRED)
-    include_directories(${JPEG_INCLUDE_DIR})
-endif()
 
 if (BUILD_RECORDER)
@@ -206,6 +174,7 @@
     find_package(Angelscript)
     if(ANGELSCRIPT_FOUND)
         include_directories(${Angelscript_INCLUDE_DIRS})
+        add_definitions(-DAS_DEPRECATED)
     else()
         message(FATAL_ERROR "Angelscript not found. "
             "Either install angelscript or use built-in version using "
@@ -307,14 +276,6 @@
     # VS will automatically add NDEBUG for release mode, but only _DEBUG in debug mode.
     # Since STK uses DEBUG, this is added for debug compilation only:
     set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG)
-else()
-    # All non VS generators used create only a single compile mode, so
-    # compile flags can be simplye be added
-    if(CMAKE_BUILD_TYPE MATCHES Debug)
-        add_definitions(-DDEBUG)
-    else()
-        add_definitions(-DNDEBUG)
-    endif()
 endif()
 
 # TODO: remove this switch
@@ -426,7 +395,7 @@
 if(NOT SERVER_ONLY)
     if(NOT USE_GLES2)
-        target_link_libraries(supertuxkart ${OPENGL_gl_LIBRARY} glew graphics_utils)
+        target_link_libraries(supertuxkart ${OPENGL_gl_LIBRARY} ${GLEW_LIBRARIES} graphics_utils)
     else()
         target_link_libraries(supertuxkart GLESv2)
     endif()
 endif()
--- a/lib/irrlicht/CMakeLists.txt
+++ b/lib/irrlicht/CMakeLists.txt
@@ -68,15 +68,6 @@
 if(WIN32)
     add_definitions(-D_IRR_STATIC_LIB_)
     add_definitions(-D_CRT_SECURE_NO_WARNINGS) # Shut up about unsafe stuff
-else()
-    set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -Wall -pipe -O3  -fno-exceptions  -fstrict-aliasing")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pipe -O3  -fno-exceptions  -fstrict-aliasing")
-    if(CMAKE_COMPILER_IS_GNUCC)
-        set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fexpensive-optimizations")
-    endif()
-    if(CMAKE_COMPILER_IS_GNUCXX)
-        set(CMAKE_CXX_FLAGS   "${CMAKE_CXX_FLAGS} -fexpensive-optimizations")
-    endif()
 endif()
 
 if(USE_GLES2)