Browse Source

Fix conan package.

1. let argtable3 target carry include dir.
2. fix wrong target name in test_package.
3. skip running test binary when in cross mode.
pull/82/head
PengZheng 2 years ago
parent
commit
d1500ddf74
  1. 1
      src/CMakeLists.txt
  2. 2
      test_package/CMakeLists.txt
  3. 5
      test_package/conanfile.py

1
src/CMakeLists.txt

@ -95,6 +95,7 @@ endif()
install(TARGETS argtable3
EXPORT ${ARGTABLE3_PACKAGE_NAME}Config
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}

2
test_package/CMakeLists.txt

@ -47,7 +47,7 @@ if (CONAN_SETTINGS_OS)
target_link_libraries(${PROJECT_NAME} PUBLIC argtable3::argtable3 ${ARGTABLE3_EXTRA_LIBS})
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"$<TARGET_FILE:argtable3>"
"$<TARGET_FILE:argtable3::argtable3>"
"$<TARGET_FILE_DIR:${PROJECT_NAME}>"
)

5
test_package/conanfile.py

@ -14,5 +14,6 @@ class NewProjectTestConan(ConanFile):
cmake.build()
def test(self):
with tools.environment_append(RunEnvironment(self).vars):
self.run('ctest -C Debug --output-on-failure')
if not tools.cross_building(self, skip_x64_x86=True):
with tools.environment_append(RunEnvironment(self).vars):
self.run('ctest -C Debug --output-on-failure')

Loading…
Cancel
Save