From 04168987218649d7ff0a6cff7f2c39cacb85c5b9 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Tue, 27 Dec 2022 16:12:36 +0700 Subject: [PATCH 1/1] Fix install targets See: https://github.com/NetBSD/pkgsrc/tree/trunk/math/libfixmath/patches In addition, duplicate liblib* has been fixed. --- CMakeLists.txt 2023-08-08 14:08:53.000000000 +0800 +++ CMakeLists.txt 2023-08-26 19:09:01.000000000 +0800 @@ -12,18 +12,25 @@ include(libfixmath/libfixmath.cmake) -if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) +# if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) # We're in the root, define additional targets for developers. include(tests/tests.cmake) file(GLOB fixsingen-srcs fixsingen/*.c) - file(GLOB fixtest-srcs fixtest/*.c fixtest/*.h) + file(GLOB fixtest-srcs fixtest/*.c) add_executable(fixtest ${fixtest-srcs}) - target_link_libraries(fixtest PRIVATE libfixmath m) + target_link_libraries(fixtest PRIVATE fixmath m) target_include_directories(fixtest PRIVATE ${CMAKE_SOURCE_DIR}) add_executable(fixsingen ${fixsingen-srcs}) - target_link_libraries(fixsingen PRIVATE libfixmath m) + target_link_libraries(fixsingen PRIVATE fixmath m) target_include_directories(fixsingen PRIVATE ${CMAKE_SOURCE_DIR}) -endif() +# endif() + +install(TARGETS fixmath + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +) + +install(FILES ${libfixmath-includes} DESTINATION include/libfixmath) diff --git a/libfixmath/libfixmath.cmake b/libfixmath/libfixmath.cmake index 138b1de..b92e677 100644 --- libfixmath/libfixmath.cmake +++ libfixmath/libfixmath.cmake @@ -1,6 +1,9 @@ file(GLOB libfixmath-srcs libfixmath/*.c) +file(GLOB libfixmath-includes libfixmath/*.h libfixmath/*.hpp) -add_library(libfixmath STATIC ${libfixmath-srcs}) +add_library(fixmath ${libfixmath-srcs}) -target_include_directories(libfixmath INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file +target_include_directories(fixmath INTERFACE + $ + $ +)