From a5a7d7156cf9283ab701419ef29a1808f36428ae Mon Sep 17 00:00:00 2001 From: PraneethJain Date: Mon, 4 Mar 2024 12:13:44 +0530 Subject: [PATCH] windows correct version --- .github/workflows/test-win.yml | 2 +- CMakeLists.txt | 1 + FindJulia.cmake | 18 +++++++----------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-win.yml b/.github/workflows/test-win.yml index 4628129..193d030 100644 --- a/.github/workflows/test-win.yml +++ b/.github/workflows/test-win.yml @@ -47,5 +47,5 @@ jobs: cd build cmake --build . --config Release julia -e "using Pkg; Pkg.Registry.add(\"General\"); Pkg.Registry.add(RegistrySpec(url = \"https://github.com/barche/CxxWrapTestRegistry.git\"))" - julia -e "using Pkg; pkg\"add CxxWrap#testjll\"; using CxxWrap;" + julia -e "using Pkg; pkg\"add ${{github.event.pull_request.body}}\"; using CxxWrap;" ctest -j 1 -C Release -V diff --git a/CMakeLists.txt b/CMakeLists.txt index 972ee6f..fcf4c6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ endif() # ============ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +set(Julia_PREFIX "/home/bp87/julia-1.10.1") find_package(Julia REQUIRED) set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${Julia_LIBRARY_DIR}") diff --git a/FindJulia.cmake b/FindJulia.cmake index 61c3754..fc72dd8 100644 --- a/FindJulia.cmake +++ b/FindJulia.cmake @@ -22,16 +22,12 @@ endif() # Julia Version # ################# -if(Julia_EXECUTABLE) - execute_process( - COMMAND "${Julia_EXECUTABLE}" --startup-file=no --version - OUTPUT_VARIABLE Julia_VERSION_STRING - ) -else() - find_file(Julia_VERSION_INCLUDE julia_version.h PATH_SUFFIXES include/julia) - file(READ ${Julia_VERSION_INCLUDE} Julia_VERSION_STRING) - string(REGEX MATCH "JULIA_VERSION_STRING.*" Julia_VERSION_STRING ${Julia_VERSION_STRING}) -endif() + +execute_process( + COMMAND " /home/bp87/julia-1.10.1/bin/julia" --startup-file=no --version + OUTPUT_VARIABLE Julia_VERSION_STRING +) + string( REGEX REPLACE ".*([0-9]+\\.[0-9]+\\.[0-9]+).*" "\\1" @@ -45,7 +41,7 @@ MESSAGE(STATUS "Julia_VERSION_STRING: ${Julia_VERSION_STRING}") ################## set(JULIA_HOME_NAME "Sys.BINDIR") -if(${Julia_VERSION_STRING} VERSION_LESS "0.7.0") +if("1.10.1" VERSION_LESS "0.7.0") set(JULIA_HOME_NAME "JULIA_HOME") else() set(USING_LIBDL "using Libdl")