cmake_modules/CMakePascalInformation.cmake
author koda
Tue, 19 Mar 2013 18:02:06 +0100
branchcmake_pascal
changeset 8815 c28fcd8ec138
parent 8809 8ce66f1106f1
child 8821 e85ff6e298b5
permissions -rw-r--r--
minor and partial casing commit
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
     1
# This file sets the basic flags for the Pascal language in CMake.
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
     2
# It also loads the available platform file for the system-compiler
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
     3
# if it exists.
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
     4
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
     5
get_filename_component(CMAKE_BASE_NAME ${CMAKE_Pascal_COMPILER} NAME_WE)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
     6
set(CMAKE_SYSTEM_AND_Pascal_COMPILER_INFO_FILE
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
     7
    ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
     8
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
     9
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    10
# This should be included before the _INIT variables are
8752
48cf2ccb83c6 with lot of hackery, use add_executable on pascal files, SUCCSS
koda
parents: 8750
diff changeset
    11
# used to initialize the cache.  Since the rule variables
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    12
# have if blocks on them, users can still define them here.
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    13
# But, it should still be after the platform file so changes can
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    14
# be made to those values.
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    15
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    16
if(CMAKE_USER_MAKE_RULES_OVERRIDE)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    17
   include(${CMAKE_USER_MAKE_RULES_OVERRIDE})
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    18
endif(CMAKE_USER_MAKE_RULES_OVERRIDE)
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    19
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    20
if(CMAKE_USER_MAKE_RULES_OVERRIDE_Pascal)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    21
   include(${CMAKE_USER_MAKE_RULES_OVERRIDE_Pascal})
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    22
endif(CMAKE_USER_MAKE_RULES_OVERRIDE_Pascal)
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    23
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    24
# Create a set of shared library variable specific to Pascal
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    25
# For 90% of the systems, these are the same flags as the C versions
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    26
# so if these are not set just copy the flags from the c version
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    27
#IF(NOT CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS)
8770
53481d654691 partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents: 8758
diff changeset
    28
#-dynamiclib -Wl,-headerpad_max_install_names for C
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    29
#  SET(CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    30
#ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    31
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    32
if(NOT CMAKE_SHARED_LIBRARY_Pascal_FLAGS)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    33
    #another similarity, fpc: -fPIC  Same as -Cg
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    34
    #(maybe required only for x86_64)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    35
    set(CMAKE_SHARED_LIBRARY_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    36
endif(NOT CMAKE_SHARED_LIBRARY_Pascal_FLAGS)
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    37
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    38
if(NOT CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    39
    set(CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    40
endif(NOT CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS)
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    41
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    42
#IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG)
8752
48cf2ccb83c6 with lot of hackery, use add_executable on pascal files, SUCCSS
koda
parents: 8750
diff changeset
    43
#  SET(CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    44
#ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    45
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    46
#IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG_SEP)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    47
#  SET(CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    48
#ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG_SEP)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    49
8770
53481d654691 partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents: 8758
diff changeset
    50
if(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG)
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    51
    set(CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
8770
53481d654691 partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents: 8758
diff changeset
    52
endif(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG)
53481d654691 partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents: 8758
diff changeset
    53
53481d654691 partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents: 8758
diff changeset
    54
# for most systems a module is the same as a shared library
53481d654691 partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents: 8758
diff changeset
    55
# so unless the variable CMAKE_MODULE_EXISTS is set just
53481d654691 partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents: 8758
diff changeset
    56
# copy the values from the LIBRARY variables
53481d654691 partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents: 8758
diff changeset
    57
if(NOT CMAKE_MODULE_EXISTS)
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    58
    set(CMAKE_SHARED_MODULE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_Pascal_FLAGS})
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    59
    set(CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS})
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    60
endif(NOT CMAKE_MODULE_EXISTS)
8770
53481d654691 partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents: 8758
diff changeset
    61
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    62
# repeat for modules
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    63
#IF(NOT CMAKE_SHARED_MODULE_CREATE_Ada_FLAGS)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    64
#  SET(CMAKE_SHARED_MODULE_CREATE_Ada_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    65
#ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_Ada_FLAGS)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    66
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    67
#IF(NOT CMAKE_SHARED_MODULE_Ada_FLAGS)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    68
#  SET(CMAKE_SHARED_MODULE_Ada_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    69
#ENDIF(NOT CMAKE_SHARED_MODULE_Ada_FLAGS)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    70
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    71
#IF(NOT CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG)
8752
48cf2ccb83c6 with lot of hackery, use add_executable on pascal files, SUCCSS
koda
parents: 8750
diff changeset
    72
#  SET(CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG})
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    73
#ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    74
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    75
#IF(NOT CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG_SEP)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    76
#  SET(CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG_SEP ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG_SEP})
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    77
#ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG_SEP)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    78
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    79
if(NOT CMAKE_INCLUDE_FLAG_Pascal)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    80
    #amazing, fpc: -I<x>  Add <x> to include path
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    81
    set(CMAKE_INCLUDE_FLAG_Pascal ${CMAKE_INCLUDE_FLAG_C})
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    82
endif(NOT CMAKE_INCLUDE_FLAG_Pascal)
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    83
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    84
if(NOT CMAKE_INCLUDE_FLAG_SEP_Pascal)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    85
    set(CMAKE_INCLUDE_FLAG_SEP_Pascal ${CMAKE_INCLUDE_FLAG_SEP_C})
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    86
endif(NOT CMAKE_INCLUDE_FLAG_SEP_Pascal)
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    87
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    88
# Copy C version of this flag which is normally determined in platform file.
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    89
if(NOT CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    90
  set(CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    91
endif(NOT CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG)
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    92
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    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.")
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    94
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
    95
set(CMAKE_Pascal_FLAGS "$ENV{FPFLAGS} ${CMAKE_Pascal_FLAGS_INIT}" CACHE STRING "Flags for Pascal compiler.")
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    96
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    97
INCLUDE(CMakeCommonLanguageInclude)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    98
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
    99
# now define the following rule variables
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   100
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   101
# CMAKE_Ada_CREATE_SHARED_LIBRARY
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   102
# CMAKE_Ada_CREATE_SHARED_MODULE
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   103
# CMAKE_Ada_CREATE_STATIC_LIBRARY
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   104
# CMAKE_Ada_COMPILE_OBJECT
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   105
# CMAKE_Ada_LINK_EXECUTABLE
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   106
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   107
# variables supplied by the generator at use time
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   108
# <TARGET>
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   109
# <TARGET_BASE> the target without the suffix
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   110
# <OBJECTS>
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   111
# <OBJECT>
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   112
# <LINK_LIBRARIES>
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   113
# <FLAGS>
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   114
# <LINK_FLAGS>
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   115
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   116
# Ada compiler information
8752
48cf2ccb83c6 with lot of hackery, use add_executable on pascal files, SUCCSS
koda
parents: 8750
diff changeset
   117
# <CMAKE_Ada_COMPILER>
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   118
# <CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS>
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   119
# <CMAKE_SHARED_MODULE_CREATE_Ada_FLAGS>
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   120
# <CMAKE_Ada_LINK_FLAGS>
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   121
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   122
# Static library tools
8752
48cf2ccb83c6 with lot of hackery, use add_executable on pascal files, SUCCSS
koda
parents: 8750
diff changeset
   123
# <CMAKE_AR>
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   124
# <CMAKE_RANLIB>
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   125
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   126
if(NOT EXECUTABLE_OUTPUT_PATH)
8756
671f6ef4f7f1 move paths setup inside cmake_lang files
koda
parents: 8754
diff changeset
   127
    set (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   128
endif(NOT EXECUTABLE_OUTPUT_PATH)
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   129
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   130
# create an Ada shared library
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   131
IF(NOT CMAKE_Ada_CREATE_SHARED_LIBRARY)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   132
    SET(CMAKE_Ada_CREATE_SHARED_LIBRARY
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   133
    "<CMAKE_Ada_COMPILER> <CMAKE_SHARED_LIBRARY_Ada_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_Ada_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   134
    )
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   135
ENDIF(NOT CMAKE_Ada_CREATE_SHARED_LIBRARY)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   136
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   137
# create an Ada shared module just copy the shared library rule
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   138
IF(NOT CMAKE_Ada_CREATE_SHARED_MODULE)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   139
  SET(CMAKE_Ada_CREATE_SHARED_MODULE ${CMAKE_Ada_CREATE_SHARED_LIBRARY})
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   140
ENDIF(NOT CMAKE_Ada_CREATE_SHARED_MODULE)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   141
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   142
# create an Ada static library
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   143
IF(NOT CMAKE_Ada_CREATE_STATIC_LIBRARY)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   144
  SET(CMAKE_Ada_CREATE_STATIC_LIBRARY
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   145
      "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   146
      "<CMAKE_RANLIB> <TARGET> ")
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   147
ENDIF(NOT CMAKE_Ada_CREATE_STATIC_LIBRARY)
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   148
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   149
# compile a Pascal file into an object file
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   150
if(NOT CMAKE_Pascal_COMPILE_OBJECT)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   151
    if(UNIX)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   152
        #when you have multiple ld installation make sure you get the one bundled with the system C compiler
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   153
        include(Platform/${CMAKE_SYSTEM_NAME}-GNU-C.cmake OPTIONAL)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   154
        if(CMAKE_C_COMPILER)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   155
            get_filename_component(CMAKE_C_COMPILER_DIR ${CMAKE_C_COMPILER} PATH)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   156
            set(CMAKE_Pascal_UNIX_FLAGS "-FD${CMAKE_C_COMPILER_DIR}")
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   157
        endif(CMAKE_C_COMPILER)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   158
        if(APPLE)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   159
            #add user framework directory
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   160
            set(CMAKE_Pascal_UNIX_FLAGS "-Ff~/Library/Frameworks ${CMAKE_Pascal_UNIX_FLAGS}")
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   161
            #when sysroot is set, make sure that fpc picks it
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   162
            if(CMAKE_OSX_SYSROOT)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   163
                set(CMAKE_Pascal_UNIX_FLAGS "-XD${CMAKE_OSX_SYSROOT} ${CMAKE_Pascal_UNIX_FLAGS}")
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   164
            endif(CMAKE_OSX_SYSROOT)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   165
        endif(APPLE)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   166
    endif(UNIX)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   167
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   168
    set(CMAKE_Pascal_COMPILE_OBJECT
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   169
        "<CMAKE_Pascal_COMPILER> -Cn -FE${EXECUTABLE_OUTPUT_PATH} -FU${CMAKE_CURRENT_BINARY_DIR}/<OBJECT_DIR> -Fi${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_Pascal_UNIX_FLAGS} <FLAGS> <SOURCE>")
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   170
endif(NOT CMAKE_Pascal_COMPILE_OBJECT)
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   171
8778
04363016580f internal handling of some osx-only pascal flags
koda
parents: 8770
diff changeset
   172
# link Pascal objects in a single executable
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   173
if(NOT CMAKE_Pascal_LINK_EXECUTABLE)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   174
    if(WIN32)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   175
        set(CMAKE_Pascal_LINK_EXECUTABLE "${EXECUTABLE_OUTPUT_PATH}/ppas.bat")
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   176
    else(WIN32)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   177
        set(CMAKE_Pascal_LINK_EXECUTABLE "${EXECUTABLE_OUTPUT_PATH}/ppas.sh")
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   178
    endif(WIN32)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   179
# other expandable variables here are<CMAKE_Pascal_LINK_FLAGS> <LINK_FLAGS> <TARGET_BASE> <FLAGS> <LINK_LIBRARIES>
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   180
endif(NOT CMAKE_Pascal_LINK_EXECUTABLE)
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   181
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   182
if(CMAKE_Pascal_STANDARD_LIBRARIES_INIT)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   183
    set(CMAKE_Pascal_STANDARD_LIBRARIES "${CMAKE_Pascal_STANDARD_LIBRARIES_INIT}"
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   184
    CACHE STRING "Libraries linked by default (usually handled internally).")
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   185
    MARK_AS_ADVANCED(CMAKE_Pascal_STANDARD_LIBRARIES)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   186
endif(CMAKE_Pascal_STANDARD_LIBRARIES_INIT)
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   187
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   188
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   189
  SET (CMAKE_Pascal_FLAGS_DEBUG "${CMAKE_Ada_FLAGS_DEBUG_INIT}" CACHE STRING
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   190
     "Flags used by the compiler during debug builds.")
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   191
  SET (CMAKE_Pascal_FLAGS_MINSIZEREL "${CMAKE_Ada_FLAGS_MINSIZEREL_INIT}" CACHE STRING
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   192
     "Flags used by the compiler during release minsize builds.")
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   193
  SET (CMAKE_Pascal_FLAGS_RELEASE "${CMAKE_Ada_FLAGS_RELEASE_INIT}" CACHE STRING
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   194
     "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   195
  SET (CMAKE_Pascal_FLAGS_RELWITHDEBINFO "${CMAKE_Ada_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   196
     "Flags used by the compiler during Release with Debug Info builds.")
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   197
endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   198
8815
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   199
mark_as_advanced(CMAKE_Pascal_FLAGS CMAKE_Pascal_FLAGS_DEBUG CMAKE_Pascal_FLAGS_MINSIZEREL
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   200
                 CMAKE_Pascal_FLAGS_RELEASE CMAKE_Pascal_FLAGS_RELWITHDEBINFO)
c28fcd8ec138 minor and partial casing commit
koda
parents: 8809
diff changeset
   201
set(CMAKE_Pascal_INFORMATION_LOADED 1)
8750
d9e57426e759 barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff changeset
   202