add basic cmake install system
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 11 Aug 2016 19:12:43 +0000 (22:12 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 11 Aug 2016 19:35:26 +0000 (22:35 +0300)
kms++/CMakeLists.txt
kms++util/CMakeLists.txt
py/CMakeLists.txt
utils/CMakeLists.txt

index d983964aa46e39ddc9c4fe79b2f42893c91db2d4..51ccc659e226c96fad4cbadd4b9c42b4ebb50876 100644 (file)
@@ -1,8 +1,9 @@
 include_directories(${LIBDRM_INCLUDE_DIRS})
 link_directories(${LIBDRM_LIBRARY_DIRS})
 
-file(GLOB SRCS "src/*.cpp" "src/*.h" "inc/kms++/*.h")
-add_library(kms++ ${SRCS})
+file(GLOB SRCS "src/*.cpp" "src/*.h")
+file(GLOB PUB_HDRS "inc/kms++/*.h")
+add_library(kms++ ${SRCS} ${PUB_HDRS})
 
 target_include_directories(kms++ PUBLIC
     $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
@@ -10,3 +11,11 @@ target_include_directories(kms++ PUBLIC
     PRIVATE src)
 
 target_link_libraries(kms++ ${LIBDRM_LIBRARIES})
+
+set_target_properties(kms++ PROPERTIES
+    PUBLIC_HEADER "${PUB_HDRS}")
+
+install(TARGETS kms++
+    LIBRARY DESTINATION lib
+    ARCHIVE DESTINATION lib
+    PUBLIC_HEADER DESTINATION include/kms++)
index 3977f7083d641fd31f933510c2c71ac92ea98ec6..2fc15e309823fdaa966428b5ae9fd531891bcf47 100644 (file)
@@ -1,5 +1,6 @@
-file(GLOB SRCS "src/*.cpp" "src/*.h" "inc/kms++util/*.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>
@@ -7,3 +8,11 @@ target_include_directories(kms++util PUBLIC
     PRIVATE src)
 
 target_link_libraries(kms++util kms++ pthread)
+
+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)
index 1349ea57200341c107183385f0e48cc0d27692c6..0cb4b99e06cedbe2358c4a8935bc82c62324950f 100644 (file)
@@ -23,3 +23,6 @@ add_test(NAME pytest COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/functest.py")
 set_property(TEST pytest PROPERTY
         ENVIRONMENT "PYTHONPATH=." "LD_LIBRARY_PATH=."
 )
+
+# XXX Where should pykms.so be installed?
+#install(TARGETS pykms DESTINATION lib)
index dd95f70a345a8dcbba6f6cebe8b33ab92540871f..0b154818667509536cc71f350c41be7215975c31 100644 (file)
@@ -24,3 +24,6 @@ target_link_libraries(wbcap kms++ kms++util ${LIBDRM_LIBRARIES})
 
 add_executable (wbm2m wbm2m.cpp)
 target_link_libraries(wbm2m kms++ kms++util ${LIBDRM_LIBRARIES})
+
+install(TARGETS testpat kmsprint fbtestpat
+    DESTINATION bin)