2012-08-18 11:40:08 +00:00
|
|
|
# ConfigureMsvc3rdParty.cmake - Configure 3rd Party Library Paths on Windows
|
|
|
|
|
|
|
|
if (MSVC)
|
2013-03-03 16:08:01 +00:00
|
|
|
GET_FILENAME_COMPONENT(PARENT_DIR ${PROJECT_BINARY_DIR} PATH)
|
2012-08-18 11:40:08 +00:00
|
|
|
if (CMAKE_CL_64)
|
|
|
|
SET(TEST_3RDPARTY_DIR "${PARENT_DIR}/3rdparty.x64")
|
|
|
|
else (CMAKE_CL_64)
|
|
|
|
SET(TEST_3RDPARTY_DIR "${PARENT_DIR}/3rdparty")
|
|
|
|
endif (CMAKE_CL_64)
|
|
|
|
if (EXISTS ${TEST_3RDPARTY_DIR})
|
|
|
|
set(MSVC_3RDPARTY_ROOT ${PARENT_DIR} CACHE PATH "Location where the third-party dependencies are extracted")
|
|
|
|
else (EXISTS ${TEST_3RDPARTY_DIR})
|
|
|
|
set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
|
|
|
|
endif (EXISTS ${TEST_3RDPARTY_DIR})
|
2012-12-16 12:52:36 +00:00
|
|
|
list(APPEND PLATFORM_LIBS "winmm.lib")
|
2012-08-18 11:40:08 +00:00
|
|
|
else (MSVC)
|
|
|
|
set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
|
|
|
|
endif (MSVC)
|
|
|
|
|
|
|
|
if (MSVC AND MSVC_3RDPARTY_ROOT)
|
|
|
|
message(STATUS "3rdparty files located in ${MSVC_3RDPARTY_ROOT}")
|
2018-06-23 03:40:37 +00:00
|
|
|
|
|
|
|
string(SUBSTRING ${MSVC_VERSION} 0 2 MSVC_VERSION_MAJOR)
|
|
|
|
string(SUBSTRING ${MSVC_VERSION} 2 2 MSVC_VERSION_MINOR)
|
|
|
|
|
2012-08-18 11:40:08 +00:00
|
|
|
set( OSG_MSVC "msvc" )
|
2018-06-23 03:40:37 +00:00
|
|
|
if (${MSVC_VERSION_MAJOR} EQUAL "19")
|
|
|
|
if (${MSVC_VERSION_MINOR} EQUAL "00")
|
|
|
|
set( OSG_MSVC ${OSG_MSVC}140 )
|
|
|
|
else ()
|
|
|
|
set( OSG_MSVC ${OSG_MSVC}141 )
|
|
|
|
endif ()
|
|
|
|
elseif (${MSVC_VERSION_MAJOR} EQUAL "18")
|
|
|
|
set( OSG_MSVC ${OSG_MSVC}120 )
|
|
|
|
else ()
|
|
|
|
message(FATAL_ERROR "Visual Studio 2013/15/17 is required")
|
|
|
|
endif ()
|
2016-06-09 09:33:30 +00:00
|
|
|
|
2012-08-18 11:40:08 +00:00
|
|
|
if (CMAKE_CL_64)
|
|
|
|
set( OSG_MSVC ${OSG_MSVC}-64 )
|
|
|
|
set( MSVC_3RDPARTY_DIR 3rdParty.x64 )
|
2016-06-09 09:33:30 +00:00
|
|
|
set( BOOST_LIB lib64 )
|
2012-08-18 11:40:08 +00:00
|
|
|
else (CMAKE_CL_64)
|
|
|
|
set( MSVC_3RDPARTY_DIR 3rdParty )
|
2016-06-09 09:33:30 +00:00
|
|
|
set( BOOST_LIB lib )
|
2012-08-18 11:40:08 +00:00
|
|
|
endif (CMAKE_CL_64)
|
|
|
|
|
2016-11-14 23:07:32 +00:00
|
|
|
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 )
|
2016-06-15 21:31:47 +00:00
|
|
|
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)
|
2016-11-14 23:07:32 +00:00
|
|
|
|
|
|
|
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()
|
|
|
|
|
2016-07-06 11:27:14 +00:00
|
|
|
if (USE_AEONWAVE)
|
|
|
|
find_package(AAX COMPONENTS aax REQUIRED)
|
|
|
|
else()
|
|
|
|
set (OPENAL_INCLUDE_DIR ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/include)
|
|
|
|
set (OPENAL_LIBRARY_DIR ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib)
|
|
|
|
endif()
|
2012-08-18 11:40:08 +00:00
|
|
|
endif (MSVC AND MSVC_3RDPARTY_ROOT)
|