cmake_modules/CMakePascalInformation.cmake
branchcmake_pascal
changeset 8831 06562cd68897
parent 8829 6940e86a7df6
child 8834 edceeafff671
equal deleted inserted replaced
8829:6940e86a7df6 8831:06562cd68897
    29 endif(CMAKE_USER_MAKE_RULES_OVERRIDE_Pascal)
    29 endif(CMAKE_USER_MAKE_RULES_OVERRIDE_Pascal)
    30 
    30 
    31 # Create a set of shared library variable specific to Pascal
    31 # Create a set of shared library variable specific to Pascal
    32 # For 90% of the systems, these are the same flags as the C versions
    32 # For 90% of the systems, these are the same flags as the C versions
    33 # so if these are not set just copy the flags from the c version
    33 # so if these are not set just copy the flags from the c version
    34 #IF(NOT CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS)
    34 
       
    35 # No flags supported during linking as a shell script takes care of it
       
    36 IF(NOT CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS)
    35 #-dynamiclib -Wl,-headerpad_max_install_names for C
    37 #-dynamiclib -Wl,-headerpad_max_install_names for C
    36 #  SET(CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
    38   SET(CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
    37 #ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS)
    39 ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS)
    38 
    40 
    39 if(NOT CMAKE_SHARED_LIBRARY_Pascal_FLAGS)
    41 if(NOT CMAKE_SHARED_LIBRARY_Pascal_FLAGS)
    40     #another similarity, fpc: -fPIC  Same as -Cg
    42     #another similarity, fpc: -fPIC  Same as -Cg
    41     #(maybe required only for x86_64)
    43     #(maybe required only for x86_64)
    42     set(CMAKE_SHARED_LIBRARY_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
    44     set(CMAKE_SHARED_LIBRARY_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
    44 
    46 
    45 if(NOT CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS)
    47 if(NOT CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS)
    46     set(CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
    48     set(CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
    47 endif(NOT CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS)
    49 endif(NOT CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS)
    48 
    50 
    49 #IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG)
    51 #IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG)
    50 #  SET(CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
    52 #  SET(CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
    51 #ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG)
    53 #ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG)
    52 
    54 
    53 #IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG_SEP)
    55 #IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG_SEP)
    54 #  SET(CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
    56 #  SET(CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
    55 #ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG_SEP)
    57 #ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG_SEP)
    56 
    58 
    57 if(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG)
    59 if(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG)
    58     set(CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
    60     set(CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
    59 endif(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG)
    61 endif(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG)
    60 
    62 
    65     set(CMAKE_SHARED_MODULE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_Pascal_FLAGS})
    67     set(CMAKE_SHARED_MODULE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_Pascal_FLAGS})
    66     set(CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS})
    68     set(CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS})
    67 endif(NOT CMAKE_MODULE_EXISTS)
    69 endif(NOT CMAKE_MODULE_EXISTS)
    68 
    70 
    69 # repeat for modules
    71 # repeat for modules
    70 #IF(NOT CMAKE_SHARED_MODULE_CREATE_Ada_FLAGS)
    72 IF(NOT CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS)
    71 #  SET(CMAKE_SHARED_MODULE_CREATE_Ada_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
    73   SET(CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
    72 #ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_Ada_FLAGS)
    74 ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS)
    73 
    75 
    74 #IF(NOT CMAKE_SHARED_MODULE_Ada_FLAGS)
    76 IF(NOT CMAKE_SHARED_MODULE_Pascal_FLAGS)
    75 #  SET(CMAKE_SHARED_MODULE_Ada_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
    77   SET(CMAKE_SHARED_MODULE_Pascal_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
    76 #ENDIF(NOT CMAKE_SHARED_MODULE_Ada_FLAGS)
    78 ENDIF(NOT CMAKE_SHARED_MODULE_Pascal_FLAGS)
    77 
    79 
    78 #IF(NOT CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG)
    80 IF(NOT CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG)
    79 #  SET(CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG})
    81   SET(CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG})
    80 #ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG)
    82 ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG)
    81 
    83 
    82 #IF(NOT CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG_SEP)
    84 IF(NOT CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG_SEP)
    83 #  SET(CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG_SEP ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG_SEP})
    85   SET(CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG_SEP ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG_SEP})
    84 #ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG_SEP)
    86 ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG_SEP)
    85 
    87 
    86 if(NOT CMAKE_INCLUDE_FLAG_Pascal)
    88 if(NOT CMAKE_INCLUDE_FLAG_Pascal)
    87     #amazing, fpc: -I<x>  Add <x> to include path
    89     #amazing, fpc: -I<x>  Add <x> to include path
    88     set(CMAKE_INCLUDE_FLAG_Pascal ${CMAKE_INCLUDE_FLAG_C})
    90     set(CMAKE_INCLUDE_FLAG_Pascal ${CMAKE_INCLUDE_FLAG_C})
    89 endif(NOT CMAKE_INCLUDE_FLAG_Pascal)
    91 endif(NOT CMAKE_INCLUDE_FLAG_Pascal)
   103 
   105 
   104 INCLUDE(CMakeCommonLanguageInclude)
   106 INCLUDE(CMakeCommonLanguageInclude)
   105 
   107 
   106 # now define the following rule variables
   108 # now define the following rule variables
   107 
   109 
   108 # CMAKE_Ada_CREATE_SHARED_LIBRARY
   110 # CMAKE_Pascal_CREATE_SHARED_LIBRARY
   109 # CMAKE_Ada_CREATE_SHARED_MODULE
   111 # CMAKE_Pascal_CREATE_SHARED_MODULE
   110 # CMAKE_Ada_CREATE_STATIC_LIBRARY
   112 # CMAKE_Pascal_CREATE_STATIC_LIBRARY
   111 # CMAKE_Ada_COMPILE_OBJECT
   113 # CMAKE_Pascal_COMPILE_OBJECT
   112 # CMAKE_Ada_LINK_EXECUTABLE
   114 # CMAKE_Pascal_LINK_EXECUTABLE
   113 
   115 
   114 # variables supplied by the generator at use time
   116 # variables supplied by the generator at use time
   115 # <TARGET>
   117 # <TARGET>
   116 # <TARGET_BASE> the target without the suffix
   118 # <TARGET_BASE> the target without the suffix
   117 # <OBJECTS>
   119 # <OBJECTS>
   118 # <OBJECT>
   120 # <OBJECT>
   119 # <LINK_LIBRARIES>
   121 # <LINK_LIBRARIES>
   120 # <FLAGS>
   122 # <FLAGS>
   121 # <LINK_FLAGS>
   123 # <LINK_FLAGS>
   122 
   124 
   123 # Ada compiler information
   125 # Pascal compiler information
   124 # <CMAKE_Ada_COMPILER>
   126 # <CMAKE_Pascal_COMPILER>
   125 # <CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS>
   127 # <CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS>
   126 # <CMAKE_SHARED_MODULE_CREATE_Ada_FLAGS>
   128 # <CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS>
   127 # <CMAKE_Ada_LINK_FLAGS>
   129 # <CMAKE_Pascal_LINK_FLAGS>
   128 
   130 
   129 # Static library tools
   131 # Static library tools
   130 # <CMAKE_AR>
   132 # <CMAKE_AR>
   131 # <CMAKE_RANLIB>
   133 # <CMAKE_RANLIB>
   132 
   134 
   142         set(CMAKE_Pascal_CREATE_SHARED_LIBRARY "${EXECUTABLE_OUTPUT_PATH}/ppas.sh")
   144         set(CMAKE_Pascal_CREATE_SHARED_LIBRARY "${EXECUTABLE_OUTPUT_PATH}/ppas.sh")
   143     endif(WIN32)
   145     endif(WIN32)
   144 # other expandable variables here are <CMAKE_Pascal_COMPILER> <CMAKE_SHARED_LIBRARY_Pascal_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG> <TARGET_SONAME> <TARGET> <OBJECTS> <LINK_LIBRARIES>
   146 # other expandable variables here are <CMAKE_Pascal_COMPILER> <CMAKE_SHARED_LIBRARY_Pascal_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG> <TARGET_SONAME> <TARGET> <OBJECTS> <LINK_LIBRARIES>
   145 endif(NOT CMAKE_Pascal_CREATE_SHARED_LIBRARY)
   147 endif(NOT CMAKE_Pascal_CREATE_SHARED_LIBRARY)
   146 
   148 
   147 # create an Ada shared module just copy the shared library rule
   149 # create an Pascal shared module just copy the shared library rule
   148 IF(NOT CMAKE_Ada_CREATE_SHARED_MODULE)
   150 IF(NOT CMAKE_Pascal_CREATE_SHARED_MODULE)
   149   SET(CMAKE_Ada_CREATE_SHARED_MODULE ${CMAKE_Ada_CREATE_SHARED_LIBRARY})
   151   SET(CMAKE_Pascal_CREATE_SHARED_MODULE ${CMAKE_Pascal_CREATE_SHARED_LIBRARY})
   150 ENDIF(NOT CMAKE_Ada_CREATE_SHARED_MODULE)
   152 ENDIF(NOT CMAKE_Pascal_CREATE_SHARED_MODULE)
   151 
   153 
   152 # create an Pascal static library (unsupported)
   154 # create an Pascal static library (unsupported)
   153 IF(NOT CMAKE_Pascal_CREATE_STATIC_LIBRARY)
   155 IF(NOT CMAKE_Pascal_CREATE_STATIC_LIBRARY)
   154   SET(CMAKE_Pascal_CREATE_STATIC_LIBRARY
   156   SET(CMAKE_Pascal_CREATE_STATIC_LIBRARY
   155       "echo STATIC LIBRARIES ARE NOT SUPPORTED" "exit")
   157       "echo STATIC LIBRARIES ARE NOT SUPPORTED" "exit")