cmake_modules/CMakePascalInformation.cmake
branchcmake_pascal
changeset 8809 8ce66f1106f1
parent 8798 03d113d51062
child 8815 c28fcd8ec138
equal deleted inserted replaced
8806:3dca9b6e8168 8809:8ce66f1106f1
    18 ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE)
    18 ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE)
    19 
    19 
    20 IF(CMAKE_USER_MAKE_RULES_OVERRIDE_Pascal)
    20 IF(CMAKE_USER_MAKE_RULES_OVERRIDE_Pascal)
    21    INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Pascal})
    21    INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Pascal})
    22 ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE_Pascal)
    22 ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE_Pascal)
    23 
       
    24 
       
    25 # for most systems a module is the same as a shared library
       
    26 # so unless the variable CMAKE_MODULE_EXISTS is set just
       
    27 # copy the values from the LIBRARY variables
       
    28 IF(NOT CMAKE_MODULE_EXISTS)
       
    29   SET(CMAKE_SHARED_MODULE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_Pascal_FLAGS})
       
    30   SET(CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS})
       
    31 ENDIF(NOT CMAKE_MODULE_EXISTS)
       
    32 
    23 
    33 # Create a set of shared library variable specific to Pascal
    24 # Create a set of shared library variable specific to Pascal
    34 # For 90% of the systems, these are the same flags as the C versions
    25 # For 90% of the systems, these are the same flags as the C versions
    35 # so if these are not set just copy the flags from the c version
    26 # so if these are not set just copy the flags from the c version
    36 #IF(NOT CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS)
    27 #IF(NOT CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS)
    99   SET(CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
    90   SET(CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
   100 ENDIF(NOT CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG)
    91 ENDIF(NOT CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG)
   101 
    92 
   102 SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make.  This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
    93 SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make.  This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
   103 
    94 
   104 SET (CMAKE_Pascal_FLAGS "$ENV{FPFLAGS} ${CMAKE_Pascal_FLAGS_INIT}" CACHE STRING
    95 SET (CMAKE_Pascal_FLAGS "$ENV{FPFLAGS} ${CMAKE_Pascal_FLAGS_INIT}" CACHE STRING "Flags for Pascal compiler.")
   105      "Flags for Pascal compiler.")
       
   106 
    96 
   107 INCLUDE(CMakeCommonLanguageInclude)
    97 INCLUDE(CMakeCommonLanguageInclude)
   108 
    98 
   109 # now define the following rule variables
    99 # now define the following rule variables
   110 
   100 
   156       "<CMAKE_RANLIB> <TARGET> ")
   146       "<CMAKE_RANLIB> <TARGET> ")
   157 ENDIF(NOT CMAKE_Ada_CREATE_STATIC_LIBRARY)
   147 ENDIF(NOT CMAKE_Ada_CREATE_STATIC_LIBRARY)
   158 
   148 
   159 # compile a Pascal file into an object file
   149 # compile a Pascal file into an object file
   160 IF(NOT CMAKE_Pascal_COMPILE_OBJECT)
   150 IF(NOT CMAKE_Pascal_COMPILE_OBJECT)
       
   151   if(UNIX)
   161     #when you have multiple ld installation make sure you get the one bundled with the system C compiler
   152     #when you have multiple ld installation make sure you get the one bundled with the system C compiler
   162   if(UNIX)
   153     INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-GNU-C.cmake OPTIONAL)
   163     get_filename_component(CMAKE_C_COMPILER_DIR ${CMAKE_C_COMPILER} PATH)
   154     if(CMAKE_C_COMPILER)
   164     set(CMAKE_Pascal_UNIX_FLAGS "-FD${CMAKE_C_COMPILER_DIR}")
   155       get_filename_component(CMAKE_C_COMPILER_DIR ${CMAKE_C_COMPILER} PATH)
       
   156       set(CMAKE_Pascal_UNIX_FLAGS "-FD${CMAKE_C_COMPILER_DIR}")
       
   157     endif(CMAKE_C_COMPILER)
   165     if(APPLE)
   158     if(APPLE)
   166       #add user framework directory
   159       #add user framework directory
   167       set(CMAKE_Pascal_UNIX_FLAGS "-Ff~/Library/Frameworks ${CMAKE_Pascal_UNIX_FLAGS}")
   160       set(CMAKE_Pascal_UNIX_FLAGS "-Ff~/Library/Frameworks ${CMAKE_Pascal_UNIX_FLAGS}")
   168       if(CMAKE_OSX_SYSROOT)
   161       if(CMAKE_OSX_SYSROOT)
   169         set(CMAKE_Pascal_UNIX_FLAGS "-XD${CMAKE_OSX_SYSROOT} ${CMAKE_Pascal_UNIX_FLAGS}")
   162         set(CMAKE_Pascal_UNIX_FLAGS "-XD${CMAKE_OSX_SYSROOT} ${CMAKE_Pascal_UNIX_FLAGS}")