Use cmake native find_package for OpenGL.
Could solve https://github.com/audetto/AppleWin/issues/39. Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
parent
d865d5c252
commit
9006bcf354
3 changed files with 18 additions and 13 deletions
|
@ -1,15 +1,16 @@
|
|||
include(FindPkgConfig)
|
||||
include(FindZLIB)
|
||||
|
||||
pkg_check_modules(YAML REQUIRED yaml-0.1)
|
||||
pkg_check_modules(MINIZIP REQUIRED minizip)
|
||||
pkg_check_modules(ZLIB REQUIRED zlib)
|
||||
pkg_check_modules(SLIRP slirp)
|
||||
find_package(ZLIB REQUIRED)
|
||||
pkg_search_module(YAML REQUIRED yaml-0.1)
|
||||
pkg_search_module(MINIZIP REQUIRED minizip)
|
||||
pkg_search_module(SLIRP slirp)
|
||||
|
||||
if ("${SLIRP_FOUND}" STREQUAL "")
|
||||
message(WARNING "'libslirp' not found. Will use 'libpcap' instead")
|
||||
endif()
|
||||
|
||||
pkg_check_modules(PCAP libpcap)
|
||||
pkg_search_module(PCAP libpcap)
|
||||
if ("${PCAP_FOUND}" STREQUAL "")
|
||||
# old versions of pcap do not work with pkg-config
|
||||
# this is necessary on Rapsberri Pi OS
|
||||
|
@ -214,7 +215,6 @@ target_include_directories(appleii PRIVATE
|
|||
${PCAP_INCLUDE_DIRS}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${SLIRP_INCLUDE_DIRS}
|
||||
${ZLIB_INCLUDE_DIRS}
|
||||
Debugger
|
||||
)
|
||||
|
||||
|
@ -228,7 +228,7 @@ target_link_libraries(appleii PRIVATE
|
|||
${MINIZIP_LIBRARIES}
|
||||
${PCAP_LIBRARIES}
|
||||
${SLIRP_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
ZLIB::ZLIB
|
||||
)
|
||||
|
||||
target_link_libraries(appleii PUBLIC
|
||||
|
@ -240,7 +240,6 @@ target_link_directories(appleii PRIVATE
|
|||
${MINIZIP_LIBRARY_DIRS}
|
||||
${PCAP_LIBRARY_DIRS}
|
||||
${SLIRP_LIBRARY_DIRS}
|
||||
${ZLIB_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
target_compile_options(appleii PUBLIC
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
include(FindPkgConfig)
|
||||
include(FindCurses)
|
||||
|
||||
set(SOURCE_FILES
|
||||
main.cpp
|
||||
|
@ -22,22 +23,23 @@ add_executable(applen
|
|||
${HEADER_FILES}
|
||||
)
|
||||
|
||||
pkg_search_module(NCURSESW REQUIRED ncursesw)
|
||||
find_package(Curses REQUIRED)
|
||||
# pkg_search_module(NCURSESW REQUIRED ncursesw)
|
||||
pkg_search_module(LIBEVDEV REQUIRED libevdev)
|
||||
|
||||
target_include_directories(applen PRIVATE
|
||||
${NCURSESW_INCLUDE_DIRS}
|
||||
${CURSES_INCLUDE_DIRS}
|
||||
${LIBEVDEV_INCLUDE_DIRS}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_compile_options(applen PRIVATE
|
||||
${NCURSESW_CFLAGS_OTHER}
|
||||
${CURSES_CFLAGS}
|
||||
${LIBEVDEV_CFLAGS_OTHER}
|
||||
)
|
||||
|
||||
target_link_libraries(applen PRIVATE
|
||||
${NCURSESW_LIBRARIES}
|
||||
${CURSES_LIBRARIES}
|
||||
${LIBEVDEV_LIBRARIES}
|
||||
appleii
|
||||
common2
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
include(FindPkgConfig)
|
||||
include(FindOpenGL)
|
||||
|
||||
add_executable(sa2)
|
||||
|
||||
|
@ -6,6 +7,7 @@ set(IMGUI_PATH "imgui/imgui")
|
|||
set(IMGUI_CLUB_PATH "imgui/imgui_club")
|
||||
|
||||
find_package(SDL2 REQUIRED)
|
||||
# we should use find_package, but Ubuntu does not provide it for SDL2_image
|
||||
pkg_search_module(SDL2_IMAGE REQUIRED SDL2_image)
|
||||
|
||||
|
||||
|
@ -17,7 +19,7 @@ else()
|
|||
endif()
|
||||
|
||||
if (SA2_OPENGL)
|
||||
pkg_search_module(GLES2 REQUIRED opengl)
|
||||
find_package(OpenGL REQUIRED)
|
||||
else()
|
||||
pkg_search_module(GLES2 REQUIRED glesv2)
|
||||
target_compile_definitions(sa2 PRIVATE
|
||||
|
@ -51,12 +53,14 @@ target_compile_features(sa2 PUBLIC cxx_std_17)
|
|||
target_include_directories(sa2 PRIVATE
|
||||
${SDL2_INCLUDE_DIRS}
|
||||
${SDL2_IMAGE_INCLUDE_DIRS}
|
||||
${GLES2_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(sa2 PRIVATE
|
||||
${SDL2_LIBRARIES}
|
||||
${SDL2_IMAGE_LIBRARIES}
|
||||
${GLES2_LIBRARIES}
|
||||
OpenGL::GL
|
||||
appleii
|
||||
common2
|
||||
windows
|
||||
|
|
Loading…
Add table
Reference in a new issue