Skip to content

Commit

Permalink
Remove remaining instance of find_package(SDL2 REQUIRED)
Browse files Browse the repository at this point in the history
  • Loading branch information
fleroviux committed Oct 3, 2023
1 parent 1a86c9c commit a2ceb76
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ project(dual CXX)

option(PLATFORM_SDL "Build SDL frontend" ON)

find_package(PkgConfig REQUIRED)
option(BUILD_STATIC "Build a statically linked executable" OFF)
if(BUILD_STATIC)
list(APPEND PKG_CONFIG_EXECUTABLE "--static")
endif()

add_subdirectory(external)
add_subdirectory(src/dual)

Expand Down
5 changes: 3 additions & 2 deletions src/dual/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()

# @todo: remove this when properly implementing key input
find_package(SDL2 REQUIRED)
target_link_libraries(dual PRIVATE SDL2::SDL2)
find_package(PkgConfig REQUIRED)
pkg_check_modules(SDL2 REQUIRED IMPORTED_TARGET sdl2)
target_link_libraries(dual PRIVATE PkgConfig::SDL2)
9 changes: 0 additions & 9 deletions src/platform/sdl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,8 @@ set(HEADERS
)

find_package(PkgConfig REQUIRED)

option(BUILD_STATIC "Build a statically linked executable" OFF)

if(BUILD_STATIC)
list(APPEND PKG_CONFIG_EXECUTABLE "--static")
endif()

pkg_check_modules(SDL2 REQUIRED IMPORTED_TARGET sdl2)

#find_package(SDL2 REQUIRED)

add_executable(dual-sdl ${SOURCES} ${HEADERS})
target_include_directories(dual-sdl PRIVATE src)
target_link_libraries(dual-sdl PRIVATE dual PkgConfig::SDL2)

0 comments on commit a2ceb76

Please sign in to comment.