Commit 12789100 authored by Jerry's avatar Jerry
Browse files

made cmakescript working on Windows

parent e719db25
......@@ -8,13 +8,26 @@ project(gdw_ss15_cpp)
find_package(OpenGL)
include(FindPkgConfig)
PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2)
PKG_SEARCH_MODULE(SDL2MIXER REQUIRED SDL2_mixer)
include_directories(
if(UNIX)
include(FindPkgConfig)
PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2)
PKG_SEARCH_MODULE(SDL2MIXER REQUIRED SDL2_mixer)
include_directories(
${SDL2_INCLUDE_DIRS}
${SDL2_mixer_INCLUDE_DIRS}
)
)
elseif(WIN32)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/lib/sdl2/include
${CMAKE_CURRENT_SOURCE_DIR}/lib/sdl2_mixer/x86_64-w64-mingw32/include/SDL2
)
link_directories(
${CMAKE_CURRENT_SOURCE_DIR}/lib/sdl2/x86_64-w64-mingw32/lib
${CMAKE_CURRENT_SOURCE_DIR}/lib/sdl2_mixer/x86_64-w64-mingw32/lib
)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/lib/sdl2/x86_64-w64-mingw32/bin/SDL2.dll DESTINATION .)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/lib/sdl2_mixer/x86_64-w64-mingw32/bin/ DESTINATION . FILES_MATCHING PATTERN *.dll)
endif()
#gli library
......@@ -151,13 +164,27 @@ set(LINKED_LIBRARIES
DetourCrowd
Detour
Recast
SDL2
SDL2main
SDL2
SDL2_mixer
)
if(UNIX)
set( LINKED_LIBRARIES
${LINKED_LIBRARIES}
GL
c++
c++abi
)
c++abi)
elseif(WIN32)
set( LINKED_LIBRARIES
imagehlp
mingw32
${LINKED_LIBRARIES}
opengl32
-static-libgcc
-static-libstdc++)
endif()
#build executable and then link to the libraries
add_executable(Game ${project_SRC} ${project_HDR} ${project_INL})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment