Commit c4fd37f7 authored by Fabien Grzeskowiak's avatar Fabien Grzeskowiak

fix linux GUI compilation

parent 714c7f03
......@@ -18,7 +18,7 @@
# Website: https://project.inria.fr/crowdscience/
# See the file AUTHORS.md for a list of all contributors.
cmake_minimum_required( VERSION 2.8 )
cmake_minimum_required( VERSION 3.10 )
project( UMANS )
set (CMAKE_CXX_STANDARD 17)
......@@ -77,23 +77,29 @@ target_link_libraries(UMANS-Library Engine)
if (UMANS_USE_GUI_APPLICATION)
set(CMAKE_AUTOMOC ON)
# necessary: gives the path to GUI src files to qt autogen files
include_directories( ./src/GUI/ )
# set autogen variables for qt
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set (CMAKE_INCLUDE_CURRENT_DIR ON)
# --- NOTE: To let this line work, add the following environment variable:
# CMAKE_PREFIX_PATH
# with a value such as C:\Qt\5.12.0\msvc2017_64 (depending on your Qt installation)
find_package(Qt5 COMPONENTS Core Widgets REQUIRED)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
# find relevant packages
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(OpenGL REQUIRED)
# --- include the Qt resources, so that the application icon gets shown
set(UI_RESOURCES src/GUI/UMANSQtGuiApplication.qrc )
set(UI_RESOURCES src/GUI/UMANSQtGuiApplication.qrc)
qt5_add_resources(UI_RESOURCES_RCC ${UI_RESOURCES})
# --- define the project itself
add_executable(UMANS-GUI src/GUI/main.cpp ${src_GUI} ${UI_RESOURCES_RCC})
add_executable(UMANS-GUI src/GUI/main.cpp ${src_GUI} ${UI_RESOURCES_RCC} ${UI_HEADERS})
# --- the project depends on some libraries
target_link_libraries(UMANS-GUI Engine Qt5::Widgets opengl32.lib glu32.lib)
target_link_libraries(UMANS-GUI Engine Qt5::Core Qt5::Widgets ${OPENGL_LIBRARIES})
# --- post-build command: copy the required Qt DLLs, to prevent runtime errors
add_custom_command(TARGET UMANS-GUI POST_BUILD
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment