diff options
| -rw-r--r-- | tests/projects/c/library_with_cmakelists/foo/CMakeLists.txt | 7 | ||||
| -rw-r--r-- | tests/projects/c/library_with_cmakelists/xmake.lua | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/tests/projects/c/library_with_cmakelists/foo/CMakeLists.txt b/tests/projects/c/library_with_cmakelists/foo/CMakeLists.txt index 4eca38b21..0745681e0 100644 --- a/tests/projects/c/library_with_cmakelists/foo/CMakeLists.txt +++ b/tests/projects/c/library_with_cmakelists/foo/CMakeLists.txt @@ -5,4 +5,11 @@ add_library(foo STATIC "") target_sources(foo PRIVATE src/foo.c ) +set_target_properties(foo PROPERTIES PUBLIC_HEADER src/foo.h) +include(GNUInstallDirs) +install(TARGETS foo + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) diff --git a/tests/projects/c/library_with_cmakelists/xmake.lua b/tests/projects/c/library_with_cmakelists/xmake.lua index bc3260373..4bf632e08 100644 --- a/tests/projects/c/library_with_cmakelists/xmake.lua +++ b/tests/projects/c/library_with_cmakelists/xmake.lua @@ -7,9 +7,7 @@ package("foo") local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - import("package.tools.cmake").build(package, configs, {buildir = "build"}) - os.cp("src/*.h", package:installdir("include")) - os.cp("build/*.a", package:installdir("lib")) + import("package.tools.cmake").install(package, configs, {buildir = "build"}) end) on_test(function (package) assert(package:has_cincludes("foo.h")) |
