card: fix compile warning
[android/external-libkmsxx.git] / kms++util / CMakeLists.txt
index 533b4467b2509529a9aad6153206a9350b2524a7..2fc15e309823fdaa966428b5ae9fd531891bcf47 100644 (file)
@@ -1,5 +1,18 @@
-file(GLOB SRCS "*.cpp" "*.h")
-add_library(kms++util ${SRCS})
+file(GLOB SRCS "src/*.cpp" "src/*.h")
+file(GLOB PUB_HDRS "inc/kms++util/*.h")
+add_library(kms++util ${SRCS} ${PUB_HDRS})
+
+target_include_directories(kms++util PUBLIC
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
+    $<INSTALL_INTERFACE:include>
+    PRIVATE src)
 
 target_link_libraries(kms++util kms++ pthread)
 
 target_link_libraries(kms++util kms++ pthread)
-target_include_directories(kms++util PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+
+set_target_properties(kms++util PROPERTIES
+    PUBLIC_HEADER "${PUB_HDRS}")
+
+install(TARGETS kms++util
+    LIBRARY DESTINATION lib
+    ARCHIVE DESTINATION lib
+    PUBLIC_HEADER DESTINATION include/kms++util)