Skip to content

Commit

Permalink
Fix pkg-config in CMakeLists.txt (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Oct 24, 2015
1 parent 7bf0b03 commit e8ed202
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
18 changes: 12 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,18 @@ endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/build/cmake")

find_package(PkgConfig)
pkg_search_module(SDL2 sdl2)
pkg_search_module(SDL2_mixer sdl2)
pkg_search_module(SDL2_image sdl2)
find_package(SDL2 REQUIRED)
find_package(SDL2_mixer REQUIRED)
find_package(SDL2_image REQUIRED)
pkg_search_module(SDL2 REQUIRED sdl2)
pkg_search_module(SDL2_IMAGE REQUIRED SDL2_image)
pkg_search_module(SDL2_MIXER REQUIRED SDL2_mixer)
if(NOT ${SDL2_FOUND})
find_package(SDL2 REQUIRED)
endif()
if(NOT ${SDL2_IMAGE_FOUND})
find_package(SDL2_image REQUIRED)
endif()
if(NOT ${SDL2_MIXER_FOUND})
find_package(SDL2_mixer REQUIRED)
endif()

SET(ENet_LIBRARY enet)
IF(WIN32)
Expand Down
4 changes: 2 additions & 2 deletions src/cdogs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ endif()
target_link_libraries(cdogs
json
${SDL2_LIBRARY}
${SDL2_IMAGE_LIBRARY}
${SDL2_MIXER_LIBRARY}
${SDL2_IMAGE_LIBRARIES}
${SDL2_MIXER_LIBRARIES}
${SDLMAIN_LIBRARY}
${ENet_LIBRARIES})

0 comments on commit e8ed202

Please sign in to comment.