File: CheckEnv.cmake

package info (click to toggle)
swi-prolog 8.2.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 78,084 kB
  • sloc: ansic: 362,656; perl: 322,276; java: 5,451; cpp: 4,625; sh: 3,047; ruby: 1,594; javascript: 1,509; yacc: 845; xml: 317; makefile: 156; sed: 12; sql: 6
file content (43 lines) | stat: -rw-r--r-- 1,316 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
function(conflicting_var name)
  message(WARNING
	  "-- Environment variable ${name} is set to $ENV{${name}}\n"
	  "This suggests that the variable is referring to a existing installation of SWI-Prolog. "
	  "This may conflict with building SWI-Prolog as this may cause the "
	  "build process to use components from such (older) installed version "
	  "of SWI-Prolog.  Make sure to remove this environment from the "
	  "environment before building the system.")
endfunction()

if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF" AND
   DEFINED ENV{LD_PRELOAD} AND
   "$ENV{LD_PRELOAD}" MATCHES swipl|swi-prolog)
  conflicting_var(LD_PRELOAD)
endif()

if(UNIX)
  if(APPLE)
    if(DEFINED ENV{DYLD_LIBRARY_PATH} AND
       "$ENV{DYLD_LIBRARY_PATH}" MATCHES swipl|swi-prolog)
      conflicting_var(DYLD_LIBRARY_PATH)
    endif()
  else()
    if(DEFINED ENV{LD_LIBRARY_PATH} AND
       "$ENV{LD_LIBRARY_PATH}" MATCHES swipl|swi-prolog)
      conflicting_var(LD_LIBRARY_PATH)
    endif()
  endif()
elseif(WIN32)
  if(DEFINED ENV{PATH} AND
     "$ENV{PATH}" MATCHES swipl|swi-prolog)
    conflicting_var(PATH)
  endif()
endif()

if(DEFINED ENV{SWI_HOME_DIR} AND
   IS_DIRECTORY "$ENV{SWI_HOME_DIR}")
  conflicting_var(SWI_HOME_DIR)
endif()
if(DEFINED ENV{SWIPL} AND
   IS_DIRECTORY "$ENV{SWIPL}")
  conflicting_var(SWIPL)
endif()