2020-12-07 13:18:53 +01:00
|
|
|
include (VCICommon)
|
2009-05-01 21:17:01 +00:00
|
|
|
|
2011-03-11 08:05:35 +00:00
|
|
|
if ( NOT DEFINED BUILD_APPS )
|
|
|
|
|
set( BUILD_APPS true CACHE BOOL "Enable or disable building of apps" )
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if ( BUILD_APPS )
|
2009-05-01 21:17:01 +00:00
|
|
|
|
2012-01-18 14:35:25 +00:00
|
|
|
# Only build and fixbundle apps, when we are building OpenMesh standalone
|
2021-01-20 16:27:55 +01:00
|
|
|
if(${CMAKE_PROJECT_NAME} MATCHES "OpenMesh")
|
2012-01-18 14:35:25 +00:00
|
|
|
|
2012-09-24 06:06:35 +00:00
|
|
|
if ( WIN32 AND OPENMESH_BUILD_SHARED )
|
2012-09-24 14:12:15 +00:00
|
|
|
add_definitions(-DOPENMESHDLL )
|
2012-09-24 06:06:35 +00:00
|
|
|
endif()
|
|
|
|
|
|
2012-01-18 14:35:25 +00:00
|
|
|
add_subdirectory (Dualizer)
|
|
|
|
|
add_subdirectory (Decimating/commandlineDecimater)
|
|
|
|
|
add_subdirectory (Smoothing)
|
|
|
|
|
add_subdirectory (Subdivider/commandlineSubdivider)
|
|
|
|
|
add_subdirectory (Subdivider/commandlineAdaptiveSubdivider)
|
|
|
|
|
add_subdirectory (mconvert)
|
|
|
|
|
add_subdirectory (VDProgMesh/mkbalancedpm)
|
|
|
|
|
add_subdirectory (VDProgMesh/Analyzer)
|
|
|
|
|
|
|
|
|
|
# Add non ui apps as dependency before fixbundle
|
|
|
|
|
if ( WIN32 )
|
|
|
|
|
if ( NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" )
|
|
|
|
|
# let bundle generation depend on all targets
|
|
|
|
|
add_dependencies (fixbundle commandlineDecimater Dualizer mconvert Smoothing commandlineAdaptiveSubdivider commandlineSubdivider mkbalancedpm Analyzer )
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
2012-01-18 14:33:44 +00:00
|
|
|
|
2012-01-18 14:35:25 +00:00
|
|
|
# Add non ui apps as dependency before fixbundle
|
|
|
|
|
if ( APPLE)
|
2012-01-18 10:37:07 +00:00
|
|
|
# let bundle generation depend on all targets
|
|
|
|
|
add_dependencies (fixbundle commandlineDecimater Dualizer mconvert Smoothing commandlineAdaptiveSubdivider commandlineSubdivider mkbalancedpm Analyzer )
|
|
|
|
|
endif()
|
2011-11-28 13:31:31 +00:00
|
|
|
|
2011-03-09 09:52:57 +00:00
|
|
|
|
2012-01-18 14:36:51 +00:00
|
|
|
# find needed packages for gui applications
|
|
|
|
|
find_package (OpenGL)
|
2011-03-09 09:52:57 +00:00
|
|
|
|
2012-01-18 14:36:51 +00:00
|
|
|
# For the apps, we need qt and opengl to build them
|
2018-12-14 09:40:56 +01:00
|
|
|
if (NOT QT5_FOUND)
|
2020-12-02 14:17:17 +01:00
|
|
|
set(QT5_REQUIRED_PACKAGES
|
|
|
|
|
Qt5Core
|
2020-12-02 14:37:36 +01:00
|
|
|
Qt5Widgets
|
2020-12-02 14:17:17 +01:00
|
|
|
Qt5OpenGL
|
|
|
|
|
Qt5Gui
|
|
|
|
|
)
|
2020-12-07 13:18:53 +01:00
|
|
|
vci_qt5 ()
|
2020-12-02 14:17:17 +01:00
|
|
|
set(CMAKE_AUTOMOC ON)
|
2014-07-17 12:57:04 +00:00
|
|
|
endif()
|
2012-01-18 14:36:51 +00:00
|
|
|
|
|
|
|
|
if ("${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles")
|
|
|
|
|
message(WARNING "GUI Apps are not build with mingw. (TODO)")
|
|
|
|
|
endif()
|
|
|
|
|
|
2019-02-06 10:19:08 +01:00
|
|
|
# check for OpenGL as our required dependencies
|
|
|
|
|
if (( QT5_FOUND ) AND OPENGL_FOUND AND NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" )
|
2014-07-17 12:57:04 +00:00
|
|
|
|
2012-01-18 14:36:51 +00:00
|
|
|
add_subdirectory (Decimating/DecimaterGui)
|
|
|
|
|
add_subdirectory (QtViewer)
|
|
|
|
|
add_subdirectory (Subdivider/SubdividerGui)
|
|
|
|
|
add_subdirectory (ProgViewer)
|
|
|
|
|
add_subdirectory (VDProgMesh/Synthesizer)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Add ui apps as dependency before fixbundle
|
|
|
|
|
if ( WIN32 AND NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles")
|
|
|
|
|
# let bundle generation depend on all targets
|
|
|
|
|
add_dependencies (fixbundle DecimaterGui ProgViewer QtViewer SubdividerGui Synthesizer)
|
|
|
|
|
endif()
|
2012-01-18 14:35:25 +00:00
|
|
|
|
2012-01-18 14:36:51 +00:00
|
|
|
# Add ui apps as dependency before fixbundle
|
|
|
|
|
if ( APPLE)
|
|
|
|
|
# let bundle generation depend on all targets
|
|
|
|
|
add_dependencies (fixbundle DecimaterGui ProgViewer QtViewer SubdividerGui Synthesizer)
|
|
|
|
|
endif()
|
2009-06-16 06:10:40 +00:00
|
|
|
|
2012-01-18 14:36:51 +00:00
|
|
|
if ( WIN32 )
|
2012-09-24 14:12:15 +00:00
|
|
|
FILE(GLOB files_install_app_dlls "${CMAKE_BINARY_DIR}/Build/*.dll" )
|
|
|
|
|
INSTALL(FILES ${files_install_app_dlls} DESTINATION . )
|
2016-04-29 10:15:48 +02:00
|
|
|
|
|
|
|
|
# platform plugins for qt shoulb be installed along with the apps to run on the target systems
|
2016-04-29 10:31:18 +02:00
|
|
|
if (EXISTS ${CMAKE_BINARY_DIR}/Build/plugins/platforms )
|
|
|
|
|
FILE(GLOB files_install_app_platform_dlls "${CMAKE_BINARY_DIR}/Build/plugins/platforms/*.dll" )
|
2016-04-29 12:54:28 +02:00
|
|
|
INSTALL(FILES ${files_install_app_platform_dlls} DESTINATION plugins/platforms/ )
|
2016-04-29 10:15:48 +02:00
|
|
|
|
|
|
|
|
# Create a qt.conf file to find plugins on windows
|
2016-04-29 11:23:02 +02:00
|
|
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Qt/qt.conf DESTINATION . )
|
2016-04-29 10:15:48 +02:00
|
|
|
endif()
|
|
|
|
|
|
2012-01-18 14:36:51 +00:00
|
|
|
endif()
|
2009-05-01 21:17:01 +00:00
|
|
|
|
2012-01-18 14:36:51 +00:00
|
|
|
else () # QT ,Opengl or glut not found
|
|
|
|
|
|
2018-12-14 09:40:56 +01:00
|
|
|
if (NOT QT5_FOUND)
|
|
|
|
|
message ("QT5 not found! Skipping some apps.")
|
2012-01-18 14:36:51 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
if (NOT OPENGL_FOUND)
|
2012-09-24 14:12:15 +00:00
|
|
|
message ("OpengGL not found! Skipping some apps.")
|
2012-01-18 14:36:51 +00:00
|
|
|
endif ()
|
2009-05-01 21:17:01 +00:00
|
|
|
|
2012-01-18 14:35:25 +00:00
|
|
|
endif ()
|
2011-03-11 08:05:35 +00:00
|
|
|
|
2012-01-18 14:35:25 +00:00
|
|
|
endif() # Project is OpenMesh standalone
|
2012-01-18 14:33:44 +00:00
|
|
|
|
2011-03-11 08:05:35 +00:00
|
|
|
else (BUILD_APPS)
|
|
|
|
|
|
|
|
|
|
message ("Building Apps disabled by user.")
|
|
|
|
|
|
|
|
|
|
endif (BUILD_APPS)
|