Skip to content

Commit

Permalink
Merge pull request #5 from linas/cook
Browse files Browse the repository at this point in the history
merge fixes from Cook
  • Loading branch information
linas authored Oct 1, 2016
2 parents ffabddd + 7e54478 commit c815daf
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
19 changes: 17 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,29 @@ 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/
${OpenCV_PREFIX}/share/OpenCV/
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)
Expand Down Expand Up @@ -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
Expand Down
24 changes: 22 additions & 2 deletions src/qt-gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,24 @@ 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(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()

add_executable(demo-application
main.cpp
Expand Down Expand Up @@ -65,6 +81,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})


Expand Down
1 change: 1 addition & 0 deletions src/qt-gui/osx-configuration.mm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <Foundation/NSBundle.h>
#include <Foundation/NSString.h>
#include <Foundation/NSValue.h>
#include <Foundation/NSPathUtilities.h>
#include <Foundation/NSAutoreleasePool.h>
#include <Foundation/NSDictionary.h>
Expand Down

0 comments on commit c815daf

Please sign in to comment.