Skip to content

Commit 6903169

Browse files
authored
Merge pull request #1341 from azeey/voldivh/win_install_cmd
Use a compile definition for setting `GZ_CONFIG_PATH`
2 parents c63dbd7 + 0d34a61 commit 6903169

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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)

src/gz_TEST.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
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+
3942
static std::string SdfVersion()
4043
{
4144
return " --force-version " + std::string(SDF_VERSION_FULL);

test/CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
configure_file(test_config.hh.in ${PROJECT_BINARY_DIR}/include/test_config.hh.configured)
2-
3-
file(GENERATE
4-
OUTPUT ${PROJECT_BINARY_DIR}/include/test_config.hh
5-
INPUT ${PROJECT_BINARY_DIR}/include/test_config.hh.configured)
6-
1+
configure_file(test_config.hh.in ${PROJECT_BINARY_DIR}/include/test_config.hh)
72
include_directories(
83
${PROJECT_BINARY_DIR}/include
94
)

test/test_config.hh.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#ifndef SDF_TEST_CONFIG_HH_
1919
#define SDF_TEST_CONFIG_HH_
2020

21-
#define GZ_CONFIG_PATH "@CMAKE_BINARY_DIR@/test/conf/$<CONFIG>"
2221
#define GZ_PATH "@GZ_PROGRAM@"
2322
#define GZ_TEST_LIBRARY_PATH "${PROJECT_BINARY_DIR}/src:"\
2423
"@GZ-MSGS_LIBRARY_DIRS@:"

0 commit comments

Comments
 (0)