From 90cd254e072d926ec7acc294ab12a75f747875ae Mon Sep 17 00:00:00 2001 From: Giacomo Fiorin Date: Thu, 29 Dec 2022 11:33:05 -0500 Subject: [PATCH] Define CMAKE_SYSTEM_NAME in script mode --- devel-tools/build_test_library.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/devel-tools/build_test_library.cmake b/devel-tools/build_test_library.cmake index c8931b47a..481aa4859 100644 --- a/devel-tools/build_test_library.cmake +++ b/devel-tools/build_test_library.cmake @@ -7,6 +7,10 @@ else() get_filename_component(COLVARS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) endif() +if(NOT DEFINED CMAKE_SYSTEM_NAME) + set(CMAKE_SYSTEM_NAME ${CMAKE_HOST_SYSTEM_NAME}) +endif() + set(COLVARS_LEPTON ON) if(NOT DEFINED CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 11) @@ -25,7 +29,7 @@ if(NOT DEFINED COLVARS_TCL) set(COLVARS_TCL ON) endif() -if(DEFINED CMAKE_SYSTEM_NAME AND COLVARS_TCL) +if(DEFINED COLVARS_TCL) # If available, use pre-downloaded OS-specific TCL libraries