Skip to content

Commit 385141e

Browse files
committed
find_program, link to fs
Signed-off-by: Louise Poubel <louise@openrobotics.org>
1 parent 50f59d5 commit 385141e

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

CMakeLists.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ find_package(ignition-cmake2 2.8.0 REQUIRED)
1616
#============================================================================
1717
ign_configure_project()
1818

19+
if (UNIX AND NOT APPLE)
20+
set (EXTRA_TEST_LIB_DEPS stdc++fs)
21+
else()
22+
set (EXTRA_TEST_LIB_DEPS)
23+
endif()
24+
1925
#============================================================================
2026
# Set project-specific options
2127
#============================================================================
@@ -69,11 +75,11 @@ ign_find_package(ignition-math6 REQUIRED)
6975
set(IGN_MATH_VER ${ignition-math6_VERSION_MAJOR})
7076

7177
#--------------------------------------
72-
# Find if ign command is available
78+
# Find if command is available. This is used to enable tests.
79+
# Note that CLI files are installed regardless of whether the dependency is
80+
# available during build time
7381
find_program(HAVE_IGN_TOOLS ign)
74-
if (HAVE_IGN_TOOLS)
75-
set(IGN_TOOLS_VER 1)
76-
endif()
82+
set(IGN_TOOLS_VER 1)
7783

7884
#--------------------------------------
7985
# Find Tinyxml2

src/cmd/CMakeLists.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@ install(FILES ${cmd_script_generated} DESTINATION lib/ruby/ignition)
5151
configure_file(
5252
"msgs.bash_completion.sh"
5353
"${CMAKE_CURRENT_BINARY_DIR}/msgs${PROJECT_VERSION_MAJOR}.bash_completion.sh" @ONLY)
54-
if (HAVE_IGN_TOOLS)
55-
install(
56-
FILES
57-
${CMAKE_CURRENT_BINARY_DIR}/msgs${PROJECT_VERSION_MAJOR}.bash_completion.sh
58-
DESTINATION
59-
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/gz/gz${IGN_TOOLS_VER}.completion.d)
60-
endif()
54+
install(
55+
FILES
56+
${CMAKE_CURRENT_BINARY_DIR}/msgs${PROJECT_VERSION_MAJOR}.bash_completion.sh
57+
DESTINATION
58+
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/gz/gz${IGN_TOOLS_VER}.completion.d)

tools/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ if (MSVC)
1212
list(REMOVE_ITEM test_sources ign_TEST.cc)
1313
endif()
1414

15-
1615
if (HAVE_IGN_TOOLS)
17-
ign_build_tests(TYPE UNIT SOURCES ${test_sources})
16+
ign_build_tests(
17+
TYPE UNIT
18+
SOURCES ${test_sources}
19+
LIB_DEPS
20+
${EXTRA_TEST_LIB_DEPS})
1821
endif ()

0 commit comments

Comments
 (0)