1
0
Fork 0

WIN32/MSVC fixes from Olaf Flebbe

This commit is contained in:
James Turner 2010-12-27 12:44:17 +00:00
parent 86505fd8bc
commit 2b5f50e856
4 changed files with 92 additions and 69 deletions

View file

@ -59,7 +59,17 @@ else(EVENT_INPUT)
endif(EVENT_INPUT)
# check required dependencies
if (MSVC)
# on MSVC, Olaf reports that the serialization library is required at
# link time. No one has you explained why, unfortunately.
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost REQUIRED COMPONENTS serialization)
else (MSVC)
find_package(Boost REQUIRED)
endif (MSVC)
find_package(ZLIB REQUIRED)
find_package(Threads REQUIRED)
find_package(OpenGL REQUIRED)
@ -130,8 +140,8 @@ if(WIN32)
set(NOMINMAX 1)
endif(WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS} -D_REENTRANT")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS} -D_REENTRANT")
include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}

View file

@ -82,9 +82,16 @@ macro(find_sg_component comp libs)
endif()
endmacro()
if(${SIMGEAR_LIBRARIES} STREQUAL "SIMGEAR_LIBRARIES-NOTFOUND")
set(SIMGEAR_LIBRARIES "") # clear value
if(NOT MSVC)
# Olaf indicates that linking the threads libs causes failures
# on MSVC builds
set(thread_lib threads)
endif(NOT MSVC)
# note the order here affects the order Simgear libraries are
# linked in, and hence ability to link when using a traditional
# linker such as GNU ld on Linux
@ -100,7 +107,7 @@ if(${SIMGEAR_LIBRARIES} STREQUAL "SIMGEAR_LIBRARIES-NOTFOUND")
bvh
util route
timing
threads
${thread_lib}
io
serial
sound

View file

@ -28,7 +28,12 @@ set(FGJS_SOURCES
add_executable(fgjs ${FGJS_SOURCES})
if(WIN32)
set(SOCKETS_LIBRARY wsock32.lib)
endif(WIN32)
target_link_libraries(fgjs
${SOCKETS_LIBRARY}
${SIMGEAR_LIBRARIES}
${PLIB_LIBRARIES}
${ZLIB_LIBRARY})

View file

@ -39,6 +39,7 @@ target_link_libraries(fgfs
${ALUT_LIBRARY}
${ZLIB_LIBRARIES}
${PLIB_LIBRARIES}
${RT_LIBRARY})
${RT_LIBRARY}
${Boost_SERIALIZATION_LIBRARY})
install(TARGETS fgfs RUNTIME DESTINATION bin)