File tree Expand file tree Collapse file tree 6 files changed +21
-11
lines changed
Expand file tree Collapse file tree 6 files changed +21
-11
lines changed Original file line number Diff line number Diff line change 11# Used only for internal testing.
2- set (gz_library_path "${CMAKE_BINARY_DIR} /test/lib/ruby/gz/cmd${PROJECT_NAME} " )
2+ set (gz_library_path "${CMAKE_BINARY_DIR} /test/lib/$<CONFIG>/ ruby/gz/cmd${PROJECT_NAME} " )
33
44# Generate a configuration file for internal testing.
55# Note that the major version of the library is included in the name.
66# Ex: sdformat0.yaml
77configure_file (
88 "${PROJECT_NAME_NO_VERSION_LOWER} .yaml.in"
9- "${CMAKE_BINARY_DIR} /test/conf/${PROJECT_NAME} .yaml" @ONLY)
9+ "${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME} .yaml.configured" @ONLY)
10+
11+ file (GENERATE
12+ OUTPUT "${CMAKE_BINARY_DIR} /test/conf/$<CONFIG>/${PROJECT_NAME} .yaml"
13+ INPUT "${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME} .yaml.configured" )
1014
1115# Used for the installed version.
1216set (gz_library_path "${CMAKE_INSTALL_PREFIX} /lib/ruby/gz/cmd${PROJECT_NAME} " )
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ if (GZ_PROGRAM)
5050 add_custom_command (
5151 OUTPUT ${CMAKE_CURRENT_BINARY_DIR} /full_${desc_ver_dash} .sdf
5252 COMMAND
53- ${CMAKE_COMMAND} -E env GZ_CONFIG_PATH=${CMAKE_BINARY_DIR} /test /conf
53+ ${CMAKE_COMMAND} -E env GZ_CONFIG_PATH=${CMAKE_BINARY_DIR} /test /conf/$<CONFIG>
5454 ${GZ_PROGRAM}
5555 ARGS sdf -d ${desc_ver} > ${CMAKE_CURRENT_BINARY_DIR} /full_${desc_ver_dash} .sdf
5656 COMMENT "Generating full description for spec ${desc_ver} "
Original file line number Diff line number Diff line change @@ -61,6 +61,10 @@ if (BUILD_TESTING)
6161 XmlUtils.cc)
6262 endif ()
6363
64+ if (TARGET UNIT_gz_TEST)
65+ target_compile_definitions (UNIT_gz_TEST PUBLIC "-DDETAIL_GZ_CONFIG_PATH=\" ${CMAKE_BINARY_DIR} /test/conf/$<CONFIG>\" " )
66+ endif ()
67+
6468 if (TARGET UNIT_FrameSemantics_TEST)
6569 target_sources (UNIT_FrameSemantics_TEST PRIVATE FrameSemantics.cc Utils.cc)
6670 target_link_libraries (UNIT_FrameSemantics_TEST TINYXML2::TINYXML2)
@@ -126,6 +130,4 @@ target_include_directories(${PROJECT_LIBRARY_TARGET_NAME}
126130 ${CMAKE_CURRENT_SOURCE_DIR}
127131)
128132
129- if (NOT WIN32 )
130- add_subdirectory (cmd)
131- endif ()
133+ add_subdirectory (cmd)
Original file line number Diff line number Diff line change 22# Generate the ruby script for internal testing.
33# Note that the major version of the library is included in the name.
44# Ex: cmdsdformat0.rb
5- set (cmd_script_generated_test "${CMAKE_BINARY_DIR} /test/lib/ruby/gz/cmd${PROJECT_NAME} .rb" )
6- set (cmd_script_configured_test "${cmd_script_generated_test} .configured" )
5+ set (cmd_script_generated_test
6+ "${CMAKE_BINARY_DIR} /test/lib/$<CONFIG>/ruby/gz/cmd${PROJECT_NAME} .rb" )
7+ set (cmd_script_configured_test
8+ "${CMAKE_CURRENT_BINARY_DIR} /test_cmd${PROJECT_NAME} .rb.configured" )
79
810# Set the library_location variable to the full path of the library file within
911# the build directory.
@@ -24,8 +26,8 @@ file(GENERATE
2426# Generate the ruby script that gets installed.
2527# Note that the major version of the library is included in the name.
2628# Ex: cmdsdformat0.rb
27- set (cmd_script_generated "${CMAKE_CURRENT_BINARY_DIR} /cmd${PROJECT_NAME} .rb" )
28- set (cmd_script_configured "${cmd_script_generated} .configured" )
29+ set (cmd_script_generated "${CMAKE_CURRENT_BINARY_DIR} /$<CONFIG>/ cmd${PROJECT_NAME} .rb" )
30+ set (cmd_script_configured "${CMAKE_CURRENT_BINARY_DIR} /cmd ${PROJECT_NAME} .rb .configured" )
2931
3032# Set the library_location variable to the relative path to the library file
3133# within the install directory structure.
Original file line number Diff line number Diff line change 3636 #define pclose _pclose
3737#endif
3838
39+ // DETAIL_GZ_CONFIG_PATH is compiler definition set in CMake.
40+ #define GZ_CONFIG_PATH DETAIL_GZ_CONFIG_PATH
41+
3942static std::string SdfVersion ()
4043{
4144 return " --force-version " + std::string (SDF_VERSION_FULL);
Original file line number Diff line number Diff line change 1818#ifndef SDF_TEST_CONFIG_HH_
1919#define SDF_TEST_CONFIG_HH_
2020
21- #define GZ_CONFIG_PATH "@CMAKE_BINARY_DIR@/test/conf"
2221#define GZ_PATH "@GZ_PROGRAM@"
2322#define GZ_TEST_LIBRARY_PATH "${PROJECT_BINARY_DIR}/src:"\
2423 "@GZ-MSGS_LIBRARY_DIRS@:"
You can’t perform that action at this time.
0 commit comments