Commit a8ccb474 authored by Ivan Lakhtanov's avatar Ivan Lakhtanov
Browse files

Fixed for build system from 'vaness-julia-backend' branch

parents 7e926426 b2521173
if(Julia_FOUND)
return()
endif()
# Looking for Julia executable
find_program(Julia_EXECUTABLE julia DOC "Julia executable")
if(NOT Julia_EXECUTABLE)
return()
endif()
# Getting Julia version
execute_process(
COMMAND ${Julia_EXECUTABLE} --version
OUTPUT_VARIABLE Julia_VERSION_STRING
RESULT_VARIABLE RETURN_CODE
)
if(RETURN_CODE EQUAL 0)
string(
REGEX REPLACE ".*([0-9]+\\.[0-9]+\\.[0-9]+).*" "\\1"
Julia_VERSION_STRING ${Julia_VERSION_STRING}
)
else()
return()
endif()
# Julia includes
execute_process(
COMMAND ${Julia_EXECUTABLE} -E "JULIA_HOME"
OUTPUT_VARIABLE Julia_INCLUDE_DIRS
RESULT_VARIABLE RETURN_CODE
)
if(RETURN_CODE EQUAL 0)
set(
Julia_INCLUDE_DIRS
"${Julia_INCLUDE_DIRS}/../include/julia"
)
string(REGEX REPLACE "(\"|\n)" "" Julia_INCLUDE_DIRS ${Julia_INCLUDE_DIRS})
string(STRIP Julia_INCLUDE_DIRS ${Julia_INCLUDE_DIRS})
set(
Julia_INCLUDE_DIRS ${Julia_INCLUDE_DIRS}
CACHE PATH "Location of Julia include files"
)
else()
return()
endif()
# Checking existance of main header. Some distos provide packages without actual includes
find_path(Julia_MAIN_HEADER julia.h HINTS ${Julia_INCLUDE_DIRS})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Julia
REQUIRED_VARS Julia_EXECUTABLE Julia_MAIN_HEADER Julia_INCLUDE_DIRS
VERSION_VAR Julia_VERSION_STRING
FAIL_MESSAGE "Julia not found"
)
......@@ -14,7 +14,6 @@ add_subdirectory(null)
add_subdirectory(maxima)
add_subdirectory(octave)
add_subdirectory(scilab)
add_subdirectory(julia)
if(NOT WIN32)
add_subdirectory(sage)
......@@ -90,3 +89,15 @@ find_package(LuaJIT)
if(LUAJIT_FOUND)
add_subdirectory(lua)
endif(LUAJIT_FOUND)
set_package_properties(
Julia
PROPERTIES DESCRIPTION "Julia is a high-level, high-performance dynamic programming language for technical computing"
URL "http://julialang.org/"
TYPE OPTIONAL
PURPOSE "Backend to use Julia with Cantor.")
find_package(Julia)
if(Julia_FOUND)
add_subdirectory(julia)
endif()
......@@ -6,7 +6,7 @@ set(JuliaServer_SRCS
add_executable(cantor_juliaserver ${JuliaServer_SRCS})
target_link_libraries(cantor_juliaserver
julia
${JULIA_LIBRARY}
Qt5::Widgets
Qt5::DBus
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment