Skip to content

Commit

Permalink
Check that CPU platform matches Tcl precompiled builds
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomofiorin committed May 13, 2024
1 parent 7fd7133 commit 148f4a7
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions devel-tools/build_test_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,30 @@ if(NOT DEFINED COLVARS_TCL)
endif()

if(DEFINED CMAKE_SYSTEM_NAME AND COLVARS_TCL)
# If available, use pre-downloaded TCL libraries
if(EXISTS "${COLVARS_SOURCE_DIR}/devel-tools/packages" AND DEFINED CMAKE_HOST_SYSTEM_PROCESSOR)

# If available, use pre-downloaded OS-specific TCL libraries

if(EXISTS "${COLVARS_SOURCE_DIR}/devel-tools/packages")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
set(TCL_DIR "${COLVARS_SOURCE_DIR}/devel-tools/packages/tcl8.6.13-linux-x86_64-threaded")
set(TCL_LIBRARY "libtcl8.6.a")
endif()

if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
set(TCL_DIR "${COLVARS_SOURCE_DIR}/devel-tools/packages/tcl8.5.9-win64")
set(TCL_LIBRARY "tcl85.lib")
endif()

if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" AND "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
set(TCL_DIR "${COLVARS_SOURCE_DIR}/devel-tools/packages/tcl8.5.9-macosx-x86_64-threaded")
set(TCL_LIBRARY "libtcl8.5.a")
endif()

set(DEFINE_TCL_DIR "-DTCL_DIR=${TCL_DIR}")
set(DEFINE_TCL_LIBRARY "-DTCL_LIBRARY=${TCL_DIR}/lib/${TCL_LIBRARY}")
endif()
if(DEFINED TCL_DIR)
set(DEFINE_TCL_DIR "-DTCL_DIR=${TCL_DIR}")
set(DEFINE_TCL_LIBRARY "-DTCL_LIBRARY=${TCL_DIR}/lib/${TCL_LIBRARY}")
endif()

endif()
endif()

if(COLVARS_LEPTON)
Expand Down

0 comments on commit 148f4a7

Please sign in to comment.