From 5d7b65477f326056ad5b7aea83ed57e3e10b0797 Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 15 Nov 2016 00:07:32 +0100 Subject: [PATCH] Simplify MSVC detection to match SimGear. --- CMakeLists.txt | 2 +- CMakeModules/ConfigureMsvc3rdParty.cmake | 34 +++++++++--------------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a440f6316..00df2a853 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -232,7 +232,7 @@ else(EVENT_INPUT) endif(EVENT_INPUT) # check required dependencies -find_package(Boost REQUIRED) +find_package(Boost REQUIRED) find_package(OpenGL REQUIRED) find_package(OpenSceneGraph 3.2.0 REQUIRED osgText diff --git a/CMakeModules/ConfigureMsvc3rdParty.cmake b/CMakeModules/ConfigureMsvc3rdParty.cmake index 9bf10ada2..dd06badec 100644 --- a/CMakeModules/ConfigureMsvc3rdParty.cmake +++ b/CMakeModules/ConfigureMsvc3rdParty.cmake @@ -24,10 +24,8 @@ if (MSVC AND MSVC_3RDPARTY_ROOT) set( OSG_MSVC ${OSG_MSVC}140 ) elseif (${MSVC_VERSION} EQUAL 1800) set( OSG_MSVC ${OSG_MSVC}120 ) - elseif (${MSVC_VERSION} EQUAL 1700) - set( OSG_MSVC ${OSG_MSVC}110 ) - elseif (${MSVC_VERSION} EQUAL 1600) - set( OSG_MSVC ${OSG_MSVC}100 ) + else () + message(FATAL_ERROR "Visual Studio 2013/2015 is required now") endif () if (CMAKE_CL_64) @@ -39,24 +37,18 @@ if (MSVC AND MSVC_3RDPARTY_ROOT) set( BOOST_LIB lib ) endif (CMAKE_CL_64) - GET_FILENAME_COMPONENT(MSVC_ROOT_PARENT_DIR ${MSVC_3RDPARTY_ROOT} PATH) - set (CMAKE_LIBRARY_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenScenegraph/lib ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenRTI/lib ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/SimGear/lib $(BOOST_ROOT)/$(BOOST_LIB) ) + set (CMAKE_LIBRARY_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenScenegraph/lib ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenRTI/lib ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/SimGear/lib ) set (CMAKE_INCLUDE_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/include ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenScenegraph/include ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenRTI/include ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/SimGear/include) - find_path(BOOST_ROOT boost/version.hpp - ${MSVC_ROOT_PARENT_DIR} - ${MSVC_3RDPARTY_ROOT}/boost - ${MSVC_3RDPARTY_ROOT}/boost_1_52_0 - ${MSVC_3RDPARTY_ROOT}/boost_1_51_0 - ${MSVC_3RDPARTY_ROOT}/boost_1_50_0 - ${MSVC_3RDPARTY_ROOT}/boost_1_49_0 - ${MSVC_3RDPARTY_ROOT}/boost_1_48_0 - ${MSVC_3RDPARTY_ROOT}/boost_1_47_0 - ${MSVC_3RDPARTY_ROOT}/boost_1_46_1 - ${MSVC_3RDPARTY_ROOT}/boost_1_46_0 - ${MSVC_3RDPARTY_ROOT}/boost_1_45_0 - ${MSVC_3RDPARTY_ROOT}/boost_1_44_0 - ) - message(STATUS "BOOST_ROOT is ${BOOST_ROOT}") + + if(NOT BOOST_INCLUDEDIR) + # if this variable was not set by the user, set it to 3rdparty root's + # parent dir, which is the normal location for people using our + # windows-3rd-party repo + GET_FILENAME_COMPONENT(MSVC_ROOT_PARENT_DIR ${MSVC_3RDPARTY_ROOT} PATH) + set(BOOST_INCLUDEDIR ${MSVC_ROOT_PARENT_DIR}) + message(STATUS "BOOST_INCLUDEDIR is ${BOOST_INCLUDEDIR}") + endif() + if (USE_AEONWAVE) find_package(AAX COMPONENTS aax REQUIRED) else()