@@ -3,8 +3,12 @@ project(painful-cpp-string-conversion VERSION 2.0.0 DESCRIPTION "Why the convers
3
3
4
4
option (PAINFUL_CPP_STRING_CONVERSION_ENABLE_TEST "Enable test" OFF )
5
5
6
- add_library (painful-cpp-string -conversion INTERFACE )
7
- target_include_directories (painful-cpp-string -conversion INTERFACE include )
6
+ set (LIB_NAME painful-cpp-string -conversion)
7
+ set (TEST_NAME painful-cpp-string -conversion-test )
8
+
9
+ add_library (${LIB_NAME} INTERFACE )
10
+ set_target_properties (${LIB_NAME} PROPERTIES PUBLIC_HEADER include /encoding /string .hpp)
11
+ target_include_directories (${LIB_NAME} INTERFACE include )
8
12
9
13
if (PAINFUL_CPP_STRING_CONVERSION_ENABLE_TEST)
10
14
add_library (simdutf STATIC )
@@ -15,12 +19,14 @@ if (PAINFUL_CPP_STRING_CONVERSION_ENABLE_TEST)
15
19
target_include_directories (simdutf PUBLIC external/simdutf)
16
20
target_sources (simdutf PRIVATE external/simdutf/simdutf.h external/simdutf/simdutf.cpp)
17
21
18
- set (TEST_NAME painful-cpp-string -conversion-test )
19
22
add_executable (${TEST_NAME} )
20
23
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" )
21
24
target_compile_options (${TEST_NAME} PRIVATE "/utf-8" )
22
25
endif ()
23
26
target_compile_features (${TEST_NAME} PRIVATE cxx_std_20)
24
27
target_sources (${TEST_NAME} PRIVATE test /test_string.cpp)
25
- target_link_libraries (${TEST_NAME} PRIVATE painful-cpp- string -conversion simdutf)
28
+ target_link_libraries (${TEST_NAME} PRIVATE ${LIB_NAME} simdutf)
26
29
endif ()
30
+
31
+ include (GNUInstallDirs)
32
+ install (TARGETS ${LIB_NAME} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} /encoding )
0 commit comments