Improve cmake detection of required libraries.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
Andrea Odetti 2019-11-02 19:19:18 +00:00
parent 0aad738d0e
commit d44bc6c019
4 changed files with 40 additions and 15 deletions

View file

@ -1,3 +1,5 @@
include(FindPkgConfig)
add_library(appleii SHARED
SaveState.cpp
Pravets.cpp
@ -35,8 +37,17 @@ add_library(appleii SHARED
Z80VICE/daa.cpp
)
target_link_libraries(appleii
yaml
z
minizip
pkg_check_modules(YAML REQUIRED yaml-0.1)
pkg_check_modules(MINIZIP REQUIRED minizip)
find_package(Boost REQUIRED)
target_include_directories(appleii PRIVATE
${YAML_INCLUDE_DIRS}
${MINIZIP_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
target_link_libraries(appleii
${YAML_LIBRARIES}
${MINIZIP_LIBRARIES}
)

View file

@ -1,4 +1,4 @@
find_package(PkgConfig)
include(FindPkgConfig)
add_executable(applen
main.cpp
@ -13,20 +13,24 @@ add_executable(applen
pkg_search_module(NCURSESW REQUIRED ncursesw)
pkg_search_module(LIBEVDEV REQUIRED libevdev)
find_package(Boost REQUIRED
COMPONENTS program_options
)
target_include_directories(applen PRIVATE
${NCURSESW_INCLUDE_DIRS}
${LIBEVDEV_INCLUDE_DIRS}
)
target_link_libraries(applen
boost_program_options
appleii
${NCURSESW_LIBRARIES}
${LIBEVDEV_LIBRARIES}
${Boost_INCLUDE_DIRS}
)
target_compile_options(applen PRIVATE
${NCURSESW_CFLAGS_OTHER}
${LIBEVDEV_CFLAGS_OTHER}
)
target_link_libraries(applen
${NCURSESW_LIBRARIES}
${LIBEVDEV_LIBRARIES}
Boost::program_options
appleii
)

View file

@ -4,9 +4,6 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
find_package(Qt5Widgets)
find_package(Qt5Gamepad)
add_executable(qapple
main.cpp
qapple.qrc
@ -26,6 +23,10 @@ add_executable(qapple
qhexedit.cpp
)
find_package(Qt5 REQUIRED
COMPONENTS Widgets Gamepad
)
target_link_libraries(qapple
Qt5::Widgets
Qt5::Gamepad

View file

@ -0,0 +1,9 @@
cmake
gcc-c++
qt5-devel
qt5-qtgamepad-devel
libyaml-devel
minizip-devel
boost-devel
ncurses-devel
libevdev-devel