mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
add GLEW to cmake
This commit is contained in:
parent
49ebab1e1b
commit
4d8cf36e29
|
@ -73,6 +73,7 @@ find_package(Opus)
|
||||||
find_package(Opusfile)
|
find_package(Opusfile)
|
||||||
find_package(PythonInterp)
|
find_package(PythonInterp)
|
||||||
find_package(SDL2)
|
find_package(SDL2)
|
||||||
|
find_package(GLEW)
|
||||||
find_package(Threads)
|
find_package(Threads)
|
||||||
if(NOT PREFER_BUNDLED_LIBS)
|
if(NOT PREFER_BUNDLED_LIBS)
|
||||||
find_package(ZLIB)
|
find_package(ZLIB)
|
||||||
|
@ -110,6 +111,7 @@ show_dependency_status("Opus" ${OPUS_FOUND} "${OPUS_INCLUDEDIR}")
|
||||||
show_dependency_status("Opusfile" ${OPUSFILE_FOUND} "${OPUSFILE_LIBRARY}")
|
show_dependency_status("Opusfile" ${OPUSFILE_FOUND} "${OPUSFILE_LIBRARY}")
|
||||||
show_dependency_status("PythonInterp" ${PYTHONINTERP_FOUND} "")
|
show_dependency_status("PythonInterp" ${PYTHONINTERP_FOUND} "")
|
||||||
show_dependency_status("SDL2" ${SDL2_FOUND} "${SDL2_LIBRARY}")
|
show_dependency_status("SDL2" ${SDL2_FOUND} "${SDL2_LIBRARY}")
|
||||||
|
show_dependency_status("GLEW" ${GLEW_FOUND} "${GLEW_LIBRARY}")
|
||||||
if(ZLIB_FOUND)
|
if(ZLIB_FOUND)
|
||||||
message(STATUS " * Zlib found")
|
message(STATUS " * Zlib found")
|
||||||
else()
|
else()
|
||||||
|
@ -142,6 +144,9 @@ endif()
|
||||||
if(CLIENT AND NOT(SDL2_FOUND))
|
if(CLIENT AND NOT(SDL2_FOUND))
|
||||||
message(SEND_ERROR "You must install SDL2 to compile the DDNet client")
|
message(SEND_ERROR "You must install SDL2 to compile the DDNet client")
|
||||||
endif()
|
endif()
|
||||||
|
if(CLIENT AND NOT(GLEW_FOUND))
|
||||||
|
message(SEND_ERROR "You must install GLEW to compile the DDNet client")
|
||||||
|
endif()
|
||||||
if(NOT(GTEST_FOUND))
|
if(NOT(GTEST_FOUND))
|
||||||
message("To run the tests, you have to install GTest")
|
message("To run the tests, you have to install GTest")
|
||||||
endif()
|
endif()
|
||||||
|
@ -304,10 +309,12 @@ endif()
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
file(COPY data DESTINATION .)
|
file(COPY data DESTINATION .)
|
||||||
|
file(COPY shader DESTINATION .)
|
||||||
file(COPY ${CURL_COPY_FILES} DESTINATION .)
|
file(COPY ${CURL_COPY_FILES} DESTINATION .)
|
||||||
file(COPY ${FREETYPE_COPY_FILES} DESTINATION .)
|
file(COPY ${FREETYPE_COPY_FILES} DESTINATION .)
|
||||||
file(COPY ${OPUSFILE_COPY_FILES} DESTINATION .)
|
file(COPY ${OPUSFILE_COPY_FILES} DESTINATION .)
|
||||||
file(COPY ${SDL2_COPY_FILES} DESTINATION .)
|
file(COPY ${SDL2_COPY_FILES} DESTINATION .)
|
||||||
|
file(COPY ${GLEW_COPY_FILES} DESTINATION .)
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# CODE GENERATION
|
# CODE GENERATION
|
||||||
|
@ -533,6 +540,10 @@ if(CLIENT)
|
||||||
text.cpp
|
text.cpp
|
||||||
updater.cpp
|
updater.cpp
|
||||||
updater.h
|
updater.h
|
||||||
|
opengl_sl_program.cpp
|
||||||
|
opengl_sl_program.h
|
||||||
|
opengl_sl.cpp
|
||||||
|
opengl_sl.h
|
||||||
)
|
)
|
||||||
set_glob(GAME_CLIENT GLOB_RECURSE src/game/client
|
set_glob(GAME_CLIENT GLOB_RECURSE src/game/client
|
||||||
animstate.cpp
|
animstate.cpp
|
||||||
|
@ -644,6 +655,7 @@ if(CLIENT)
|
||||||
${CURL_LIBRARIES}
|
${CURL_LIBRARIES}
|
||||||
${FREETYPE_LIBRARIES}
|
${FREETYPE_LIBRARIES}
|
||||||
${SDL2_LIBRARIES}
|
${SDL2_LIBRARIES}
|
||||||
|
${GLEW_LIBRARIES}
|
||||||
|
|
||||||
# Order of these three is important.
|
# Order of these three is important.
|
||||||
${OPUSFILE_LIBRARIES}
|
${OPUSFILE_LIBRARIES}
|
||||||
|
@ -681,6 +693,7 @@ if(CLIENT)
|
||||||
${OPUSFILE_INCLUDE_DIRS}
|
${OPUSFILE_INCLUDE_DIRS}
|
||||||
${OPUS_INCLUDE_DIRS}
|
${OPUS_INCLUDE_DIRS}
|
||||||
${SDL2_INCLUDE_DIRS}
|
${SDL2_INCLUDE_DIRS}
|
||||||
|
${GLEW_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
list(APPEND TARGETS_OWN ${TARGET_CLIENT})
|
list(APPEND TARGETS_OWN ${TARGET_CLIENT})
|
||||||
list(APPEND TARGETS_LINK ${TARGET_CLIENT})
|
list(APPEND TARGETS_LINK ${TARGET_CLIENT})
|
||||||
|
|
28
cmake/FindGLEW.cmake
Normal file
28
cmake/FindGLEW.cmake
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_check_modules(PC_GLEW libglew)
|
||||||
|
set_extra_dirs(GLEW glew)
|
||||||
|
|
||||||
|
find_path(GLEW_INCLUDEDIR GL
|
||||||
|
HINTS ${HINTS_GLEW_INCLUDEDIR} ${PC_GLEW_INCLUDEDIR} ${PC_GLEW_INCLUDE_DIRS}
|
||||||
|
PATHS ${PATHS_GLEW_INCLUDEDIR}
|
||||||
|
)
|
||||||
|
find_library(GLEW_LIBRARY
|
||||||
|
NAMES GLEW glew32
|
||||||
|
HINTS ${HINTS_GLEW_LIBDIR} ${PC_GLEW_LIBDIR} ${PC_GLEW_LIBRARY_DIRS}
|
||||||
|
PATHS ${PATHS_GLEW_LIBDIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_LIBRARY GLEW_INCLUDEDIR)
|
||||||
|
|
||||||
|
mark_as_advanced(GLEW_LIBRARY GLEW_INCLUDEDIR)
|
||||||
|
|
||||||
|
set(GLEW_LIBRARIES ${GLEW_LIBRARY})
|
||||||
|
set(GLEW_INCLUDE_DIRS ${GLEW_INCLUDEDIR})
|
||||||
|
|
||||||
|
string(FIND "${GLEW_LIBRARY}" "${PROJECT_SOURCE_DIR}" LOCAL_PATH_POS)
|
||||||
|
if(LOCAL_PATH_POS EQUAL 0 AND TARGET_OS STREQUAL "windows")
|
||||||
|
set(GLEW_COPY_FILES "${EXTRA_GLEW_LIBDIR}/glew32.dll")
|
||||||
|
else()
|
||||||
|
set(GLEW_COPY_FILES)
|
||||||
|
endif()
|
Loading…
Reference in a new issue