diff --git a/CMakeLists.txt b/CMakeLists.txt index 470a23b315..3ea957db0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,13 @@ set(OPENSPACE_EXT_DIR "${OPENSPACE_BASE_DIR}/ext") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${OPENSPACE_EXT_DIR}) +# Make sure abuild type is set. Default is Debug. +if(NOT CMAKE_BUILD_TYPE) + set( CMAKE_BUILD_TYPE Debug CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." + FORCE ) +endif(NOT CMAKE_BUILD_TYPE) + if (APPLE ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++") endif () diff --git a/ext/FindSGCT.cmake b/ext/FindSGCT.cmake index 43cb2cfbaf..fdcffd013f 100644 --- a/ext/FindSGCT.cmake +++ b/ext/FindSGCT.cmake @@ -1,5 +1,4 @@ - # Find the library if(WIN32) @@ -35,6 +34,7 @@ if(WIN32) "${SGCT_WINDOWS_PATHS}" ) + # Find the sgct library set(SGCT_LIBRARY "ws2_32.lib" optimized "${SGCT_ROOT_DIR}/lib/msvc11_x64/sgct.lib" @@ -53,12 +53,19 @@ else() message(FATAL_ERROR "Could not locate SGCT!") endif(NOT SGCT_ROOT_DIR) + # OS X has cpp11 support if (APPLE) set(SGCT_NAME "sgct_cpp11") else(APPLE) set(SGCT_NAME "sgct") endif(APPLE) + + # check if debug or release version of sgct should be used + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(SGCT_NAME "${SGCT_NAME}d") + endif(CMAKE_BUILD_TYPE MATCHES DEBUG) + # Find the sgct library find_library(SGCT_LIBRARY NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}${SGCT_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX} HINTS "${SGCT_ROOT_DIR}/lib") @@ -109,6 +116,7 @@ include_directories(${SGCT_INCLUDE_DIRS}) set(SGCT_INCLUDE_DIRECTORIES ${SGCT_INCLUDES}) set(SGCT_LIBRARIES ${SGCT_LIBRARY} ${SGCT_DEPENDENCIES}) + # handle the QUIETLY and REQUIRED arguments and set SGCT_FOUND to TRUE # if all listed variables are TRUE find_package_handle_standard_args(SGCT DEFAULT_MSG diff --git a/ext/spice b/ext/spice index 1947309fea..5419d02cf0 160000 --- a/ext/spice +++ b/ext/spice @@ -1 +1 @@ -Subproject commit 1947309fea2f2baad3795503fdc8ecbca0575615 +Subproject commit 5419d02cf0918b22dfaa948afc17365d53275c43