From: Alexey Aleshkov Date: Sun, 10 Dec 2017 11:01:04 +0000 (+0300) Subject: Use `find_package` to find SDL dependency X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=623b5c605da7c3b7dc8750f845047473f166ab84;p=flatwaifu.git Use `find_package` to find SDL dependency --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index eb57650..c306571 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,26 +1,25 @@ cmake_minimum_required( VERSION 2.6 ) - + set( BIN doom2d ) project( ${BIN} ) - + set( SOURCE_ROOT ../src ) - + +find_package(SDL REQUIRED) +find_package(SDL_mixer REQUIRED) + aux_source_directory( ${SOURCE_ROOT} SOURCES ) - + include_directories( "${SOURCE_ROOT}" - "/usr/include" - "/usr/include/SDL" ) - + "${SDL_INCLUDE_DIR}" + "${SDLMIXER_INCLUDE_DIR}" ) + set( INSTALL_PATH /usr/local/bin/ ) - -set( REQUIRED_LIBRARIES - SDL - SDL_mixer ) - + set( CMAKE_CXX_FLAGS "-O2 -Wall -MMD -MP -MF" ) - + add_executable( ${BIN} ${SOURCES} ) -target_link_libraries( ${BIN} ${REQUIRED_LIBRARIES} ) - +target_link_libraries( ${BIN} "${SDL_LIBRARY}" "${SDLMIXER_LIBRARY}" ) + install( TARGETS ${BIN} DESTINATION ${INSTALL_PATH} )