]> git.mxchange.org Git - flightgear.git/blob - CMakeModules/ConfigureMsvc3rdParty.cmake
Fixing launcher save/restore of settings.
[flightgear.git] / CMakeModules / ConfigureMsvc3rdParty.cmake
1 # ConfigureMsvc3rdParty.cmake - Configure 3rd Party Library Paths on Windows
2
3 if (MSVC)
4     GET_FILENAME_COMPONENT(PARENT_DIR ${PROJECT_BINARY_DIR} PATH)
5     if (CMAKE_CL_64)
6         SET(TEST_3RDPARTY_DIR "${PARENT_DIR}/3rdparty.x64")
7     else (CMAKE_CL_64)
8         SET(TEST_3RDPARTY_DIR "${PARENT_DIR}/3rdparty")
9     endif (CMAKE_CL_64)
10     if (EXISTS ${TEST_3RDPARTY_DIR})
11         set(MSVC_3RDPARTY_ROOT ${PARENT_DIR} CACHE PATH "Location where the third-party dependencies are extracted")
12     else (EXISTS ${TEST_3RDPARTY_DIR})
13         set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
14     endif (EXISTS ${TEST_3RDPARTY_DIR})
15     list(APPEND PLATFORM_LIBS "winmm.lib")
16 else (MSVC)
17     set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
18 endif (MSVC)
19
20 if (MSVC AND MSVC_3RDPARTY_ROOT)
21     message(STATUS "3rdparty files located in ${MSVC_3RDPARTY_ROOT}")
22     set( OSG_MSVC "msvc" )
23     if (${MSVC_VERSION} EQUAL 1700)
24         set( OSG_MSVC ${OSG_MSVC}110 )
25     elseif (${MSVC_VERSION} EQUAL 1600)
26         set( OSG_MSVC ${OSG_MSVC}100 )
27     else (${MSVC_VERSION} EQUAL 1700)
28         set( OSG_MSVC ${OSG_MSVC}90 )
29     endif (${MSVC_VERSION} EQUAL 1700)
30     if (CMAKE_CL_64)
31         set( OSG_MSVC ${OSG_MSVC}-64 )
32         set( MSVC_3RDPARTY_DIR 3rdParty.x64 )
33                 set( BOOST_LIB lib64 )
34     else (CMAKE_CL_64)
35         set( MSVC_3RDPARTY_DIR 3rdParty )
36                 set( BOOST_LIB lib )
37     endif (CMAKE_CL_64)
38     find_path(FLTK_DIR include/FL/Fl.H
39                         ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/fltk
40                         ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/fltk-1.3
41                         ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}
42                         )
43         list (APPEND CMAKE_PROGRAM_PATH ${FLTK_DIR}/bin)
44
45     set (CMAKE_LIBRARY_PATH ${FLTK_DIR}/lib ${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) )
46     set (CMAKE_INCLUDE_PATH ${FLTK_DIR}/include ${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)
47     find_path(BOOST_ROOT boost/version.hpp
48                         ${MSVC_3RDPARTY_ROOT}/boost
49                         ${MSVC_3RDPARTY_ROOT}/boost_1_52_0
50                         ${MSVC_3RDPARTY_ROOT}/boost_1_51_0
51                         ${MSVC_3RDPARTY_ROOT}/boost_1_50_0
52                         ${MSVC_3RDPARTY_ROOT}/boost_1_49_0
53                         ${MSVC_3RDPARTY_ROOT}/boost_1_48_0
54                         ${MSVC_3RDPARTY_ROOT}/boost_1_47_0
55                         ${MSVC_3RDPARTY_ROOT}/boost_1_46_1
56                         ${MSVC_3RDPARTY_ROOT}/boost_1_46_0
57                         ${MSVC_3RDPARTY_ROOT}/boost_1_45_0
58                         ${MSVC_3RDPARTY_ROOT}/boost_1_44_0
59                         )
60     message(STATUS "BOOST_ROOT is ${BOOST_ROOT}")
61     set (OPENAL_INCLUDE_DIR ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/include)
62     set (OPENAL_LIBRARY_DIR ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib)
63 endif (MSVC AND MSVC_3RDPARTY_ROOT)