--- a/cmake_modules/CMakeDeterminePascalCompiler.cmake Tue Mar 26 02:06:54 2013 +0100
+++ b/cmake_modules/CMakeDeterminePascalCompiler.cmake Tue Mar 26 18:03:15 2013 +0100
@@ -5,61 +5,61 @@
# the cmake variable CMAKE_GENERATOR_PASCAL which can be defined by a generator
# as a default compiler
-IF(NOT CMAKE_Pascal_COMPILER)
-
- # prefer the environment variable FPC
- IF($ENV{FPC} MATCHES ".+")
- GET_FILENAME_COMPONENT(CMAKE_Pascal_COMPILER_INIT $ENV{FPC} PROGRAM PROGRAM_ARGS CMAKE_Pascal_FLAGS_ENV_INIT)
- IF(CMAKE_Pascal_FLAGS_ENV_INIT)
- SET(CMAKE_Pascal_COMPILER_ARG1 "${CMAKE_Pascal_FLAGS_ENV_INIT}" CACHE STRING "First argument to Pascal compiler")
- ENDIF(CMAKE_Pascal_FLAGS_ENV_INIT)
- IF(EXISTS ${CMAKE_Pascal_COMPILER_INIT})
- ELSE(EXISTS ${CMAKE_Pascal_COMPILER_INIT})
- MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable FPC:\n$ENV{FPC}.")
- ENDIF(EXISTS ${CMAKE_Pascal_COMPILER_INIT})
- ENDIF($ENV{FPC} MATCHES ".+")
+if(NOT CMAKE_Pascal_COMPILER)
+ # prefer the environment variable FPC
+ if($ENV{FPC} MATCHES ".+")
+ get_filename_component(CMAKE_Pascal_COMPILER_INIT $ENV{FPC} PROGRAM PROGRAM_ARGS CMAKE_Pascal_FLAGS_ENV_INIT)
+ if(CMAKE_Pascal_FLAGS_ENV_INIT)
+ set(CMAKE_Pascal_COMPILER_ARG1 "${CMAKE_Pascal_FLAGS_ENV_INIT}" CACHE STRING "First argument to Pascal compiler")
+ endif(CMAKE_Pascal_FLAGS_ENV_INIT)
+ if(EXISTS ${CMAKE_Pascal_COMPILER_INIT})
+ else(EXISTS ${CMAKE_Pascal_COMPILER_INIT})
+ message(FATAL_ERROR "Could not find compiler set in environment variable FPC:\n$ENV{FPC}.")
+ endif(EXISTS ${CMAKE_Pascal_COMPILER_INIT})
+ endif($ENV{FPC} MATCHES ".+")
- # next try prefer the compiler specified by the generator
- IF(CMAKE_GENERATOR_PASCAL)
- IF(NOT CMAKE_Pascal_COMPILER_INIT)
- SET(CMAKE_Pascal_COMPILER_INIT ${CMAKE_GENERATOR_PASCAL})
- ENDIF(NOT CMAKE_Pascal_COMPILER_INIT)
- ENDIF(CMAKE_GENERATOR_PASCAL)
+ # next try prefer the compiler specified by the generator
+ if(CMAKE_GENERATOR_PASCAL)
+ if(NOT CMAKE_Pascal_COMPILER_INIT)
+ set(CMAKE_Pascal_COMPILER_INIT ${CMAKE_GENERATOR_PASCAL})
+ endif(NOT CMAKE_Pascal_COMPILER_INIT)
+ endif(CMAKE_GENERATOR_PASCAL)
- # finally list compilers to try
- IF(CMAKE_Pascal_COMPILER_INIT)
- SET(CMAKE_Pascal_COMPILER_LIST ${CMAKE_Pascal_COMPILER_INIT})
- ELSE(CMAKE_Pascal_COMPILER_INIT)
- SET(CMAKE_Pascal_COMPILER_LIST fpc)
- ENDIF(CMAKE_Pascal_COMPILER_INIT)
+ # finally list compilers to try
+ if(CMAKE_Pascal_COMPILER_INIT)
+ set(CMAKE_Pascal_COMPILER_LIST ${CMAKE_Pascal_COMPILER_INIT})
+ else(CMAKE_Pascal_COMPILER_INIT)
+ set(CMAKE_Pascal_COMPILER_LIST fpc)
+ endif(CMAKE_Pascal_COMPILER_INIT)
- # Find the compiler.
- FIND_PROGRAM(CMAKE_Pascal_COMPILER NAMES ${CMAKE_Pascal_COMPILER_LIST} DOC "Pascal compiler")
- IF(CMAKE_Pascal_COMPILER_INIT AND NOT CMAKE_Pascal_COMPILER)
- SET(CMAKE_Pascal_COMPILER "${CMAKE_Pascal_COMPILER_INIT}" CACHE FILEPATH "Pascal compiler" FORCE)
- ENDIF(CMAKE_Pascal_COMPILER_INIT AND NOT CMAKE_Pascal_COMPILER)
-ENDIF(NOT CMAKE_Pascal_COMPILER)
-MARK_AS_ADVANCED(CMAKE_Pascal_COMPILER)
+ # Find the compiler.
+ find_program(CMAKE_Pascal_COMPILER NAMES ${CMAKE_Pascal_COMPILER_LIST} DOC "Pascal compiler")
+ if(CMAKE_Pascal_COMPILER_INIT AND NOT CMAKE_Pascal_COMPILER)
+ set(CMAKE_Pascal_COMPILER "${CMAKE_Pascal_COMPILER_INIT}" CACHE FILEPATH "Pascal compiler" FORCE)
+ endif(CMAKE_Pascal_COMPILER_INIT AND NOT CMAKE_Pascal_COMPILER)
+endif(NOT CMAKE_Pascal_COMPILER)
+mark_as_advanced(CMAKE_Pascal_COMPILER)
if(NOT CMAKE_Pascal_COMPILER_VERSION)
- execute_process(COMMAND ${CMAKE_Pascal_COMPILER} -iV
- OUTPUT_VARIABLE CMAKE_Pascal_COMPILER_VERSION
- OUTPUT_STRIP_TRAILING_WHITESPACE
- ) # we assume no error for something so simple
+ execute_process(COMMAND ${CMAKE_Pascal_COMPILER} -iV
+ OUTPUT_VARIABLE CMAKE_Pascal_COMPILER_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ) # we assume no error for something so simple
endif(NOT CMAKE_Pascal_COMPILER_VERSION)
mark_as_advanced(CMAKE_Pascal_COMPILER_VERSION)
-GET_FILENAME_COMPONENT(COMPILER_LOCATION "${CMAKE_Pascal_COMPILER}" PATH)
+get_filename_component(COMPILER_LOCATION "${CMAKE_Pascal_COMPILER}" PATH)
# configure variables set in this file for fast reload later on
if(${CMAKE_VERSION} VERSION_LESS 2.8.10)
- CONFIGURE_FILE(${CMAKE_MODULE_PATH}/CMakePascalCompiler.cmake.in
- "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakePascalCompiler.cmake"
- IMMEDIATE )
+ configure_file(${CMAKE_MODULE_PATH}/CMakePascalCompiler.cmake.in
+ "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakePascalCompiler.cmake"
+ IMMEDIATE )
else(${CMAKE_VERSION} VERSION_LESS 2.8.10)
- CONFIGURE_FILE(${CMAKE_MODULE_PATH}/CMakePascalCompiler.cmake.in
- "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/${CMAKE_VERSION}/CMakePascalCompiler.cmake"
- IMMEDIATE )
+ configure_file(${CMAKE_MODULE_PATH}/CMakePascalCompiler.cmake.in
+ "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/${CMAKE_VERSION}/CMakePascalCompiler.cmake"
+ IMMEDIATE )
endif(${CMAKE_VERSION} VERSION_LESS 2.8.10)
-SET(CMAKE_Pascal_COMPILER_ENV_VAR "FPC")
+set(CMAKE_Pascal_COMPILER_ENV_VAR "FPC")
+
--- a/cmake_modules/CMakePascalCompiler.cmake.in Tue Mar 26 02:06:54 2013 +0100
+++ b/cmake_modules/CMakePascalCompiler.cmake.in Tue Mar 26 18:03:15 2013 +0100
@@ -1,12 +1,12 @@
-SET(CMAKE_Pascal_COMPILER "@CMAKE_Pascal_COMPILER@")
-SET(CMAKE_Pascal_COMPILER_ARG1 "@CMAKE_Pascal_COMPILER_ARG1@")
-SET(CMAKE_Pascal_COMPILER_LOADED 1)
-SET(CMAKE_Pascal_COMPILER_VERSION "@CMAKE_Pascal_COMPILER_VERSION@")
+set(CMAKE_Pascal_COMPILER "@CMAKE_Pascal_COMPILER@")
+set(CMAKE_Pascal_COMPILER_ARG1 "@CMAKE_Pascal_COMPILER_ARG1@")
+set(CMAKE_Pascal_COMPILER_LOADED 1)
+set(CMAKE_Pascal_COMPILER_VERSION "@CMAKE_Pascal_COMPILER_VERSION@")
-SET(CMAKE_Pascal_COMPILER_ENV_VAR "FPC")
+set(CMAKE_Pascal_COMPILER_ENV_VAR "FPC")
-SET(CMAKE_Pascal_SOURCE_FILE_EXTENSIONS "pas" "pp")
-SET(CMAKE_Pascal_IGNORE_EXTENSIONS ppu;PPU;h;H;o;O;obj;OBJ;def;DEF;rc;RC)
-SET(CMAKE_Pascal_LINKER_PREFERENCE Prefered)
-SET(CMAKE_Pascal_OUTPUT_EXTENSION_REPLACE 1)
-SET(CMAKE_Pascal_OUTPUT_EXTENSION ".o")
+set(CMAKE_Pascal_SOURCE_FILE_EXTENSIONS "pas" "pp")
+set(CMAKE_Pascal_IGNORE_EXTENSIONS ppu;PPU;h;H;o;O;obj;OBJ;def;DEF;rc;RC)
+set(CMAKE_Pascal_LINKER_PREFERENCE Prefered)
+set(CMAKE_Pascal_OUTPUT_EXTENSION_REPLACE 1)
+set(CMAKE_Pascal_OUTPUT_EXTENSION ".o")
--- a/cmake_modules/CMakePascalInformation.cmake Tue Mar 26 02:06:54 2013 +0100
+++ b/cmake_modules/CMakePascalInformation.cmake Tue Mar 26 18:03:15 2013 +0100
@@ -33,10 +33,10 @@
# so if these are not set just copy the flags from the c version
# No flags supported during linking as a shell script takes care of it
-IF(NOT CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS)
+if(NOT CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS)
#-dynamiclib -Wl,-headerpad_max_install_names for C
- SET(CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS)
+ set(CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
+endif(NOT CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS)
if(NOT CMAKE_SHARED_LIBRARY_Pascal_FLAGS)
#another similarity, fpc: -fPIC Same as -Cg
@@ -48,13 +48,13 @@
set(CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
endif(NOT CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS)
-#IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG)
-# SET(CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
-#ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG)
+#if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG)
+# set(CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
+#endif(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG)
-#IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG_SEP)
-# SET(CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
-#ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG_SEP)
+#if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG_SEP)
+# set(CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
+#endif(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Pascal_FLAG_SEP)
if(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG)
set(CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
@@ -69,21 +69,21 @@
endif(NOT CMAKE_MODULE_EXISTS)
# repeat for modules
-IF(NOT CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS)
- SET(CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS)
+if(NOT CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS)
+ set(CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
+endif(NOT CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS)
-IF(NOT CMAKE_SHARED_MODULE_Pascal_FLAGS)
- SET(CMAKE_SHARED_MODULE_Pascal_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_MODULE_Pascal_FLAGS)
+if(NOT CMAKE_SHARED_MODULE_Pascal_FLAGS)
+ set(CMAKE_SHARED_MODULE_Pascal_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
+endif(NOT CMAKE_SHARED_MODULE_Pascal_FLAGS)
-IF(NOT CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG)
- SET(CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG})
-ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG)
+if(NOT CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG)
+ set(CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG})
+endif(NOT CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG)
-IF(NOT CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG_SEP)
- SET(CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG_SEP ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG_SEP})
-ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG_SEP)
+if(NOT CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG_SEP)
+ set(CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG_SEP ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG_SEP})
+endif(NOT CMAKE_SHARED_MODULE_RUNTIME_Pascal_FLAG_SEP)
if(NOT CMAKE_INCLUDE_FLAG_Pascal)
#amazing, fpc: -I<x> Add <x> to include path
@@ -96,14 +96,14 @@
# Copy C version of this flag which is normally determined in platform file.
if(NOT CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG)
- set(CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
+ set(CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
endif(NOT CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG)
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.")
-INCLUDE(CMakeCommonLanguageInclude)
+include(CMakeCommonLanguageInclude)
# now define the following rule variables
@@ -146,15 +146,15 @@
endif(NOT CMAKE_Pascal_CREATE_SHARED_LIBRARY)
# create an Pascal shared module just copy the shared library rule
-IF(NOT CMAKE_Pascal_CREATE_SHARED_MODULE)
- SET(CMAKE_Pascal_CREATE_SHARED_MODULE ${CMAKE_Pascal_CREATE_SHARED_LIBRARY})
-ENDIF(NOT CMAKE_Pascal_CREATE_SHARED_MODULE)
+if(NOT CMAKE_Pascal_CREATE_SHARED_MODULE)
+ set(CMAKE_Pascal_CREATE_SHARED_MODULE ${CMAKE_Pascal_CREATE_SHARED_LIBRARY})
+endif(NOT CMAKE_Pascal_CREATE_SHARED_MODULE)
# create an Pascal static library (unsupported)
-IF(NOT CMAKE_Pascal_CREATE_STATIC_LIBRARY)
- SET(CMAKE_Pascal_CREATE_STATIC_LIBRARY
+if(NOT CMAKE_Pascal_CREATE_STATIC_LIBRARY)
+ set(CMAKE_Pascal_CREATE_STATIC_LIBRARY
"echo STATIC LIBRARIES ARE NOT SUPPORTED" "exit")
-ENDIF(NOT CMAKE_Pascal_CREATE_STATIC_LIBRARY)
+endif(NOT CMAKE_Pascal_CREATE_STATIC_LIBRARY)
# compile a Pascal file into an object file
if(NOT CMAKE_Pascal_COMPILE_OBJECT)
@@ -192,18 +192,18 @@
if(CMAKE_Pascal_STANDARD_LIBRARIES_INIT)
set(CMAKE_Pascal_STANDARD_LIBRARIES "${CMAKE_Pascal_STANDARD_LIBRARIES_INIT}"
CACHE STRING "Libraries linked by default (usually handled internally).")
- MARK_AS_ADVANCED(CMAKE_Pascal_STANDARD_LIBRARIES)
+ mark_as_advanced(CMAKE_Pascal_STANDARD_LIBRARIES)
endif(CMAKE_Pascal_STANDARD_LIBRARIES_INIT)
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
- SET (CMAKE_Pascal_FLAGS_DEBUG "${CMAKE_Pascal_FLAGS_DEBUG_INIT}" CACHE STRING
- "Flags used by the compiler during debug builds.")
- SET (CMAKE_Pascal_FLAGS_MINSIZEREL "${CMAKE_Pascal_FLAGS_MINSIZEREL_INIT}" CACHE STRING
- "Flags used by the compiler during release minsize builds.")
- SET (CMAKE_Pascal_FLAGS_RELEASE "${CMAKE_Pascal_FLAGS_RELEASE_INIT}" CACHE STRING
- "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
- SET (CMAKE_Pascal_FLAGS_RELWITHDEBINFO "${CMAKE_Pascal_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
- "Flags used by the compiler during Release with Debug Info builds.")
+ set(CMAKE_Pascal_FLAGS_DEBUG "${CMAKE_Pascal_FLAGS_DEBUG_INIT}" CACHE STRING
+ "Flags used by the compiler during debug builds.")
+ set(CMAKE_Pascal_FLAGS_MINSIZEREL "${CMAKE_Pascal_FLAGS_MINSIZEREL_INIT}" CACHE STRING
+ "Flags used by the compiler during release minsize builds.")
+ set(CMAKE_Pascal_FLAGS_RELEASE "${CMAKE_Pascal_FLAGS_RELEASE_INIT}" CACHE STRING
+ "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
+ set(CMAKE_Pascal_FLAGS_RELWITHDEBINFO "${CMAKE_Pascal_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
+ "Flags used by the compiler during Release with Debug Info builds.")
endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
mark_as_advanced(CMAKE_Pascal_FLAGS CMAKE_Pascal_FLAGS_DEBUG CMAKE_Pascal_FLAGS_MINSIZEREL
--- a/cmake_modules/CMakeTestPascalCompiler.cmake Tue Mar 26 02:06:54 2013 +0100
+++ b/cmake_modules/CMakeTestPascalCompiler.cmake Tue Mar 26 18:03:15 2013 +0100
@@ -3,50 +3,51 @@
# If not, a fatal error is set, cmake stops processing commands and will not
# generate any makefiles or projects.
-IF(NOT CMAKE_Pascal_COMPILER_WORKS)
- MESSAGE(STATUS "Check for working Pascal compiler: ${CMAKE_Pascal_COMPILER}")
- FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp/testpascalcompiler.pas
- "program testPascalCompiler;
- begin
- end.
- ")
+if(NOT CMAKE_Pascal_COMPILER_WORKS)
+ message(STATUS "Check for working Pascal compiler: ${CMAKE_Pascal_COMPILER}")
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp/testpascalcompiler.pas
+ "program testPascalCompiler;
+ begin
+ end.
+ ")
- FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp/CMakeLists.txt
- "set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules)
- set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL \"\" FORCE)
- project(test Pascal)
- add_executable(testpascalcompiler testpascalcompiler.pas)
- ")
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp/CMakeLists.txt
+ "set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules)
+ set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL \"\" FORCE)
+ project(test Pascal)
+ add_executable(testpascalcompiler testpascalcompiler.pas)
+ ")
# To avoid try_compile recurse error, use any binary directory other
# than ${CMAKE_BINARY_DIR}. The choice of
# bindir = ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp is
# especially advantageous since it makes an in-source build which
# means that no special variables need to be set to find files.
- try_compile(CMAKE_Pascal_COMPILER_WORKS
- ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp
- ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp
- projectName
- OUTPUT_VARIABLE RESULT_OUTPUT
- )
- SET(PASCAL_TEST_WAS_RUN 1)
-ENDIF(NOT CMAKE_Pascal_COMPILER_WORKS)
+ try_compile(CMAKE_Pascal_COMPILER_WORKS
+ ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp
+ ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp
+ projectName
+ OUTPUT_VARIABLE RESULT_OUTPUT
+ )
+ set(PASCAL_TEST_WAS_RUN 1)
+endif(NOT CMAKE_Pascal_COMPILER_WORKS)
-IF(NOT CMAKE_Pascal_COMPILER_WORKS)
- MESSAGE(STATUS "Check for working Pascal compiler: ${CMAKE_Pascal_COMPILER} -- broken")
- FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Determining if the Pascal compiler works failed with "
- "the following output:\n${RESULT_OUTPUT}\n\n")
- MESSAGE(FATAL_ERROR "The Pascal builder \"${CMAKE_Pascal_COMPILER}\" "
- "is not able to compile and link a simple test program.\nIt fails "
- "with the following output:\n ${RESULT_OUTPUT}\n\n"
- "CMake will not be able to correctly generate this project.")
-ELSE(NOT CMAKE_Pascal_COMPILER_WORKS)
- IF(PASCAL_TEST_WAS_RUN)
- MESSAGE(STATUS "Check for working Pascal compiler: ${CMAKE_Pascal_COMPILER} -- works")
- FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Determining if the Pascal compiler works passed with "
- "the following output:\n${RESULT_OUTPUT}\n\n")
- ENDIF(PASCAL_TEST_WAS_RUN)
- SET(CMAKE_Pascal_COMPILER_WORKS 1 CACHE INTERNAL "")
-ENDIF(NOT CMAKE_Pascal_COMPILER_WORKS)
+if(NOT CMAKE_Pascal_COMPILER_WORKS)
+ message(STATUS "Check for working Pascal compiler: ${CMAKE_Pascal_COMPILER} -- broken")
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining if the Pascal compiler works failed with "
+ "the following output:\n${RESULT_OUTPUT}\n\n")
+ message(FATAL_ERROR "The Pascal builder \"${CMAKE_Pascal_COMPILER}\" "
+ "is not able to compile and link a simple test program.\nIt fails "
+ "with the following output:\n ${RESULT_OUTPUT}\n\n"
+ "CMake will not be able to correctly generate this project.")
+else(NOT CMAKE_Pascal_COMPILER_WORKS)
+ if(PASCAL_TEST_WAS_RUN)
+ message(STATUS "Check for working Pascal compiler: ${CMAKE_Pascal_COMPILER} -- works")
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Determining if the Pascal compiler works passed with "
+ "the following output:\n${RESULT_OUTPUT}\n\n")
+ endif(PASCAL_TEST_WAS_RUN)
+ set(CMAKE_Pascal_COMPILER_WORKS 1 CACHE INTERNAL "")
+endif(NOT CMAKE_Pascal_COMPILER_WORKS)
+