diff --git a/.circleci/config.yml b/.circleci/config.yml index 9d461c8f..6b36c4a2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fb620dc..68953df7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/test/find_package_tests/CMakeLists.txt b/test/find_package_tests/CMakeLists.txt index 3c79baf3..0f2a00b3 100644 --- a/test/find_package_tests/CMakeLists.txt +++ b/test/find_package_tests/CMakeLists.txt @@ -14,7 +14,7 @@ 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 @@ -22,17 +22,17 @@ 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( diff --git a/units/CMakeLists.txt b/units/CMakeLists.txt index cb7c0036..90450d42 100644 --- a/units/CMakeLists.txt +++ b/units/CMakeLists.txt @@ -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