Skip to content

Commit

Permalink
Merge branch 'pr/268' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Jan 9, 2015
2 parents 053a9c4 + 6d38344 commit 9ded052
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 9 deletions.
14 changes: 14 additions & 0 deletions ApplicationCode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ source_group( "SocketInterface" FILES ${SOCKET_INTERFACE_FILES} )

if (MSVC)
set( EXE_FILES WIN32)
elseif (APPLE)
set( EXE_FILES MACOSX_BUNDLE)
endif()
set( EXE_FILES
${EXE_FILES}
Expand All @@ -224,6 +226,18 @@ set( EXE_FILES

add_executable( ResInsight ${EXE_FILES} )

# Application icon for MacOS X bundle
if (APPLE)
add_custom_command (OUTPUT Resources/ResInsight.icns
COMMAND sips -s format icns ${CMAKE_CURRENT_SOURCE_DIR}/Resources/AppLogo48x48.png --out ${CMAKE_CURRENT_BINARY_DIR}/Resources/ResInsight.icns
COMMENT Converting application icon
)
add_custom_target (ResInsight-icns
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Resources/ResInsight.icns)
add_dependencies (ResInsight ResInsight-icns)
set_target_properties (ResInsight PROPERTIES
MACOSX_BUNDLE_ICON_FILE ${CMAKE_CURRENT_BINARY_DIR}/Resources/ResInsight.icns)
endif ()

set( LINK_LIBRARIES
WellPathImportSsihub
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ set( LINK_LIBRARIES
${QT_LIBRARIES}
)

if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_CXX_FLAGS "-DGTEST_USE_OWN_TR1_TUPLE=1")
endif()

add_executable( ${ProjectName}
${CODE_HEADER_FILES}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set( EXTERNAL_LINK_LIBRARIES
pthread
)
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set( CMAKE_CXX_FLAGS
"-DGTEST_USE_OWN_TR1_TUPLE=1"
)
ENDIF()

target_link_libraries( ${ProjectName} ${LINK_LIBRARIES} ${EXTERNAL_LINK_LIBRARIES})
Expand Down
2 changes: 1 addition & 1 deletion ApplicationCode/ModelVisualization/RivReservoirPartMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "cvfArray.h"
#include "cvfCollection.h"

#include "RivGridPartMgr.h"
#include "RivReservoirFaultsPartMgr.h"

namespace cvf
Expand All @@ -33,7 +34,6 @@ namespace cvf

class RimResultSlot;
class RimCellEdgeResultSlot;
class RivGridPartMgr;
class RigCaseData;
class RimReservoirView;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNO_DEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ")

ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_CXX_FLAGS "-DGTEST_USE_OWN_TR1_TUPLE=1")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "RifReaderInterface.h"

#include "RimDefines.h"
#include "RigStatisticsDataCache.h"

#include <QDateTime>

Expand All @@ -31,7 +32,6 @@

class RifReaderInterface;
class RigMainGrid;
class RigStatisticsDataCache;
class RigActiveCellInfo;

//==================================================================================================
Expand Down
6 changes: 0 additions & 6 deletions Fwk/VizFwk/LibCore/cvfAtomicCounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,6 @@ AtomicCounter::AtomicCounter(int initialValue)
}


AtomicCounter::AtomicCounter(const AtomicCounter& counter)
: m_counter(counter.value())
{
}


AtomicCounter::~AtomicCounter()
{
}
Expand Down
2 changes: 1 addition & 1 deletion Fwk/VizFwk/LibCore/cvfMutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#pragma warning (pop)
#endif

#if defined CVF_LINUX || defined(CVF_ANDROID)
#if defined(CVF_LINUX) || defined(CVF_ANDROID) || defined(CVF_OSX)
#include <pthread.h>
#endif

Expand Down
4 changes: 4 additions & 0 deletions Fwk/VizFwk/LibRender/cvfOpenGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ void OpenGL::cvf_check_ogl(OpenGLContext* oglContext, const CodeLocation& codeLo
CVF_ASSERT(oglContext->isCurrent());

Logger* logger = oglContext->group()->logger();
#if defined(CVF_OSX)
if (logger && (err != GL_INVALID_FRAMEBUFFER_OPERATION))
#else
if (logger)
#endif /* defined(CVF_OSX) */
{
String errCodeStr = mapOpenGLErrorToString(err);
String msg = "OGL(" + errCodeStr + "): ";
Expand Down
2 changes: 2 additions & 0 deletions Fwk/VizFwk/LibRender/cvfShaderProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ bool ShaderProgram::useProgram(OpenGLContext* oglContext) const
}

CVF_ASSERT(OglRc::safeOglId(m_oglRcProgram.p()) != 0);
#ifndef CVF_OSX
CVF_ASSERT(validateProgram(oglContext));
#endif

// Need this check to clear any "hanging" errors that is not produced by glUseProgram below, but still
// will make this method return false.
Expand Down
44 changes: 44 additions & 0 deletions OctavePlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,36 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
endif()
endif()

# recreate the magic that CMake does for MacOS X frameworks in the
# include list when we call mkoctfile as a custom command
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (QT_INCLUDES)
set (QT_FRAMEWORKS)
# QT_INCLUDE_DIR contains two items; the first is the directory
# containing header files, the second is the framework. This
# setup is specially processed in include_directories (); CMake
# will add -F before the frameworks. We will have to replicate
# that setup here when we want to pass it directly to a command
# see <http://www.cmake.org/Bug/print_bug_page.php?bug_id=10632>
foreach (item IN ITEMS ${QT_QTNETWORK_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_INCLUDE_DIR})
if ("${item}" MATCHES ".framework$")
get_filename_component (frmwrk_path ${item} PATH)
get_filename_component (frmwrk_name ${item} NAME_WE)
# mkoctfile doesn't support arbitrary compiler command,
# so we must wrap in -Wl, to pass to the linker
list (APPEND QT_FRAMEWORKS "-Wl,-F${frmwrk_path}")
list (APPEND QT_FRAMEWORKS "-Wl,-framework,${frmwrk_name}")
else ()
list (APPEND QT_INCLUDES "-I${item}")
endif ()
endforeach (item)
if (QT_INCLUDES)
list (REMOVE_DUPLICATES QT_INCLUDES)
endif ()
if (QT_FRAMEWORKS)
list (REMOVE_DUPLICATES QT_FRAMEWORKS)
endif ()
endif ()

# Find location of Octave based on mkoctfile
find_program(RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE mkoctfile)
Expand Down Expand Up @@ -113,6 +143,20 @@ if (RESINSIGHT_OCTAVE_PLUGIN_QMAKE AND RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE)
COMMENT "===> Generating ${octFileName}"
)
endif()
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
add_custom_command(
OUTPUT "${octFileName}"
COMMAND ${RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE}
${QT_INCLUDES}
${QT_FRAMEWORKS}
-I${ResInsight_SOURCE_DIR}/ApplicationCode/SocketInterface
${RPATH_COMMAND}
-L${QT_LIBRARY_DIR} -Wl,-framework,QtCore -Wl,-framework,QtNetwork
-o "${octFileName}"
"${srcFileName}"
DEPENDS "${srcFileName}"
COMMENT "===> Generating ${octFileName}"
)
else()
add_custom_command(
OUTPUT "${octFileName}"
Expand Down

0 comments on commit 9ded052

Please sign in to comment.