cmake_modules/CMakePascalInformation.cmake
branchcmake_pascal
changeset 8798 03d113d51062
parent 8778 04363016580f
child 8809 8ce66f1106f1
--- a/cmake_modules/CMakePascalInformation.cmake	Tue Mar 19 13:39:38 2013 +0100
+++ b/cmake_modules/CMakePascalInformation.cmake	Tue Mar 19 14:14:40 2013 +0100
@@ -159,21 +159,28 @@
 # compile a Pascal file into an object file
 IF(NOT CMAKE_Pascal_COMPILE_OBJECT)
     #when you have multiple ld installation make sure you get the one bundled with the system C compiler
-  get_filename_component(CMAKE_C_COMPILER_DIR ${CMAKE_C_COMPILER} PATH)
-  if(APPLE)
-    #add user framework directory
-    set(CMAKE_Pascal_OSX_FLAGS "-Ff~/Library/Frameworks")
-    if(CMAKE_OSX_SYSROOT)
-        set(CMAKE_Pascal_OSX_FLAGS "-XD${CMAKE_OSX_SYSROOT} ${CMAKE_Pascal_OSX_FLAGS}")
-    endif(CMAKE_OSX_SYSROOT)
-  endif(APPLE)
+  if(UNIX)
+    get_filename_component(CMAKE_C_COMPILER_DIR ${CMAKE_C_COMPILER} PATH)
+    set(CMAKE_Pascal_UNIX_FLAGS "-FD${CMAKE_C_COMPILER_DIR}")
+    if(APPLE)
+      #add user framework directory
+      set(CMAKE_Pascal_UNIX_FLAGS "-Ff~/Library/Frameworks ${CMAKE_Pascal_UNIX_FLAGS}")
+      if(CMAKE_OSX_SYSROOT)
+        set(CMAKE_Pascal_UNIX_FLAGS "-XD${CMAKE_OSX_SYSROOT} ${CMAKE_Pascal_UNIX_FLAGS}")
+      endif(CMAKE_OSX_SYSROOT)
+    endif(APPLE)
+  endif(UNIX)
     SET(CMAKE_Pascal_COMPILE_OBJECT
-      "<CMAKE_Pascal_COMPILER> -Cn -FE${EXECUTABLE_OUTPUT_PATH} -FU${CMAKE_CURRENT_BINARY_DIR}/<OBJECT_DIR> -Fi${CMAKE_CURRENT_BINARY_DIR} -FD${CMAKE_C_COMPILER_DIR} ${CMAKE_Pascal_OSX_FLAGS} <FLAGS> <SOURCE>")
+      "<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>")
 ENDIF(NOT CMAKE_Pascal_COMPILE_OBJECT)
 
 # link Pascal objects in a single executable
 IF(NOT CMAKE_Pascal_LINK_EXECUTABLE)
+  if(WIN32)
+    set(CMAKE_Pascal_LINK_EXECUTABLE "${EXECUTABLE_OUTPUT_PATH}/ppas.bat")
+  else(WIN32)
     set(CMAKE_Pascal_LINK_EXECUTABLE "${EXECUTABLE_OUTPUT_PATH}/ppas.sh")
+  endif(WIN32)
 #  SET(CMAKE_Pascal_LINK_EXECUTABLE "${CMAKE_Pascal_COMPILER} <CMAKE_Pascal_LINK_FLAGS> <LINK_FLAGS> <TARGET_BASE>.adb -cargs <FLAGS> -largs <LINK_LIBRARIES>")
 ENDIF(NOT CMAKE_Pascal_LINK_EXECUTABLE)