From 06ccbae8c31ff5571c3bc9d7d60af35b1503a5bb Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Fri, 29 Oct 2021 18:05:30 -0700 Subject: [PATCH] Install ruby commands on windows This requires generating the .rb and .yaml files to folders unique to $. Part of ignitionrobotics/ign-tools#71. Signed-off-by: Steve Peters --- loader/CMakeLists.txt | 2 +- loader/conf/CMakeLists.txt | 8 ++++++-- loader/src/CMakeLists.txt | 4 +--- loader/src/cmd/CMakeLists.txt | 8 ++++---- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index 6b0b049e..4d53cd0b 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -44,7 +44,7 @@ endforeach() if(TARGET UNIT_ign_TEST) set(_env_vars) - list(APPEND _env_vars "IGN_CONFIG_PATH=${CMAKE_BINARY_DIR}/test/conf") + list(APPEND _env_vars "IGN_CONFIG_PATH=${CMAKE_BINARY_DIR}/test/conf/$") set_tests_properties(UNIT_ign_TEST PROPERTIES ENVIRONMENT "${_env_vars}") diff --git a/loader/conf/CMakeLists.txt b/loader/conf/CMakeLists.txt index 6e988372..fefd7c34 100644 --- a/loader/conf/CMakeLists.txt +++ b/loader/conf/CMakeLists.txt @@ -1,12 +1,16 @@ # Used only for internal testing. -set(ign_library_path "${CMAKE_BINARY_DIR}/test/lib/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}") +set(ign_library_path "${CMAKE_BINARY_DIR}/test/lib/$/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}") # Generate a configuration file for internal testing. # Note that the major version of the library is included in the name. # Ex: plugin1.yaml configure_file( "${IGN_DESIGNATION}.yaml.in" - "${CMAKE_BINARY_DIR}/test/conf/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml" @ONLY) + "${CMAKE_CURRENT_BINARY_DIR}/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml.configured" @ONLY) + +file(GENERATE + OUTPUT "${CMAKE_BINARY_DIR}/test/conf/$/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml" + INPUT "${CMAKE_CURRENT_BINARY_DIR}/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml.configured") # Used for the installed version. set(ign_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}") diff --git a/loader/src/CMakeLists.txt b/loader/src/CMakeLists.txt index eb84c64c..f880e721 100644 --- a/loader/src/CMakeLists.txt +++ b/loader/src/CMakeLists.txt @@ -1,4 +1,2 @@ # Command line support. -if(NOT WIN32) - add_subdirectory(cmd) -endif() +add_subdirectory(cmd) diff --git a/loader/src/cmd/CMakeLists.txt b/loader/src/cmd/CMakeLists.txt index 63d52354..f082e2f0 100644 --- a/loader/src/cmd/CMakeLists.txt +++ b/loader/src/cmd/CMakeLists.txt @@ -2,8 +2,8 @@ # Generate the ruby script for internal testing. # Note that the major version of the library is included in the name. # Ex: cmdplugin1.rb -set(cmd_script_generated_test "${CMAKE_BINARY_DIR}/test/lib/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb") -set(cmd_script_configured_test "${cmd_script_generated_test}.configured") +set(cmd_script_generated_test "${CMAKE_BINARY_DIR}/test/lib/$/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb") +set(cmd_script_configured_test "${CMAKE_CURRENT_BINARY_DIR}/test_cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb.configured") # Set the library_location variable to the full path of the library file within # the build directory. @@ -24,8 +24,8 @@ file(GENERATE # Generate the ruby script that gets installed. # Note that the major version of the library is included in the name. # Ex: cmdplugin1.rb -set(cmd_script_generated "${CMAKE_CURRENT_BINARY_DIR}/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb") -set(cmd_script_configured "${cmd_script_generated}.configured") +set(cmd_script_generated "${CMAKE_CURRENT_BINARY_DIR}/$/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb") +set(cmd_script_configured "${CMAKE_CURRENT_BINARY_DIR}/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb.configured") # Set the library_location variable to the relative path to the library file # within the install directory structure.