Skip to content

Commit

Permalink
more tries at installer test
Browse files Browse the repository at this point in the history
  • Loading branch information
phlptp committed Aug 13, 2021
1 parent 6806410 commit 6ffdb26
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
docker:
- image: helics/buildenv:builder
environment:
CMAKE_FLAGS: '-DUNITS_BUILD_TESTS=ON -DUNITS_INSTALL_PACKAGE_TESTS=ON -DUNITS_BUILD_SHARED_LIBRARY=ON'
CMAKE_FLAGS: '-DUNITS_ENABLE_TESTS=ON -DUNITS_INSTALL_PACKAGE_TESTS=ON -DUNITS_BUILD_SHARED_LIBRARY=ON'
steps:
- checkout
- run: *setup_units
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,7 @@ if(UNITS_INSTALL)
if(UNITS_WITH_CMAKE_PACKAGE AND NOT UNITS_BINARY_ONLY_INSTALL)
install(EXPORT unitsConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/units)
export(EXPORT unitsConfig)
write_basic_package_version_file(${PROJECT_BINARY_DIR}/unitsConfigVersion.cmake COMPATIBILITY AnyNewerVersion)
install(FILES ${PROJECT_BINARY_DIR}/unitsConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/units)
endif()
endif()
8 changes: 4 additions & 4 deletions test/find_package_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ project(units-find-package-test)
include(CTest)

# Test the HELICS CMake package config
find_package(UNITS 0.5 REQUIRED)
find_package(units 0.4.8 REQUIRED)

# add some tests inside of the CMake

message(STATUS "Binary location is ${PROJECT_BINARY_DIR}")
# Test the CXX shared library target
if(UNITS_BUILD_SHARED_LIBRARY)
add_executable(shared-library-test-exe ../pkg_test_code/main.cpp)
target_link_libraries(shared-library-test-exe UNITS::units)
target_link_libraries(shared-library-test-exe units::units)

add_test(NAME shared-library-test COMMAND shared-library-test-exe)
set_property(
TEST shared-library-test PROPERTY PASS_REGULAR_EXPRESSION "${HELICS_VERSION}"
TEST shared-library-test PROPERTY PASS_REGULAR_EXPRESSION "10.7"
)

# Test the C and C++98 targets
elseif(UNITS_HEADER_ONLY)
add_executable(header_only-exe ../pkg_test_code/header_only.cpp)
target_link_libraries(header_only-exe UNITS::units_headers)
target_link_libraries(header_only-exe units::units_headers)

add_test(NAME header_only-exe COMMAND header_only-exe)
set_property(
Expand Down
2 changes: 1 addition & 1 deletion units/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ else()
endif()

if(UNITS_INSTALL AND NOT UNITS_BINARY_ONLY_INSTALL)
install(FILES ${units_header_files} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES ${units_header_files} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/units)
if(UNITS_BUILD_SHARED_LIBRARY OR BUILD_SHARED_LIBS)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/units_export.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/units
Expand Down

0 comments on commit 6ffdb26

Please sign in to comment.