Changeset 9908

Show
Ignore:
Timestamp:
03/11/09 15:08:43 (6 years ago)
Author:
robert
Message:

From Philip Lowman, "At a cost of bumping the required version to CMake 2.4.4 (released all the way back on November 21, 2006)... this cmake script patch

1. Makes IF/ELSE/ENDIF code blocks easier to read by replacing code like this:

IF(FOO)

MESSAGE("FOO is true")

ELSE(FOO)

MESSAGE(" ??? ELSE(FOO)??? ")

ENDIF(FOO)

with this:

IF(FOO)

MESSAGE("FOO is true")

ELSE()

MESSAGE("FOO is clearly false")

ENDIF()

2. Also adds an ELSEIF() where it makes sense to do so (safe to use as of CMake 2.4.4)"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/CMakeLists.txt

    r9867 r9908  
     1set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE) 
     2 
    13IF(WIN32) 
    24    CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR) 
     
    57        CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR) 
    68    ELSE(APPLE) 
    7         CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0 FATAL_ERROR) 
     9        CMAKE_MINIMUM_REQUIRED(VERSION 2.4.4 FATAL_ERROR) 
    810    ENDIF(APPLE) 
    911ENDIF(WIN32) 
     
    2224    if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND ${CMAKE_PATCH_VERSION} GREATER 0) 
    2325        cmake_policy(SET CMP0008 OLD) 
    24     endif(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND ${CMAKE_PATCH_VERSION} GREATER 0) 
    25 endif(COMMAND cmake_policy) 
     26    endif() 
     27endif() 
    2628 
    2729PROJECT(OpenSceneGraph) 
     
    4446IF (CYGWIN) 
    4547    SET(OSG_PLUGIN_PREFIX "cygwin_") 
    46 ENDIF(CYGWIN) 
     48ENDIF() 
    4749 
    4850IF(MINGW) 
    4951    SET(OSG_PLUGIN_PREFIX "mingw_") 
    50 ENDIF(MINGW) 
     52ENDIF() 
    5153 
    5254 
     
    7779    # Erase CMAKE_THREAD_LIBS_INIT and hope it works 
    7880    SET(CMAKE_THREAD_LIBS_INIT "" CACHE INTERNAL "") 
    79 ENDIF(CMAKE_SYSTEM MATCHES IRIX) 
     81ENDIF() 
    8082 
    8183OPTION(OSG_MAINTAINER "Enable OpenSceneGraph maintainer build methods, such as making svn branches, tags, updating ChangeLog." OFF) 
     
    9698    IF   (OPENSCENEGRAPH_SVN STREQUAL "trunk") 
    9799        SET(SVNSOURCEDIR ${SVNTRUNKDIR}) 
    98     ELSE (OPENSCENEGRAPH_SVN STREQUAL "trunk") 
     100    ELSE() 
    99101        SET(SVNSOURCEDIR ${SVNBRANCHDIR}/${OPENSCENEGRAPH_BRANCH}) 
    100     ENDIF(OPENSCENEGRAPH_SVN STREQUAL "trunk") 
     102    ENDIF() 
    101103 
    102104 
    103105    IF   (OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0) 
    104106        SET(RELEASE_NAME OpenSceneGraph-${OPENSCENEGRAPH_VERSION}) 
    105     ELSE (OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0) 
     107    ELSE() 
    106108        SET(RELEASE_NAME OpenSceneGraph-${OPENSCENEGRAPH_VERSION}-rc${OPENSCENEGRAPH_RELEASE_CANDIDATE}) 
    107     ENDIF(OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0) 
     109    ENDIF() 
    108110 
    109111 
     
    143145    FIND_LIBRARY(CARBON_LIBRARY Carbon) 
    144146    FIND_LIBRARY(COCOA_LIBRARY Cocoa) 
    145 ENDIF(APPLE) 
     147ENDIF() 
    146148 
    147149IF(UNIX) 
     
    151153    # Some Unicies need explicit linkage to the Math library or the build fails. 
    152154    FIND_LIBRARY(MATH_LIBRARY m) 
    153 ENDIF(UNIX) 
     155ENDIF() 
    154156 
    155157# Make the headers visible to everything 
    156158IF(NOT ${PROJECT_BINARY_DIR} EQUAL ${PROJECT_SOURCE_DIR}) 
    157159   INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include) 
    158 ENDIF(NOT ${PROJECT_BINARY_DIR} EQUAL ${PROJECT_SOURCE_DIR}) 
     160ENDIF() 
    159161 
    160162INCLUDE_DIRECTORIES( 
     
    186188        ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS) 
    187189        ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) 
    188     ENDIF(MSVC) 
     190    ENDIF() 
    189191 
    190192    #needed for net plugin 
     
    193195    IF(UNIX) 
    194196        ADD_DEFINITIONS(-DNOMINMAX) 
    195     ENDIF(UNIX) 
     197    ENDIF() 
     198 
    196199######################################################################################################## 
    197200# the following options are MSVC specific, 
     
    210213            SET(OSG_MSVC_VERSIONED_DLL OFF) 
    211214            SET(OSG_MSVC_DEBUG_INCREMENTAL_LINK ON) 
    212         ELSE(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4 AND ${CMAKE_PATCH_VERSION} LESS 7) 
     215        ELSE() 
    213216            OPTION(OSG_MSVC_VERSIONED_DLL "Set to ON to build OpenSceneGraph with versioned dll names" ON) 
    214217            MARK_AS_ADVANCED(OSG_MSVC_VERSIONED_DLL) 
     
    220223                SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "/debug /INCREMENTAL:NO") 
    221224            ENDIF(NOT OSG_MSVC_DEBUG_INCREMENTAL_LINK) 
    222         ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4 AND ${CMAKE_PATCH_VERSION} LESS 7) 
     225        ENDIF() 
    223226    ENDIF(MSVC) 
    224227ENDIF(WIN32) 
     
    279282    CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/PlatformSpecifics/Windows/OpenSceneGraphVersionInfo.rc.in" 
    280283                   "${OPENSCENEGRAPH_VERSIONINFO_RC}") 
    281 ENDIF(MSVC) 
     284ENDIF() 
    282285 
    283286################################################################################ 
     
    294297IF(WIN32) 
    295298    INCLUDE(Find3rdPartyDependencies) 
    296 ENDIF(WIN32) 
     299ENDIF() 
    297300 
    298301# Common to all platforms: 
     
    326329    IF(WIN32) 
    327330        PKG_CHECK_MODULES(GTKGL gtkglext-win32-1.0) 
    328     ELSE(WIN32) 
     331    ELSE() 
    329332        PKG_CHECK_MODULES(GTKGL gtkglext-x11-1.0) 
    330     ENDIF(WIN32) 
     333    ENDIF() 
    331334 
    332335    PKG_CHECK_MODULES(RSVG librsvg-2.0) 
     
    334337    PKG_CHECK_MODULES(POPPLER poppler-glib) 
    335338 
    336 ENDIF(PKG_CONFIG_FOUND) 
     339ENDIF() 
    337340 
    338341#optional example related dependencies 
     
    354357        IF  (DESIRED_QT_VERSION MATCHES 4) 
    355358          FIND_PACKAGE(Qt4) 
    356         ELSE(DESIRED_QT_VERSION MATCHES 4) 
     359        ELSE() 
    357360          FIND_PACKAGE(Qt3) 
    358         ENDIF(DESIRED_QT_VERSION MATCHES 4) 
    359  
    360     ELSE(DESIRED_QT_VERSION) 
     361        ENDIF() 
     362 
     363    ELSE() 
    361364 
    362365        FIND_PACKAGE(Qt4) 
     
    364367        IF  (NOT QT4_FOUND) 
    365368            FIND_PACKAGE(Qt3) 
    366         ENDIF(NOT QT4_FOUND) 
    367  
    368     ENDIF(DESIRED_QT_VERSION) 
     369        ENDIF() 
     370 
     371    ENDIF() 
    369372 
    370373ENDIF(BUILD_OSG_EXAMPLES) 
     
    385388        SET(DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT false) 
    386389 
    387     ELSE(WIN32 OR CMAKE_SYSTEM_NAME MATCHES "Linux") 
     390    ELSE() 
    388391 
    389392        # For other platforms perform the check 
     
    405408            ${GLU_Tesselator_Needs_Variable_Parameter_Callback_Convention_Failure_Means_No}) 
    406409 
    407     ENDIF(WIN32 OR CMAKE_SYSTEM_NAME MATCHES "Linux") 
    408 ENDIF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT) 
     410    ENDIF() 
     411ENDIF() 
    409412 
    410413OPTION(OSG_GLU_TESS_CALLBACK_TRIPLEDOT "Set to ON to build with variable parameter (...) version of GLU tesselator callback" ${DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT}) 
     
    436439    IF(WIN32) 
    437440        FIND_PACKAGE(QuickTime) 
    438     ENDIF(WIN32) 
    439  
    440 ELSE(NOT APPLE) 
     441    ENDIF() 
     442 
     443ELSE() 
    441444    FIND_PACKAGE(QuickTime) 
    442 ENDIF(NOT APPLE) 
     445ENDIF() 
    443446 
    444447################################################################################ 
     
    447450IF("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") 
    448451   FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin ${CMAKE_BINARY_DIR}/lib ${CMAKE_BINARY_DIR}/lib/${OSG_PLUGINS}) 
    449 ENDIF("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") 
     452ENDIF() 
    450453 
    451454 
     
    459462  IF(CMAKE_BUILD_TYPE STREQUAL "Debug") 
    460463    ADD_DEFINITIONS("-D_DEBUG") 
    461   ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug") 
    462 ENDIF(UNIX AND NOT WIN32) 
     464  ENDIF() 
     465ENDIF() 
    463466 
    464467IF(CYGWIN) 
    465468  IF(CMAKE_BUILD_TYPE STREQUAL "Debug") 
    466469    ADD_DEFINITIONS("-D_DEBUG") 
    467   ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug") 
    468 ENDIF(CYGWIN) 
     470  ENDIF() 
     471ENDIF() 
    469472 
    470473IF(UNIX AND NOT WIN32 AND NOT APPLE) 
     
    472475      SET(LIB_POSTFIX "64" CACHE STRING "suffix for 32/64 dir placement") 
    473476      MARK_AS_ADVANCED(LIB_POSTFIX) 
    474   ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "8") 
    475 ENDIF(UNIX AND NOT WIN32 AND NOT APPLE) 
     477  ENDIF() 
     478ENDIF() 
    476479IF(NOT DEFINED LIB_POSTFIX) 
    477480    SET(LIB_POSTFIX "") 
    478 ENDIF(NOT DEFINED LIB_POSTFIX) 
     481ENDIF() 
    479482 
    480483# Here we apparantly do some funky stuff with making the bin/ and lib/ 
     
    501504# CMAKE_ARCHIVE_OUTPUT_DIRECTORY & CMAKE_RUNTIME_OUTPUT_DIRECTORY 
    502505 
    503 IF(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 4) 
     506IF(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 5) 
     507    SET(EXECUTABLE_OUTPUT_PATH ${OUTPUT_BINDIR}) 
     508    SET(LIBRARY_OUTPUT_PATH    ${OUTPUT_LIBDIR}) 
     509ELSE() 
    504510    # If CMake >= 2.6.0 
    505511    SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR}) 
     
    510516        SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR}) 
    511517    ENDIF(WIN32) 
    512 ELSE(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 4) 
    513     SET(EXECUTABLE_OUTPUT_PATH ${OUTPUT_BINDIR}) 
    514     SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR}) 
    515 ENDIF(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 4) 
     518ENDIF() 
    516519 
    517520#SET(INSTALL_BINDIR OpenSceneGraph/bin) 
     
    563566 
    564567 
    565 ELSE(CMAKE_COMPILER_IS_GNUCXX) 
     568ELSE() 
    566569    IF(MSVC) 
    567570        # FIXME: What are good aggressive warning flags for Visual Studio? 
     
    571574 
    572575 
    573     ELSE(MSVC) 
     576    ELSE() 
    574577        # CMake lacks an elseif, so other non-gcc, non-VS compilers need 
    575578        # to be listed below. If unhandled, OSG_AGGRESSIVE_WARNING_FLAGS should 
    576579        # remain unset. 
    577     ENDIF(MSVC) 
    578 ENDIF(CMAKE_COMPILER_IS_GNUCXX) 
     580    ENDIF() 
     581ENDIF() 
    579582 
    580583# This part is for the CMake menu option to toggle the warnings on/off. 
     
    584587    IF (APPLE) 
    585588        SET(DEFAULT_USE_AGGRESSIVE_WARNINGS OFF) 
    586     ELSE(APPLE) 
     589    ELSE() 
    587590        SET(DEFAULT_USE_AGGRESSIVE_WARNINGS ON) 
    588     ENDIF(APPLE) 
     591    ENDIF() 
    589592 
    590593    OPTION(OSG_USE_AGGRESSIVE_WARNINGS "Enable to activate aggressive warnings" ${DEFAULT_USE_AGGRESSIVE_WARNINGS}) 
     
    596599            IF(NOT CMAKE_CXX_FLAGS MATCHES "${flag}") 
    597600                SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") 
    598             ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "${flag}") 
    599         ENDFOREACH(flag) 
    600     ELSE(OSG_USE_AGGRESSIVE_WARNINGS) 
     601            ENDIF() 
     602        ENDFOREACH() 
     603    ELSE() 
    601604        # Remove all flags considered aggresive 
    602605        FOREACH(flag ${OSG_AGGRESSIVE_WARNING_FLAGS}) 
    603606            STRING(REGEX REPLACE "${flag}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") 
    604         ENDFOREACH(flag) 
    605     ENDIF(OSG_USE_AGGRESSIVE_WARNINGS) 
    606 ENDIF(OSG_AGGRESSIVE_WARNING_FLAGS) 
     607        ENDFOREACH() 
     608    ENDIF() 
     609ENDIF() 
    607610 
    608611 
     
    611614IF   (DYNAMIC_OPENSCENEGRAPH) 
    612615    SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "SHARED") 
    613 ELSE (DYNAMIC_OPENSCENEGRAPH) 
     616ELSE () 
    614617    SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC") 
    615 ENDIF(DYNAMIC_OPENSCENEGRAPH) 
     618ENDIF() 
    616619 
    617620INCLUDE(OsgMacroUtils) 
     
    621624IF   (BUILD_OSG_APPLICATIONS) 
    622625    ADD_SUBDIRECTORY(applications) 
    623 ENDIF(BUILD_OSG_APPLICATIONS) 
     626ENDIF() 
    624627 
    625628IF   (BUILD_OSG_EXAMPLES) 
    626629    ADD_SUBDIRECTORY(examples) 
    627 ENDIF(BUILD_OSG_EXAMPLES) 
     630ENDIF() 
    628631 
    629632 
     
    649652            SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE) 
    650653            SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE) 
    651         ELSE(EXISTS /Developer/SDKs/MacOSX10.5.sdk) 
    652             IF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk) 
    653                 SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE) 
    654                 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.4 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE) 
    655             ELSE(EXISTS /Developer/SDKs/MacOSX10.4u.sdk) 
    656                 # No Universal Binary support 
    657                 # Should break down further to set the -mmacosx-version-min, 
    658                 # but the SDK detection is too unreliable here. 
    659             ENDIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk) 
    660         ENDIF(EXISTS /Developer/SDKs/MacOSX10.5.sdk) 
     654        ELSEIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk) 
     655            SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE) 
     656            SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.4 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE) 
     657        ELSE() 
     658            # No Universal Binary support 
     659            # Should break down further to set the -mmacosx-version-min, 
     660            # but the SDK detection is too unreliable here. 
     661        ENDIF() 
    661662    ENDIF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE) 
    662663 
     
    687688    IF(BUILD_REF_DOCS_SEARCHENGINE) 
    688689        SET(SEARCHENGINE YES) 
    689     ELSE(BUILD_REF_DOCS_SEARCHENGINE) 
     690    ELSE() 
    690691        SET(SEARCHENGINE NO) 
    691     ENDIF(BUILD_REF_DOCS_SEARCHENGINE) 
     692    ENDIF() 
    692693 
    693694    OPTION(BUILD_REF_DOCS_TAGFILE "Generate a tag file named osg.tag on the documentation web server" OFF) 
    694695    IF(BUILD_REF_DOCS_TAGFILE) 
    695696        SET(GENERATE_TAGFILE "${OpenSceneGraph_BINARY_DIR}/doc/OpenSceneGraphReferenceDocs/osg.tag") 
    696     ELSE(BUILD_REF_DOCS_TAGFILE) 
     697    ELSE() 
    697698        SET(GENERATE_TAGFILE "") 
    698     ENDIF(BUILD_REF_DOCS_TAGFILE) 
     699    ENDIF() 
    699700 
    700701    IF(DOT) 
    701702        SET(HAVE_DOT YES) 
    702     ELSE(DOT) 
     703    ELSE() 
    703704        SET(HAVE_DOT NO) 
    704     ENDIF(DOT) 
     705    ENDIF() 
    705706     
    706707    # If html help generation was requested. DOCUMENTATION_HTML_HELP is defined by Documentation.cmake 
     
    711712            SET(HTML_HELP_COMPILER "" CACHE FILEPATH "Enter location of the HTML help compiler to let doxygen compile html") 
    712713            MARK_AS_ADVANCED(HTML_HELP_COMPILER) 
    713         ENDIF(NOT WIN32) 
     714        ENDIF() 
    714715        # this var sets a proper value in .doxygen files when coniguring them below 
    715716        SET(GENERATE_HTMLHELP "YES") 
    716     endif(DOCUMENTATION_HTML_HELP) 
     717    endif() 
    717718   
    718719    # This processes our doxyfile.cmake and substitutes paths to generate 
     
    731732    IF(BUILD_REF_DOCS_TAGFILE) 
    732733        SET(GENERATE_TAGFILE "${OpenSceneGraph_BINARY_DIR}/doc/OpenThreadsReferenceDocs/ot.tag") 
    733     ENDIF(BUILD_REF_DOCS_TAGFILE) 
     734    ENDIF() 
    734735 
    735736    # This processes our openthreads.doxyfile.cmake and generate a final doxyfile 
     
    771772# viewable here : http://www.cdash.org/CDashPublic/index.php?project=OpenSceneGraph 
    772773    INCLUDE(Dart) 
    773 ENDIF(BUILD_DASHBOARD_REPORTS) 
     774ENDIF() 
    774775 
    775776# present the packaging option only if we have the cpack command defined (effectively >= 2.6.0) 
     
    778779    IF(BUILD_OSG_PACKAGES) 
    779780      INCLUDE(OsgCPack) 
    780     ENDIF(BUILD_OSG_PACKAGES) 
    781 ENDIF(CMAKE_CPACK_COMMAND) 
     781    ENDIF() 
     782ENDIF() 
    782783 
    783784# Generate pkg-config configuration file 
     
    791792 
    792793# Run this as late as possible so users can easier spot the message 
    793 IF (${CMAKE_INSTALL_PREFIX} STREQUAL "/usr/local") 
    794 SET(REQUIRES_LIBPATH_MESSAGE ON) 
    795 ENDIF(${CMAKE_INSTALL_PREFIX} STREQUAL "/usr/local")  
     794IF (NOT DEFINED REQUIRES_LIBPATH_MESSAGE AND ${CMAKE_INSTALL_PREFIX} STREQUAL "/usr/local") 
     795    SET(REQUIRES_LIBPATH_MESSAGE ON) 
     796ENDIF() 
    796797 
    797798IF(REQUIRES_LIBPATH_MESSAGE) 
    798  
    799799    IF (NOT OSG_LIBPATH_MESSAGE_HAS_BEEN_RUN_BEFORE) 
    800   
    801800        SET(OSG_LIBPATH_MESSAGE_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether the libpath message has been reported before") 
    802801 
     
    819818                COMMENT "Copying openscenegraph.conf to /etc/ld.so.conf.d and running ldconfig" 
    820819            ) 
    821         ELSE(IS_DIRECTORY /etc/ld.so.conf.d) 
     820        ELSE() 
    822821            IF(EXISTS /etc/ld.so.conf) 
    823822                MESSAGE("You have an ld.so.conf file in /etc, if you wish to ensure \n" 
    824823                "that applications find the installed osg libraries, system wide, you\n" 
    825824                "could add ${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX} to it.") 
    826             ENDIF(EXISTS /etc/ld.so.conf) 
    827         ENDIF(IS_DIRECTORY /etc/ld.so.conf.d) 
     825            ENDIF() 
     826        ENDIF() 
    828827 
    829828        # emit a message during installation. 
     
    832831    ENDIF(NOT OSG_LIBPATH_MESSAGE_HAS_BEEN_RUN_BEFORE) 
    833832 
    834 ELSE(REQUIRES_LIBPATH_MESSAGE) 
    835  
     833ELSE() 
    836834    SET(OSG_LIBPATH_MESSAGE_HAS_BEEN_RUN_BEFORE 0 CACHE INTERNAL "Flag to track whether the libpath message has been reported before") 
    837  
    838 ENDIF(REQUIRES_LIBPATH_MESSAGE) 
     835ENDIF() 
    839836 
    840837 
     
    843840IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE) 
    844841    SET(OSG_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before") 
    845 ENDIF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE) 
     842ENDIF() 
    846843 
    847844#-----------------------------------------------------------------------------