Skip to content
Snippets Groups Projects
Commit 7d85116b authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[CMake] Clean packaging.

parent a690dde7
No related branches found
No related tags found
No related merge requests found
......@@ -68,25 +68,11 @@ IF(NOT CLIENT_ONLY)
ELSE()
MESSAGE(FATAL_ERROR "This package is only compatible with Qt 4 and Qt 5")
ENDIF()
MESSAGE(STATUS "Looking for Qt ${DESIRED_QT_VERSION_MAJOR}.")
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
IF(PROJECT_USE_QT4)
FIND_PACKAGE(Qt4 REQUIRED QtCore QtGui QtNetwork)
SET(GEPETTO_VIEWER_CORBA_QTVERSION "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}")
INCLUDE(${QT_USE_FILE})
ELSE(PROJECT_USE_QT4)
FOREACH (component "Core" "Widgets" "Gui" "Network" "Concurrent" "Xml" "OpenGL")
FIND_PACKAGE ("Qt5${component}" REQUIRED)
LIST(APPEND QT_INCLUDE_DIRS ${Qt5${component}_INCLUDE_DIRS})
LIST(APPEND QT_LIBRARIES ${Qt5${component}_LIBRARIES} )
ENDFOREACH (component "Core" "Widgets" "Gui" "OpenGL" "Network")
SET(GEPETTO_VIEWER_CORBA_QTVERSION "${Qt5Core_VERSION}")
ENDIF(PROJECT_USE_QT4)
SET(GEPETTO_VIEWER_CORBA_QTVERSION "${GEPETTO_VIEWER_QTVERSION}")
SET(PKG_CONFIG_EXTRA "qtversion=${GEPETTO_VIEWER_CORBA_QTVERSION}")
SET(PACKAGE_EXTRA_MACROS "set(GEPETTO_VIEWER_CORBA_QTVERSION ${GEPETTO_VIEWER_CORBA_QTVERSION})")
INCLUDE_DIRECTORIES(SYSTEM ${EIGEN3_INCLUDE_DIRS} ${QT_INCLUDE_DIRS})
# }}}
# {{{ Packaging
......
......@@ -80,16 +80,15 @@ IF(NOT CLIENT_ONLY)
# {{{ Configure Qt
SET(${PROJECT_NAME}_MOC
node-callback.hh)
IF(PROJECT_USE_QT4)
if(GEPETTO_VIEWER_QTVERSION VERSION_LESS 5)
QT4_WRAP_CPP(${PROJECT_NAME}_HEADERS_MOCED ${${PROJECT_NAME}_MOC})
#QT4_WRAP_UI(${PROJECT_NAME}_FORMS_HEADERS ${${PROJECT_NAME}_FORMS})
#QT4_ADD_RESOURCES(${PROJECT_NAME}_RESOURCES_RCC ${${PROJECT_NAME}_RESOURCES})
INCLUDE(${QT_USE_FILE})
ELSE(PROJECT_USE_QT4)
else(GEPETTO_VIEWER_QTVERSION VERSION_LESS 5)
QT5_WRAP_CPP(${PROJECT_NAME}_HEADERS_MOCED ${${PROJECT_NAME}_MOC})
#QT5_WRAP_UI(${PROJECT_NAME}_FORMS_HEADERS ${${PROJECT_NAME}_FORMS})
#QT5_ADD_RESOURCES(${PROJECT_NAME}_RESOURCES_RCC ${${PROJECT_NAME}_RESOURCES})
ENDIF(PROJECT_USE_QT4)
endif(GEPETTO_VIEWER_QTVERSION VERSION_LESS 5)
# {{{ Setup source files
SET (${PROJECT_NAME}_SOURCES
......@@ -101,7 +100,7 @@ IF(NOT CLIENT_ONLY)
${${PROJECT_NAME}_HEADERS_MOCED}
)
ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(${QT_DEFINITIONS})
# }}}
# Removes 5 warnings about anonymous variadic macros that were added from
......
......@@ -31,7 +31,7 @@ ADD_DEFINITIONS(${QT_DEFINITIONS})
MACRO(ADD_TESTCASE NAME)
ADD_UNIT_TEST(${NAME} ${NAME}.cc)
TARGET_LINK_LIBRARIES(${NAME} ${QT_LIBRARIES} gepetto-viewer::gepetto-viewer)
TARGET_LINK_LIBRARIES(${NAME} gepetto-viewer::gepetto-viewer)
ENDMACRO(ADD_TESTCASE)
ADD_TESTCASE(colormap)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment