From 02883e156482e124216459ded9e8d50f6e8b7dcf Mon Sep 17 00:00:00 2001 From: Yantao Xie Date: Mon, 30 Mar 2015 18:01:54 +0800 Subject: [PATCH 1/5] Missing including a head file: Foundation/NSValue.h. --- src/qt-gui/osx-configuration.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qt-gui/osx-configuration.mm b/src/qt-gui/osx-configuration.mm index 2e3e1f6..4d841f5 100644 --- a/src/qt-gui/osx-configuration.mm +++ b/src/qt-gui/osx-configuration.mm @@ -19,6 +19,7 @@ #include #include +#include #include #include #include From 4f878b4b7d8ed2f8b3eeadd79fcdcbf9dba1b83c Mon Sep 17 00:00:00 2001 From: Yantao Xie Date: Mon, 30 Mar 2015 18:03:11 +0800 Subject: [PATCH 2/5] Fix a character case error. --- src/qt-gui/gui/worker-thread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt-gui/gui/worker-thread.cpp b/src/qt-gui/gui/worker-thread.cpp index 880565d..f420753 100644 --- a/src/qt-gui/gui/worker-thread.cpp +++ b/src/qt-gui/gui/worker-thread.cpp @@ -24,7 +24,7 @@ #include #include -#include "avatar/avatar.hpp" +#include "avatar/Avatar.hpp" #include "gui/avatar.hpp" #include "configuration.hpp" From 5b42c0a49a671d3782112a181241f0965f7dc96f Mon Sep 17 00:00:00 2001 From: Yantao Xie Date: Mon, 30 Mar 2015 18:09:48 +0800 Subject: [PATCH 3/5] Make qt-gui build successfully with GNUStep on linux. --- src/qt-gui/CMakeLists.txt | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/qt-gui/CMakeLists.txt b/src/qt-gui/CMakeLists.txt index 8ddb0a4..dd84111 100644 --- a/src/qt-gui/CMakeLists.txt +++ b/src/qt-gui/CMakeLists.txt @@ -36,8 +36,20 @@ SET(MOC_HEADERS QT4_WRAP_CPP(MOC_SRCS ${MOC_HEADERS}) INCLUDE_DIRECTORIES(".") -set_source_files_properties(osx-configuration.mm PROPERTIES COMPILE_FLAGS -ObjC++) - +IF(UNIX AND NOT APPLE) + INCLUDE_DIRECTORIES(/usr/local/include/GNUstep /usr/include/GNUstep) + EXECUTE_PROCESS(COMMAND gnustep-config --objc-flags + OUTPUT_VARIABLE GnuStep_FLAGS + OUTPUT_STRIP_TRAILING_WHITESPACE) + EXECUTE_PROCESS(COMMAND gnustep-config --base-libs + OUTPUT_VARIABLE GnuStep_LINK_FLAGS + OUTPUT_STRIP_TRAILING_WHITESPACE) + STRING(REPLACE "\n" "" GnuStep_FLAGS ${GnuStep_FLAGS}) + STRING(REPLACE "\n" "" GnuStep_LINK_FLAGS ${GnuStep_LINK_FLAGS}) + set_source_files_properties(osx-configuration.mm PROPERTIES COMPILE_FLAGS "${GnuStep_FLAGS}") +ELSE() + set_source_files_properties(osx-configuration.mm PROPERTIES COMPILE_FLAGS -ObjC++) +ENDIF() add_executable(demo-application main.cpp @@ -65,6 +77,10 @@ ADD_EXECUTABLE(${BundleName} MACOSX_BUNDLE ${MOC_SRCS} ${EXTRA_SRC} ) +IF(UNIX AND NOT APPLE) + SET_TARGET_PROPERTIES(${BundleName} PROPERTIES + LINK_FLAGS "${GnuStep_LINK_FLAGS}") +ENDIF() TARGET_LINK_LIBRARIES(${BundleName} ${LIBS} ${QT_LIBRARIES} clmTracker avatarAnim ${EXTRA_LIBS}) From d0c6e88a907edb969195db5328ff36696e6bbebf Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Sat, 1 Oct 2016 15:38:30 -0500 Subject: [PATCH 4/5] Check for the GUI components in tthe cmakefile --- CMakeLists.txt | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b6b39dc..d213eaf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,7 @@ endif() # Configurable options OPTION(WITH_GUI "Build the GUI" OFF) + # Third party libraries find_package(OpenCV REQUIRED core highgui imgproc objdetect PATHS ${OpenCV_PREFIX}/lib/cmake/ @@ -25,10 +26,21 @@ find_package(OpenCV REQUIRED core highgui imgproc objdetect NO_DEFAULT_PATH) # For some reason CMake uses its defaults before the above paths. IF(APPLE) -find_library(FOUNDATION Foundation) -SET(EXTRA_LIBS ${FOUNDATION}) + find_library(FOUNDATION Foundation) + SET(EXTRA_LIBS ${FOUNDATION}) ENDIF() +IF(UNIX AND NOT APPLE) + FIND_PROGRAM(HAVE_GNUSTEP NAMES gnustep-config) + IF(HAVE_GNUSTEP) + SET(WITH_GUI "Build the GUI" ON) + MESSAGE(STATUS "Found GnuStep") + ELSE(HAVE_GNUSTEP) + MESSAGE(STATUS "Cannot find GnuStep") + ENDIF(HAVE_GNUSTEP) +ENDIF(UNIX AND NOT APPLE) + + # Third party programs if(NOT DEFINED FFMPEG) find_program(FFMPEG ffmpeg) @@ -98,6 +110,9 @@ IF(WITH_GUI) SET(CPACK_BINARY_PACKAGEMAKER OFF) SET(CPACK_SOURCE_TGZ OFF) ADD_SUBDIRECTORY(src/qt-gui) + MESSAGE(STATUS "Will build the GUI") +else() + MESSAGE(STATUS "Missing GUI components - will NOT build the GUI") endif() #cpack stuff goes here From 7e54478a897ab2c1a90ebec1cde7d30d981198dc Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Sat, 1 Oct 2016 15:53:15 -0500 Subject: [PATCH 5/5] Add the needed linker flags to avoid bomb --- src/qt-gui/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qt-gui/CMakeLists.txt b/src/qt-gui/CMakeLists.txt index dd84111..84fd2b4 100644 --- a/src/qt-gui/CMakeLists.txt +++ b/src/qt-gui/CMakeLists.txt @@ -46,7 +46,11 @@ IF(UNIX AND NOT APPLE) OUTPUT_STRIP_TRAILING_WHITESPACE) STRING(REPLACE "\n" "" GnuStep_FLAGS ${GnuStep_FLAGS}) STRING(REPLACE "\n" "" GnuStep_LINK_FLAGS ${GnuStep_LINK_FLAGS}) - set_source_files_properties(osx-configuration.mm PROPERTIES COMPILE_FLAGS "${GnuStep_FLAGS}") + + SET(GnuStep_LINK_FLAGS "-Wl,--no-as-needed ${GnuStep_LINK_FLAGS}") + set_source_files_properties(osx-configuration.mm PROPERTIES + COMPILE_FLAGS "${GnuStep_FLAGS}" + LINKER_FLAGS "${GnuStep_LINK_FLAGS}") ELSE() set_source_files_properties(osx-configuration.mm PROPERTIES COMPILE_FLAGS -ObjC++) ENDIF()