X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=CMakeModules%2FFindSimGear.cmake;h=56f230a881c61681a329ab45e60ba32d1293961e;hb=4d4e1a237165768e9abcf98a4251a9cefacb5093;hp=5c21f5716e69df9d1d993652f4ab2cf0d15f4042;hpb=7a0db802d2e1539ef6c3b01c22c3911a0d7d4746;p=flightgear.git diff --git a/CMakeModules/FindSimGear.cmake b/CMakeModules/FindSimGear.cmake index 5c21f5716..56f230a88 100644 --- a/CMakeModules/FindSimGear.cmake +++ b/CMakeModules/FindSimGear.cmake @@ -38,18 +38,14 @@ macro(find_sg_library libName varName libs) HINTS $ENV{SIMGEAR_DIR} PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR} libs64 libs libs/Win32 libs/Win64 PATHS - /usr/local - /usr - /opt + ${ADDITIONAL_LIBRARY_PATHS} ) FIND_LIBRARY(${libVarName}_RELEASE NAMES ${libName}${CMAKE_RELEASE_POSTFIX} HINTS $ENV{SIMGEAR_DIR} PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR} libs64 libs libs/Win32 libs/Win64 PATHS - /usr/local - /usr - /opt + ${ADDITIONAL_LIBRARY_PATHS} ) # message(STATUS "before: Simgear ${${libVarName}_RELEASE} ") @@ -75,22 +71,11 @@ macro(find_sg_library libName varName libs) endif() endmacro() -macro(find_sg_component comp libs) - set(compLib "sg${comp}") - string(TOUPPER "SIMGEAR_${comp}" libVar) - - find_sg_library(${compLib} ${libVar} ${libs}) -endmacro() - FIND_PATH(SIMGEAR_INCLUDE_DIR simgear/math/SGMath.hxx HINTS $ENV{SIMGEAR_DIR} PATH_SUFFIXES include PATHS - ~/Library/Frameworks - /Library/Frameworks - /usr/local - /usr - /opt + ${ADDITIONAL_LIBRARY_PATHS} ) # make sure the simgear include directory exists @@ -139,7 +124,6 @@ if(SIMGEAR_SHARED) find_sg_library(SimGearCore SIMGEAR_CORE SIMGEAR_CORE_LIBRARIES) find_sg_library(SimGearScene SIMGEAR_SCENE SIMGEAR_LIBRARIES) - list(APPEND SIMGEAR_LIBRARIES ${SIMGEAR_CORE_LIBRARIES}) set(SIMGEAR_CORE_LIBRARY_DEPENDENCIES "") @@ -153,60 +137,25 @@ else(SIMGEAR_SHARED) set(SIMGEAR_CORE_LIBRARIES "") # clear value message(STATUS "looking for static SimGear libraries") - # 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 - set(comps - environment - nasal - tsync - bvh - bucket - io - serial - math - props - structure - timing - xml - misc - threads - debug - magvar - ) - - set(scene_comps - ephem - sky - material - tgdb - model - screen - util - sound) - - foreach(component ${comps}) - find_sg_component(${component} SIMGEAR_CORE_LIBRARIES) - endforeach() - - foreach(component ${scene_comps}) - find_sg_component(${component} SIMGEAR_LIBRARIES) - endforeach() + find_sg_library(SimGearCore SIMGEAR_CORE SIMGEAR_CORE_LIBRARIES) + find_sg_library(SimGearScene SIMGEAR_SCENE SIMGEAR_LIBRARIES) # again link order matters - scene libraries depend on core ones list(APPEND SIMGEAR_LIBRARIES ${SIMGEAR_CORE_LIBRARIES}) - - #message(STATUS "all libs ${SIMGEAR_LIBRARIES}") set(SIMGEAR_CORE_LIBRARY_DEPENDENCIES ${CMAKE_THREAD_LIBS_INIT} ${ZLIB_LIBRARY} - ${LIBSVN_LIBRARIES} ${WINMM_LIBRARY}) set(SIMGEAR_SCENE_LIBRARY_DEPENDENCIES ${OPENAL_LIBRARY}) + if(APPLE) + find_library(COCOA_LIBRARY Cocoa) + list(APPEND SIMGEAR_CORE_LIBRARY_DEPENDENCIES ${COCOA_LIBRARY}) + endif() + if(WIN32) list(APPEND SIMGEAR_CORE_LIBRARY_DEPENDENCIES ws2_32.lib) endif(WIN32) @@ -220,7 +169,7 @@ else(SIMGEAR_SHARED) endif(NOT MSVC) endif(SIMGEAR_SHARED) -if((NOT SIMGEAR_CORE_LIBRARIES)OR(NOT SIMGEAR_LIBRARIES)) +if((NOT SIMGEAR_CORE_LIBRARIES) OR (NOT SIMGEAR_LIBRARIES)) message(FATAL_ERROR "Cannot find SimGear libraries! (Forgot 'make install' for SimGear?) " "Compile & INSTALL SimGear before configuring FlightGear. " "When using non-standard locations, use 'SIMGEAR_DIR' to configure the SimGear location.")