Changeset 95932c1566de36c6fbcee2ee1f4db6d5a476a2b0

Show
Ignore:
Timestamp:
02/25/08 23:15:52 (7 months ago)
Author:
Faustino Osuna <riquedafreak@videolan.org>
git-committer:
Faustino Osuna <riquedafreak@videolan.org> 1203977752 +0000
git-parent:

[ac2e4b777eefca1556904e35541cebd4287cf370]

git-author:
Faustino Osuna <riquedafreak@videolan.org> 1203977752 +0000
Message:

cmake: Code clean up, set up options before we start including custom macros, add CONTRIB_INCLDE to CMAKE_REQUIRED_INCLUDES if ENABLE_CONTRIB is set, and correctly discover postproc/postprocess.h header by temporarily adding FFmpeg_CFLAGS to CMAKE_REQUIRED_FLAGS before checking for the header.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • extras/buildsystem/cmake/include/config.cmake

    r260a183 r95932c1  
     1########################################################### 
     2# System Includes 
     3########################################################### 
    14include( CheckIncludeFile ) 
    25include (CheckTypeSize) 
     
    58include (CheckLibraryExists) 
    69 
     10########################################################### 
     11# Options 
     12########################################################### 
     13# Options moved before the custom macro includes because those macros need path values, if the ENABLE_CONTRIB 
     14# has been set. 
     15 
     16OPTION( ENABLE_HTTPD           "Enable httpd server" ON ) 
     17OPTION( ENABLE_VLM             "Enable vlm" ON ) 
     18OPTION( ENABLE_DYNAMIC_PLUGINS "Enable dynamic plugin" ON ) 
     19OPTION( UPDATE_CHECK           "Enable automatic new version checking" OFF ) 
     20OPTION( ENABLE_NO_SYMBOL_CHECK "Don't check symbols of modules against libvlc. (Enabling this option speeds up compilation)" OFF ) 
     21OPTION( ENABLE_CONTRIB         "Attempt to use VLC contrib system to get the third-party libraries" ON ) 
     22 
     23if(ENABLE_CONTRIB) 
     24 
     25  set( CONTRIB_INCLUDE ${CMAKE_SOURCE_DIR}/extras/contrib/include) 
     26  set( CONTRIB_LIB ${CMAKE_SOURCE_DIR}/extras/contrib/lib) 
     27  set( CONTRIB_PROGRAM ${CMAKE_SOURCE_DIR}/extras/contrib/bin) 
     28  set( CMAKE_LIBRARY_PATH ${CONTRIB_LIB} ${CMAKE_LIBRARY_PATH} ) 
     29  set( CMAKE_PROGRAM_PATH ${CONTRIB_PROGRAM} ${CMAKE_PROGRAM_PATH} ) 
     30  set( CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -L${CONTRIB_LIB}" ) 
     31  set( CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -L${CONTRIB_LIB}" ) 
     32  set( CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -L${CONTRIB_LIB}" ) 
     33  set( CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS} -L${CONTRIB_LIB}" ) 
     34  set( CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -L${CONTRIB_LIB}" ) 
     35  set( CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -L${CONTRIB_LIB}" ) 
     36 
     37  # include extras/contrib/include in the header search pathes 
     38  include_directories(${CONTRIB_INCLUDE}) 
     39  set( CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${CONTRIB_INCLUDE} ) 
     40   
     41  # include the extras/contrib/bin to the search path, otherwise, when finding programs it will automatically 
     42  # default to system applications (e.g. we should favor the extras/contrib/bin/pkg-config over the system defined 
     43  # one). 
     44  if(WIN32) 
     45    set( ENV{PATH} "${CONTRIB_PROGRAM};$ENV{PATH}" ) 
     46  else(WIN32) 
     47    set( ENV{PATH} "${CONTRIB_PROGRAM}:$ENV{PATH}" ) 
     48  endif(WIN32) 
     49endif(ENABLE_CONTRIB) 
     50 
     51########################################################### 
     52# Custom Macro Includes 
     53########################################################### 
     54 
    755include( ${CMAKE_SOURCE_DIR}/cmake/vlc_check_include_files.cmake ) 
    856include( ${CMAKE_SOURCE_DIR}/cmake/vlc_check_functions_exist.cmake ) 
     
    1260 
    1361########################################################### 
    14 # VERSION 
     62# Versioning 
    1563########################################################### 
    1664 
     
    3381 
    3482########################################################### 
    35 # Options 
    36 ########################################################### 
    37  
    38 OPTION( ENABLE_HTTPD           "Enable httpd server" ON ) 
    39 OPTION( ENABLE_VLM             "Enable vlm" ON ) 
    40 OPTION( ENABLE_DYNAMIC_PLUGINS "Enable dynamic plugin" ON ) 
    41 OPTION( UPDATE_CHECK           "Enable automatic new version checking" OFF ) 
    42 OPTION( ENABLE_NO_SYMBOL_CHECK "Don't check symbols of modules against libvlc. (Enabling this option speeds up compilation)" OFF ) 
     83# Preflight Checks 
     84########################################################### 
    4385 
    4486IF (NOT CMAKE_BUILD_TYPE) 
     
    84126# Functions/structures checks 
    85127########################################################### 
     128 
    86129set(CMAKE_REQUIRED_LIBRARIES c) 
    87130set(CMAKE_EXTRA_INCLUDE_FILES string.h) 
     
    202245# Other check 
    203246########################################################### 
     247 
    204248include( ${CMAKE_SOURCE_DIR}/cmake/vlc_test_inline.cmake ) 
    205249 
     
    207251# Platform check 
    208252########################################################### 
     253 
    209254if(APPLE) 
    210255    include( ${CMAKE_SOURCE_DIR}/cmake/vlc_find_frameworks.cmake ) 
     
    320365set( VLC_COMPILER "${CMAKE_C_COMPILER}" ) 
    321366 
    322  
    323367########################################################### 
    324368# Modules: Following are all listed in options 
     
    370414# libraries 
    371415########################################################### 
    372 OPTION( ENABLE_CONTRIB "Attempt to use VLC contrib system to get the third-party libraries" ON ) 
    373 if(ENABLE_CONTRIB) 
    374   set( CONTRIB_INCLUDE ${CMAKE_SOURCE_DIR}/extras/contrib/include) 
    375   set( CONTRIB_LIB ${CMAKE_SOURCE_DIR}/extras/contrib/lib) 
    376   set( CONTRIB_PROGRAM ${CMAKE_SOURCE_DIR}/extras/contrib/bin) 
    377   set( CMAKE_LIBRARY_PATH ${CONTRIB_LIB} ${CMAKE_LIBRARY_PATH} ) 
    378   set( CMAKE_PROGRAM_PATH ${CONTRIB_PROGRAM} ${CMAKE_PROGRAM_PATH} ) 
    379   set( CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -L${CONTRIB_LIB}" ) 
    380   set( CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -L${CONTRIB_LIB}" ) 
    381   set( CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -L${CONTRIB_LIB}" ) 
    382   set( CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS} -L${CONTRIB_LIB}" ) 
    383   set( CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -L${CONTRIB_LIB}" ) 
    384   set( CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -L${CONTRIB_LIB}" ) 
    385   add_definitions(-I${CONTRIB_INCLUDE}) 
    386 endif(ENABLE_CONTRIB) 
    387  
    388 set(CMAKE_REQUIRED_INCLUDES ${CONTRIB_INCLUDE}) 
     416 
     417include_directories(${CONTRIB_INCLUDE}) 
    389418 
    390419#fixme: use find_package(cddb 0.9.5) 
     
    418447find_package(FFmpeg) 
    419448if(FFmpeg_FOUND) 
     449  set( CMAKE_REQUIRED_FLAGS_saved ${CMAKE_REQUIRED_FLAGS} ) 
     450  set( CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FFmpeg_CFLAGS}" ) 
     451   
     452  #set( CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${CONTRIB_INCLUDE}/ffmpeg ) 
     453   
    420454  vlc_check_include_files (ffmpeg/avcodec.h) 
    421455  vlc_check_include_files (ffmpeg/avutil.h) 
     
    425459  vlc_add_module_compile_flag(ffmpeg ${FFmpeg_CFLAGS} ) 
    426460  vlc_module_add_link_libraries(ffmpeg ${FFmpeg_LIBRARIES}) 
     461   
     462  set( CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_saved} ) 
     463  set( CMAKE_REQUIRED_FLAGS_saved ) 
    427464endif(FFmpeg_FOUND) 
    428465 
     
    530567if(Dvbpsi_FOUND) 
    531568  vlc_enable_modules(ts) 
    532   set(CMAKE_REQUIRED_INCLUDES ${CONTRIB_INCLUDE}) 
    533569  check_include_files ("stdint.h;dvbpsi/dvbpsi.h;dvbpsi/demux.h;dvbpsi/descriptor.h;dvbpsi/pat.h;dvbpsi/pmt.h;dvbpsi/sdt.h;dvbpsi/dr.h" HAVE_DVBPSI_DR_H) 
    534570  vlc_module_add_link_libraries(ts ${Dvbpsi_LIBRARIES}) 
    535571endif(Dvbpsi_FOUND) 
    536572 
    537  
    538  
    539573set(CMAKE_REQUIRED_INCLUDES) 
    540574 
     
    542576# Final configuration 
    543577########################################################### 
     578 
    544579configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/include/config.h)