author | nemo |
Fri, 12 Apr 2019 11:41:35 -0400 | |
changeset 14797 | 38e66519e585 |
parent 8866 | 26424c644306 |
permissions | -rw-r--r-- |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
1 |
# This file is used by EnableLanguage in cmGlobalGenerator to determine that |
8758
cb3b470f1000
better support for cmake directory and fpc output paths
koda
parents:
8754
diff
changeset
|
2 |
# the FreePascal can actually compile and link the most basic of programs. |
cb3b470f1000
better support for cmake directory and fpc output paths
koda
parents:
8754
diff
changeset
|
3 |
# If not, a fatal error is set, cmake stops processing commands and will not |
cb3b470f1000
better support for cmake directory and fpc output paths
koda
parents:
8754
diff
changeset
|
4 |
# generate any makefiles or projects. |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
5 |
|
8859 | 6 |
if(NOT CMAKE_Pascal_COMPILER_WORKS) |
7 |
message(STATUS "Check for working Pascal compiler: ${CMAKE_Pascal_COMPILER}") |
|
8 |
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp/testpascalcompiler.pas |
|
9 |
"program testPascalCompiler; |
|
10 |
begin |
|
11 |
end. |
|
12 |
") |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
13 |
|
8859 | 14 |
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp/CMakeLists.txt |
15 |
"set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules) |
|
16 |
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL \"\" FORCE) |
|
17 |
project(test Pascal) |
|
18 |
add_executable(testpascalcompiler testpascalcompiler.pas) |
|
19 |
") |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
20 |
|
8758
cb3b470f1000
better support for cmake directory and fpc output paths
koda
parents:
8754
diff
changeset
|
21 |
# To avoid try_compile recurse error, use any binary directory other |
cb3b470f1000
better support for cmake directory and fpc output paths
koda
parents:
8754
diff
changeset
|
22 |
# than ${CMAKE_BINARY_DIR}. The choice of |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
23 |
# bindir = ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp is |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
24 |
# especially advantageous since it makes an in-source build which |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
25 |
# means that no special variables need to be set to find files. |
8859 | 26 |
try_compile(CMAKE_Pascal_COMPILER_WORKS |
27 |
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp |
|
28 |
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp |
|
8866 | 29 |
test |
8859 | 30 |
OUTPUT_VARIABLE RESULT_OUTPUT |
31 |
) |
|
32 |
set(PASCAL_TEST_WAS_RUN 1) |
|
33 |
endif(NOT CMAKE_Pascal_COMPILER_WORKS) |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
34 |
|
8859 | 35 |
if(NOT CMAKE_Pascal_COMPILER_WORKS) |
36 |
message(STATUS "Check for working Pascal compiler: ${CMAKE_Pascal_COMPILER} -- broken") |
|
37 |
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeError.log |
|
38 |
"Determining if the Pascal compiler works failed with " |
|
39 |
"the following output:\n${RESULT_OUTPUT}\n\n") |
|
40 |
message(FATAL_ERROR "The Pascal builder \"${CMAKE_Pascal_COMPILER}\" " |
|
41 |
"is not able to compile and link a simple test program.\nIt fails " |
|
42 |
"with the following output:\n ${RESULT_OUTPUT}\n\n" |
|
43 |
"CMake will not be able to correctly generate this project.") |
|
44 |
else(NOT CMAKE_Pascal_COMPILER_WORKS) |
|
45 |
if(PASCAL_TEST_WAS_RUN) |
|
46 |
message(STATUS "Check for working Pascal compiler: ${CMAKE_Pascal_COMPILER} -- works") |
|
47 |
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeOutput.log |
|
48 |
"Determining if the Pascal compiler works passed with " |
|
49 |
"the following output:\n${RESULT_OUTPUT}\n\n") |
|
50 |
endif(PASCAL_TEST_WAS_RUN) |
|
51 |
set(CMAKE_Pascal_COMPILER_WORKS 1 CACHE INTERNAL "") |
|
52 |
endif(NOT CMAKE_Pascal_COMPILER_WORKS) |
|
53 |