Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 2, 2009, 1:27:18 PM (15 years ago)
Author:
rgrieder
Message:

Exported package configuration to the dependencies folder.
LibraryConfig.cmake now includes all PackageConfig*.cmake files in the dependency folder, which then configure the library paths.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem2/cmake/LibraryConfig.cmake

    r2630 r2631  
    2929INCLUDE(FindPackageHandleStandardArgs)
    3030
    31 ################ Misc Options ###################
     31############## Platform Scripts #################
    3232
    33 OPTION(LIBRARY_USE_PACKAGE_IF_SUPPORTED
    34        "When set to false CMake will only look in the standard paths for libraries" ON)
    35 
    36 
    37 ############## Platform Scripts #################
     33# On Windows using a package causes way less problems
     34SET(_option_msg "Set this to true to use precompiled dependecy archives")
     35IF(WIN32)
     36  OPTION(USE_DEPENDENCY_PACKAGE "${_option_msg}" ON)
     37ELSE(WIN32)
     38  OPTION(USE_DEPENDENCY_PACKAGE "${_option_msg}" FALSE)
     39ENDIF(WIN32)
    3840
    3941# Scripts for specific library and CMake config
    4042INCLUDE(LibraryConfigTardis)
    4143INCLUDE(LibraryConfigApple)
    42 INCLUDE(LibraryConfigMSVC)
    43 INCLUDE(LibraryConfigMinGW)
     44
     45IF(USE_DEPENDENCY_PACKAGE)
     46  IF(EXISTS ${CMAKE_SOURCE_DIR}/dependencies/include)
     47    SET(DEPENDENCY_DIR "${CMAKE_SOURCE_DIR}/dependencies" CACHE PATH "")
     48  ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/../dependencies/include)
     49    SET(DEPENDENCY_DIR "${CMAKE_SOURCE_DIR}/../dependencies" CACHE PATH "")
     50  ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/../lib_dist/dependencies/include)
     51    SET(DEPENDENCY_DIR "${CMAKE_SOURCE_DIR}/../lib_dist/dependencies" CACHE PATH "")
     52  ELSE()
     53    MESSAGE(STATUS "Warning: Could not find dependency directory."
     54                   "Disable LIBRARY_USE_PACKAGE if you have none intalled.")
     55  ENDIF()
     56  IF(DEPENDENCY_DIR)
     57    FILE(GLOB _package_config_files dependencies/PackageConfig*.cmake)
     58    FOREACH(_file ${_package_config_files})
     59      INCLUDE(${_file})
     60    ENDFOREACH(_file)
     61  ENDIF()
     62ENDIF(USE_DEPENDENCY_PACKAGE)
    4463
    4564# User script
Note: See TracChangeset for help on using the changeset viewer.