From bda6d84fca537ae6fba4aebccc061b6abed5344d Mon Sep 17 00:00:00 2001
From: Gabriele Contini <contini.mailing@gmail.com>
Date: 周六, 30 11月 2019 16:20:10 +0800
Subject: [PATCH] update install targets

---
 test/library/CMakeLists.txt       |    6 +-----
 src/library/CMakeLists.txt        |   13 ++++++++-----
 test/functional/CMakeLists.txt    |    2 +-
 src/library/locate/CMakeLists.txt |    1 +
 CMakeLists.txt                    |    3 ++-
 src/library/os/CMakeLists.txt     |    2 +-
 src/library/base/CMakeLists.txt   |    2 +-
 7 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b58a488..0e38482 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -103,7 +103,6 @@
 )
 add_custom_target(project_initialize DEPENDS "${LCC_PROJECT_PUBLIC_KEY}" "${LCC_PROJECT_PRIVATE_KEY}")
 
-
 include_directories( ${LCC_INCLUDE_DIR} ${CMAKE_BINARY_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/include")
 
 message( STATUS "C compiler        : " ${CMAKE_C_COMPILER})
@@ -147,3 +146,5 @@
 	message(WARNING "Boost not found, disabling tests")
 ENDIF(Boost_FOUND)
 
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include)
+  
\ No newline at end of file
diff --git a/src/library/CMakeLists.txt b/src/library/CMakeLists.txt
index ad69712..dfe2d10 100644
--- a/src/library/CMakeLists.txt
+++ b/src/library/CMakeLists.txt
@@ -18,8 +18,11 @@
      base
 )
 
-install(TARGETS licensecc_static ARCHIVE DESTINATION lib)
-install(FILES api/datatypes.h api/license++.h DESTINATION include/api)
-install(FILES base/base.h DESTINATION include/base)
-install(FILES pc-identifiers.h DESTINATION include/)
-install(FILES ini/SimpleIni.h ini/ConvertUTF.h DESTINATION include/ini)
+target_include_directories(licensecc_static
+    INTERFACE 
+        $<INSTALL_INTERFACE:include/${PROJECT_NAME}>
+        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+)
+
+install(TARGETS licensecc_static ARCHIVE DESTINATION lib/${PROJECT_NAME}/${LCC_PROJECT_NAME})
+
diff --git a/src/library/base/CMakeLists.txt b/src/library/base/CMakeLists.txt
index deab8b0..95e9c52 100644
--- a/src/library/base/CMakeLists.txt
+++ b/src/library/base/CMakeLists.txt
@@ -8,4 +8,4 @@
 
 add_dependencies( base project_initialize )
 
-install(TARGETS base ARCHIVE DESTINATION lib)
+install(TARGETS base ARCHIVE DESTINATION lib/${PROJECT_NAME}/${LCC_PROJECT_NAME})
diff --git a/src/library/locate/CMakeLists.txt b/src/library/locate/CMakeLists.txt
index 4314fbd..2c10950 100644
--- a/src/library/locate/CMakeLists.txt
+++ b/src/library/locate/CMakeLists.txt
@@ -16,3 +16,4 @@
      base
 )
 
+install(TARGETS locators ARCHIVE DESTINATION lib/${PROJECT_NAME}/${LCC_PROJECT_NAME})
\ No newline at end of file
diff --git a/src/library/os/CMakeLists.txt b/src/library/os/CMakeLists.txt
index 861bf67..b5aaabe 100644
--- a/src/library/os/CMakeLists.txt
+++ b/src/library/os/CMakeLists.txt
@@ -28,4 +28,4 @@
 
 
 
-install(TARGETS os ARCHIVE DESTINATION lib)
+install(TARGETS os ARCHIVE DESTINATION lib/${PROJECT_NAME}/${LCC_PROJECT_NAME})
diff --git a/test/functional/CMakeLists.txt b/test/functional/CMakeLists.txt
index 8143ef5..cdcc680 100644
--- a/test/functional/CMakeLists.txt
+++ b/test/functional/CMakeLists.txt
@@ -4,7 +4,7 @@
 
 target_link_libraries(
 	license_generator_snippet
- 	license_generator_lib
+ 	${Boost_LIBRARIES}
 )
 
 add_executable(
diff --git a/test/library/CMakeLists.txt b/test/library/CMakeLists.txt
index dfb681a..481cacd 100644
--- a/test/library/CMakeLists.txt
+++ b/test/library/CMakeLists.txt
@@ -65,8 +65,4 @@
  ${Boost_LIBRARIES}
 )
 
-IF( ( CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") AND CMAKE_CROSSCOMPILING)
-	ADD_TEST(NAME test_event_registry COMMAND wine ${CMAKE_CURRENT_BINARY_DIR}/test_event_registry)
-ELSE()
-	ADD_TEST(NAME test_event_registry COMMAND test_event_registry)
-ENDIF()
+ADD_TEST(NAME test_event_registry COMMAND test_event_registry)

--
Gitblit v1.9.1