3
3
#
4
4
# The cppp-reiconv library is free software; you can redistribute it
5
5
# and/or modify it under the terms of the GNU Lesser General Public
6
- # License as published by the Free Software Foundation; either version 2.1
6
+ # License as published by the Free Software Foundation; either version 3
7
7
# of the License, or (at your option) any later version.
8
8
#
9
9
# The cppp-reiconv library is distributed in the hope that it will be
16
16
# If not, see <https://www.gnu.org/licenses/>.
17
17
18
18
cmake_minimum_required (VERSION 3.12)
19
- project (cppp-reiconv VERSION 2.0 .0)
19
+ project (cppp-reiconv VERSION 2.1 .0)
20
20
21
21
# Define options
22
22
option (ENABLE_EXTRA "Enable extra encodings and features." OFF )
23
23
24
24
# Set C++ standard
25
25
set (CMAKE_CXX_STANDARD 11)
26
26
27
+ # ----------------------------------------------------------------------------------
28
+ # Import build-aux subdirectory.
27
29
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR} /build-aux" )
28
30
set (BUILD_AUX "${CMAKE_CURRENT_SOURCE_DIR} /build-aux" )
31
+ add_subdirectory ("${BUILD_AUX} " )
32
+ message (STATUS "Using '${BUILD_AUX} ' for C++ Plus build-aux directory." )
29
33
elseif (EXISTS "${CMAKE_CURRENT_SOURCE_DIR} /../build-aux" )
30
34
set (BUILD_AUX "${CMAKE_CURRENT_SOURCE_DIR} /../build-aux" )
31
35
else ()
32
36
message (FATAL_ERROR "CMake build-aux directory is not exists, try to execute 'setup.cmd' or './setup.sh' to get it." )
33
37
endif ()
34
- set (AUX_DIR "${BUILD_AUX} /cmake" )
38
+ get_filename_component (BUILD_AUX "${BUILD_AUX} " ABSOLUTE )
39
+ include ("${BUILD_AUX} /cmake/cppp.cmake" )
35
40
36
- message (STATUS "Using '${BUILD_AUX} ' for C++ Plus build-aux directory." )
37
- add_subdirectory ("${BUILD_AUX} " )
38
-
39
- include ("${AUX_DIR} /cppp.cmake" )
41
+ cppp_init_nls_util()
40
42
43
+ # ----------------------------------------------------------------------------------
41
44
check_have_visibility()
42
45
43
46
if (MSVC )
@@ -52,20 +55,21 @@ elseif(HAVE_VISIBILITY)
52
55
else ()
53
56
set (DLL_VARIABLE "" )
54
57
endif ()
55
- configure_file ("${srcdir } /include/cppp/reiconv.hpp.in" "${output_includedir} /cppp/reiconv.hpp" )
56
- configure_file ("${srcdir } /windows/libcppp-reiconv.rc.in" "${outdir } /windows/libcppp-reiconv.rc" )
58
+ configure_file ("${CMAKE_CURRENT_SOURCE_DIR } /include/cppp/reiconv.hpp.in" "${output_includedir} /cppp/reiconv.hpp" )
59
+ configure_file ("${CMAKE_CURRENT_SOURCE_DIR } /windows/libcppp-reiconv.rc.in" "${CMAKE_BINARY_DIR } /windows/libcppp-reiconv.rc" )
57
60
58
61
# Generate header file for install
59
62
if (WIN32 )
60
63
set (DLL_VARIABLE "__declspec(dllimport)" )
61
64
else ()
62
65
set (DLL_VARIABLE "" )
63
66
endif ()
64
- configure_file ("${srcdir} /include/cppp/reiconv.hpp.in" "${output_includedir} /cppp/reiconv.hpp.inst" )
67
+ configure_file ("${CMAKE_CURRENT_SOURCE_DIR} /include/cppp/reiconv.hpp.in" "${output_includedir} /cppp/reiconv.hpp.inst" )
68
+ cppp_nls_autotranslate("${output_includedir} /cppp/reiconv.hpp.inst" "${CMAKE_CURRENT_SOURCE_DIR} /lang" )
65
69
66
70
# Add includes
67
- include_directories ("${srcdir } /lib" )
68
- include_directories ("${srcdir } /lib/generated" )
71
+ include_directories ("${CMAKE_CURRENT_SOURCE_DIR } /lib" )
72
+ include_directories ("${CMAKE_CURRENT_SOURCE_DIR } /lib/generated" )
69
73
include_directories ("${output_includedir} " )
70
74
71
75
# Add definitions
@@ -75,7 +79,7 @@ if(ENABLE_EXTRA)
75
79
endif ()
76
80
77
81
# Add library
78
- cppp_build_library(${PROJECT_NAME} "${srcdir } /lib/iconv.cpp" TRUE TRUE "${outdir } /windows/libcppp-reiconv.rc" )
82
+ cppp_build_library(${PROJECT_NAME} "${CMAKE_CURRENT_SOURCE_DIR } /lib/iconv.cpp" TRUE TRUE "${CMAKE_BINARY_DIR } /windows/libcppp-reiconv.rc" )
79
83
80
84
# Include test suite.
81
85
include ("tests/tests.cmake" )
0 commit comments