cmake_modules/CMakePascalInformation.cmake
branchcmake_pascal
changeset 8809 8ce66f1106f1
parent 8798 03d113d51062
child 8815 c28fcd8ec138
--- a/cmake_modules/CMakePascalInformation.cmake	Tue Mar 19 16:40:35 2013 +0100
+++ b/cmake_modules/CMakePascalInformation.cmake	Tue Mar 19 16:47:53 2013 +0100
@@ -21,15 +21,6 @@
    INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Pascal})
 ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE_Pascal)
 
-
-# for most systems a module is the same as a shared library
-# so unless the variable CMAKE_MODULE_EXISTS is set just
-# copy the values from the LIBRARY variables
-IF(NOT CMAKE_MODULE_EXISTS)
-  SET(CMAKE_SHARED_MODULE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_Pascal_FLAGS})
-  SET(CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS})
-ENDIF(NOT CMAKE_MODULE_EXISTS)
-
 # Create a set of shared library variable specific to Pascal
 # For 90% of the systems, these are the same flags as the C versions
 # so if these are not set just copy the flags from the c version
@@ -101,8 +92,7 @@
 
 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.")
 
-SET (CMAKE_Pascal_FLAGS "$ENV{FPFLAGS} ${CMAKE_Pascal_FLAGS_INIT}" CACHE STRING
-     "Flags for Pascal compiler.")
+SET (CMAKE_Pascal_FLAGS "$ENV{FPFLAGS} ${CMAKE_Pascal_FLAGS_INIT}" CACHE STRING "Flags for Pascal compiler.")
 
 INCLUDE(CMakeCommonLanguageInclude)
 
@@ -158,10 +148,13 @@
 
 # compile a Pascal file into an object file
 IF(NOT CMAKE_Pascal_COMPILE_OBJECT)
+  if(UNIX)
     #when you have multiple ld installation make sure you get the one bundled with the system C compiler
-  if(UNIX)
-    get_filename_component(CMAKE_C_COMPILER_DIR ${CMAKE_C_COMPILER} PATH)
-    set(CMAKE_Pascal_UNIX_FLAGS "-FD${CMAKE_C_COMPILER_DIR}")
+    INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-GNU-C.cmake OPTIONAL)
+    if(CMAKE_C_COMPILER)
+      get_filename_component(CMAKE_C_COMPILER_DIR ${CMAKE_C_COMPILER} PATH)
+      set(CMAKE_Pascal_UNIX_FLAGS "-FD${CMAKE_C_COMPILER_DIR}")
+    endif(CMAKE_C_COMPILER)
     if(APPLE)
       #add user framework directory
       set(CMAKE_Pascal_UNIX_FLAGS "-Ff~/Library/Frameworks ${CMAKE_Pascal_UNIX_FLAGS}")