diff --git a/ext/ghoul b/ext/ghoul index b256ae209a..9df5fdae81 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit b256ae209a521dd8c079090f18ec032adab6f8ce +Subproject commit 9df5fdae818d5c2abb9458e4ccf8f4b8c88b308d diff --git a/include/openspace/util/syncbuffer.h b/include/openspace/util/syncbuffer.h index bee0bbd046..48fda29fb8 100644 --- a/include/openspace/util/syncbuffer.h +++ b/include/openspace/util/syncbuffer.h @@ -26,6 +26,7 @@ #define SYNCBUFFER_H #include +#include #include #include diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 426cd568df..da48d4b12c 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -24,6 +24,8 @@ #include +#include + #define SGCT_WINDOWS_INCLUDE #include #include diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 80da9a901f..ae5fb99fc4 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -24,6 +24,8 @@ #include +#include + // This needs to be included first due to Windows.h / winsock2.h complications #define SGCT_WINDOWS_INCLUDE #include diff --git a/src/interaction/luaconsole.cpp b/src/interaction/luaconsole.cpp index 920d7a7f24..66d9afa687 100644 --- a/src/interaction/luaconsole.cpp +++ b/src/interaction/luaconsole.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include diff --git a/src/main.cpp b/src/main.cpp index af5dc9325b..a7c161752e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include sgct::Engine* _sgctEngine; diff --git a/src/network/networkengine.cpp b/src/network/networkengine.cpp index 7a29e38879..2d802e69c9 100644 --- a/src/network/networkengine.cpp +++ b/src/network/networkengine.cpp @@ -31,6 +31,8 @@ #include #include +#include + #include "sgct.h" namespace { diff --git a/src/util/screenlog.cpp b/src/util/screenlog.cpp index 18ff2be4f8..efe454bd1e 100644 --- a/src/util/screenlog.cpp +++ b/src/util/screenlog.cpp @@ -24,6 +24,7 @@ #include +#include #include // sgct::Engine::instance()->getTime() namespace openspace { diff --git a/support/cmake/module_definition.cmake b/support/cmake/module_definition.cmake index ac6a2a033f..a75445cc17 100644 --- a/support/cmake/module_definition.cmake +++ b/support/cmake/module_definition.cmake @@ -41,7 +41,7 @@ function (create_new_module module_name output_library_name) add_module_files() # Create the library - add_library(${library_name} ${sources}) + add_library(${library_name} STATIC ${sources}) # Set compile settings that are common to all modules set_common_compile_settings(${library_name}) @@ -87,7 +87,37 @@ function (set_common_compile_settings target_name) if (OPENSPACE_WARNINGS_AS_ERRORS) target_compile_options(${library_name} PUBLIC "/Wx") endif () - endif () + elseif (APPLE) + target_compile_definitions(${library_name} PUBLIC "__APPLE__") + + include (CheckCXXCompilerFlag) + CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) + CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) + mark_as_advanced(COMPILER_SUPPORTS_CXX11, COMPILER_SUPPORTS_CXX0X) + if (COMPILER_SUPPORTS_CXX11) + target_compile_options(${library_name} PUBLIC "-std=c++11") + elseif (COMPILER_SUPPORTS_CXX0X) + target_compile_options(${library_name} PUBLIC "-std=c++0x") + else () + message(FATAL_ERROR "Compiler does not have C++11 support") + endif () + + target_compile_options(${library_name} PUBLIC "-stdlib=libc++") + elseif (UNIX) + include (CheckCXXCompilerFlag) + CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) + CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) + mark_as_advanced(COMPILER_SUPPORTS_CXX11, COMPILER_SUPPORTS_CXX0X) + if (COMPILER_SUPPORTS_CXX11) + target_compile_options(${library_name} PUBLIC "-std=c++11") + elseif (COMPILER_SUPPORTS_CXX0X) + target_compile_options(${library_name} PUBLIC "-std=c++0x") + else () + message(FATAL_ERROR "Compiler does not have C++11 support") + endif () + + target_compile_definitions(${library_name} PUBLIC "-ggdb") + endif () endfunction () @@ -111,6 +141,7 @@ function (set_openspace_settings target_name) ) target_compile_definitions(${target_name} PUBLIC ${OPENSPACE_DEFINES}) + target_link_libraries(${target_name} Ghoul) target_link_libraries(${target_name} libOpenSpace) endfunction () diff --git a/support/cmake/support_macros.cmake b/support/cmake/support_macros.cmake index 15c93f9a75..55a1719914 100644 --- a/support/cmake/support_macros.cmake +++ b/support/cmake/support_macros.cmake @@ -67,6 +67,7 @@ endfunction () function (create_openspace_targets) add_library(libOpenSpace STATIC ${OPENSPACE_HEADER} ${OPENSPACE_SOURCE}) target_include_directories(libOpenSpace PUBLIC ${OPENSPACE_BASE_DIR}/include) + target_include_directories(libOpenSpace PUBLIC ${OPENSPACE_BASE_DIR}) target_include_directories(libOpenSpace PUBLIC ${CMAKE_BINARY_DIR}/_generated/include) add_executable(OpenSpace ${OPENSPACE_MAIN}) @@ -102,9 +103,9 @@ function (set_compile_settings) message(FATAL_ERROR "Compiler does not have C++11 support") endif () - target_compile_options(libOpenSpace PUBLIC"-stdlib=libc++") + target_compile_options(libOpenSpace PUBLIC "-stdlib=libc++") - target_include_directories(libOpenSpace "/Developer/Headers/FlatCarbon") + target_include_directories(libOpenSpace PUBLIC "/Developer/Headers/FlatCarbon") find_library(COREFOUNDATION_LIBRARY CoreFoundation) find_library(CARBON_LIBRARY Carbon) find_library(COCOA_LIBRARY Carbon) @@ -177,7 +178,9 @@ function (add_external_dependencies) target_include_directories(libOpenSpace SYSTEM PUBLIC ${KAMELEON_INCLUDES}) target_link_libraries(libOpenSpace ccmc) set_property(TARGET ccmc PROPERTY FOLDER "External") - set_property(TARGET cdf PROPERTY FOLDER "External") + if (TARGET cdf) + set_property(TARGET cdf PROPERTY FOLDER "External") + endif () # Imgui add_subdirectory(${OPENSPACE_EXT_DIR}/imgui) @@ -305,7 +308,7 @@ function (handle_internal_modules) if (${optionName}) create_library_name(${module} libraryName) add_subdirectory(${OPENSPACE_MODULE_DIR}/${module}) - target_link_libraries(libOpenSpace ${libraryName}) + target_link_libraries(OpenSpace ${libraryName}) # Create registration file string(TOUPPER ${module} module_upper)