Skip to content

Commit

Permalink
Amethyst: Finding Qt 5 using CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 31, 2021
1 parent 9d232cc commit 9938374
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions doomsday/tools/amethyst/CMakeLists.txt
Expand Up @@ -16,6 +16,8 @@
cmake_minimum_required (VERSION 3.1)
project (Amethyst)

find_package (Qt5 COMPONENTS Core)

set (CMAKE_INCLUDE_CURRENT_DIR ON)
set (CMAKE_AUTOMOC ON)

Expand All @@ -27,22 +29,15 @@ set (CMAKE_MODULE_PATH
)

include (Macros)
include (FindQt)
list (APPEND CMAKE_PREFIX_PATH "${QT_PREFIX_DIR}")

file (GLOB SOURCES src/*.cpp src/*.h)
add_executable (amethyst ${SOURCES})
set_property (TARGET amethyst PROPERTY FOLDER Tools)
strict_warnings (amethyst)

find_package (Qt5Core QUIET)
if (Qt5Core_FOUND)
add_definitions (-DHAVE_QT5)
target_link_libraries (amethyst Qt5::Core)
else ()
find_package (Qt4 REQUIRED)
target_link_libraries (amethyst Qt4::Core)
endif ()
add_definitions (-DHAVE_QT5)
target_link_libraries (amethyst Qt5::Core)

if (UNIX)
set (LIB_PREFIX "share/amethyst")
Expand Down

0 comments on commit 9938374

Please sign in to comment.