瀏覽代碼

install target

Patrik Kovacs 7 年之前
父節點
當前提交
87ced68fee
共有 1 個文件被更改,包括 15 次插入6 次删除
  1. 15 6
      CMakeLists.txt

+ 15 - 6
CMakeLists.txt

@@ -30,17 +30,21 @@ else ()
     message(WARNING "Doxygen not found")
 endif ()
 
-add_library(hdf4cpp
-        lib/HdfFile.cpp
-        lib/HdfItem.cpp
-        lib/HdfAttribute.cpp
-        lib/HdfException.cpp
+set(HEADERS
+        include/hdf4cpp/hdf.h
         include/hdf4cpp/HdfObject.h
         include/hdf4cpp/HdfAttribute.h
         include/hdf4cpp/HdfException.h
         include/hdf4cpp/HdfFile.h
         include/hdf4cpp/HdfItem.h
-        include/hdf4cpp/HdfDefines.h
+        include/hdf4cpp/HdfDefines.h)
+
+add_library(hdf4cpp
+        lib/HdfFile.cpp
+        lib/HdfItem.cpp
+        lib/HdfAttribute.cpp
+        lib/HdfException.cpp
+        ${HEADERS}
         )
 
 target_include_directories(hdf4cpp
@@ -95,3 +99,8 @@ add_test(
 )
 
 add_subdirectory(examples)
+
+install(TARGETS hdf4cpp DESTINATION lib)
+install(FILES ${HEADERS}
+        DESTINATION "include/hdf4cpp"
+        )