-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfind_julia.cmake
24 lines (19 loc) · 1.03 KB
/
find_julia.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# this script is intended to be included in CMakeLists.txt to find, verify and include the julia header
# detect julia directory
execute_process(
COMMAND ${JULIA_EXECUTABLE} -e "print(joinpath(Sys.BINDIR, \"..\"))"
OUTPUT_VARIABLE JULIA_DIR
)
if ("${JULIA_DIR}" STREQUAL "")
message(FATAL_ERROR "cannot determine location of julia executable. Please specify it manually by replacing the line\n\tset(JULIA_EXECUTABLE julia)\nwith\n\tset(JULIA_EXECUTABLE /path/to/your/executable)\nin ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt")
endif()
# assert julia version
execute_process(
COMMAND ${JULIA_EXECUTABLE} -e "print(Base.VERSION)"
OUTPUT_VARIABLE JULIA_VERSION
)
if ("${JULIA_VERSION}" LESS "1.7.0")
message(WARNING "julia version is ${JULIA_VERSION} but jluna uses version 1.7.0 or higher. Some features may not work correctly.\nYou can download the latest version at https://julialang.org/downloads/#current_stable_release")
endif()
# include dir of julia.h
include_directories(${JULIA_DIR}/include/julia/)