diff --git a/ApplicationCode/CMakeLists.txt b/ApplicationCode/CMakeLists.txt index b392fbbf8e..843cd0b6da 100644 --- a/ApplicationCode/CMakeLists.txt +++ b/ApplicationCode/CMakeLists.txt @@ -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} @@ -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 diff --git a/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt b/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt index 4b599dbf7f..1837990216 100644 --- a/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt +++ b/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt @@ -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} diff --git a/ApplicationCode/ModelVisualization/ModelVisualization_UnitTests/CMakeLists.txt b/ApplicationCode/ModelVisualization/ModelVisualization_UnitTests/CMakeLists.txt index 97e839bfc1..3f8c05e07e 100644 --- a/ApplicationCode/ModelVisualization/ModelVisualization_UnitTests/CMakeLists.txt +++ b/ApplicationCode/ModelVisualization/ModelVisualization_UnitTests/CMakeLists.txt @@ -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}) diff --git a/ApplicationCode/ModelVisualization/RivReservoirPartMgr.h b/ApplicationCode/ModelVisualization/RivReservoirPartMgr.h index 1e9e2b894b..e96db4e413 100644 --- a/ApplicationCode/ModelVisualization/RivReservoirPartMgr.h +++ b/ApplicationCode/ModelVisualization/RivReservoirPartMgr.h @@ -23,6 +23,7 @@ #include "cvfArray.h" #include "cvfCollection.h" +#include "RivGridPartMgr.h" #include "RivReservoirFaultsPartMgr.h" namespace cvf @@ -33,7 +34,6 @@ namespace cvf class RimResultSlot; class RimCellEdgeResultSlot; -class RivGridPartMgr; class RigCaseData; class RimReservoirView; diff --git a/ApplicationCode/ReservoirDataModel/ReservoirDataModel_UnitTests/CMakeLists.txt b/ApplicationCode/ReservoirDataModel/ReservoirDataModel_UnitTests/CMakeLists.txt index 6152868dbe..e46aef6985 100644 --- a/ApplicationCode/ReservoirDataModel/ReservoirDataModel_UnitTests/CMakeLists.txt +++ b/ApplicationCode/ReservoirDataModel/ReservoirDataModel_UnitTests/CMakeLists.txt @@ -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") diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h index dc5ddf4182..461339bc77 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h @@ -23,6 +23,7 @@ #include "RifReaderInterface.h" #include "RimDefines.h" +#include "RigStatisticsDataCache.h" #include @@ -31,7 +32,6 @@ class RifReaderInterface; class RigMainGrid; -class RigStatisticsDataCache; class RigActiveCellInfo; //================================================================================================== diff --git a/Fwk/VizFwk/LibCore/cvfAtomicCounter.cpp b/Fwk/VizFwk/LibCore/cvfAtomicCounter.cpp index 2c6953eb09..0cb825a83f 100644 --- a/Fwk/VizFwk/LibCore/cvfAtomicCounter.cpp +++ b/Fwk/VizFwk/LibCore/cvfAtomicCounter.cpp @@ -99,12 +99,6 @@ AtomicCounter::AtomicCounter(int initialValue) } -AtomicCounter::AtomicCounter(const AtomicCounter& counter) - : m_counter(counter.value()) -{ -} - - AtomicCounter::~AtomicCounter() { } diff --git a/Fwk/VizFwk/LibCore/cvfMutex.cpp b/Fwk/VizFwk/LibCore/cvfMutex.cpp index 139c203051..3b8607d497 100644 --- a/Fwk/VizFwk/LibCore/cvfMutex.cpp +++ b/Fwk/VizFwk/LibCore/cvfMutex.cpp @@ -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 #endif diff --git a/Fwk/VizFwk/LibRender/cvfOpenGL.cpp b/Fwk/VizFwk/LibRender/cvfOpenGL.cpp index 0e535170c0..f27d8c3571 100644 --- a/Fwk/VizFwk/LibRender/cvfOpenGL.cpp +++ b/Fwk/VizFwk/LibRender/cvfOpenGL.cpp @@ -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 + "): "; diff --git a/Fwk/VizFwk/LibRender/cvfShaderProgram.cpp b/Fwk/VizFwk/LibRender/cvfShaderProgram.cpp index a38b280a70..d6073fb321 100644 --- a/Fwk/VizFwk/LibRender/cvfShaderProgram.cpp +++ b/Fwk/VizFwk/LibRender/cvfShaderProgram.cpp @@ -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. diff --git a/OctavePlugin/CMakeLists.txt b/OctavePlugin/CMakeLists.txt index 3a017e61de..bbb28e1415 100644 --- a/OctavePlugin/CMakeLists.txt +++ b/OctavePlugin/CMakeLists.txt @@ -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 + 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) @@ -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}"