Skip to content

Commit

Permalink
CMake: Add support for APR_HAVE_ICONV.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/apr/apr-util/branches/1.7.x@1921036 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Ivan Zhakov committed Sep 30, 2024
1 parent dba2a70 commit 9f1cf16
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ OPTION(APU_USE_LIBXML2 "Use LibXml2" OFF)
OPTION(BUILD_SHARED_LIBS "Build using shared libraries" ON)
CMAKE_DEPENDENT_OPTION(APU_DSO_BUILD "Use DSO build of modular components" ON "BUILD_SHARED_LIBS" OFF)
OPTION(APU_HAVE_CRYPTO "Crypto support" OFF)
option(APU_HAVE_ICONV "Xlate support" OFF)
OPTION(APU_HAVE_ODBC "Build ODBC DBD driver" ON)
OPTION(APU_HAVE_SQLITE3 "Build SQLite3 DBD driver" OFF)
OPTION(APU_HAVE_PGSQL "Build PostgreSQL DBD driver" OFF)
Expand Down Expand Up @@ -71,6 +72,10 @@ IF(APU_HAVE_CRYPTO)
FIND_PACKAGE(OpenSSL REQUIRED)
ENDIF()

IF(APU_HAVE_ICONV)
FIND_PACKAGE(Iconv REQUIRED)
ENDIF()

IF(APU_HAVE_SQLITE3)
FIND_PACKAGE(SQLite3 REQUIRED)
ENDIF()
Expand Down Expand Up @@ -107,6 +112,12 @@ ELSE()
SET(XMLLIB_LIBRARIES LibXml2::LibXml2)
ENDIF()

IF(APU_HAVE_ICONV)
SET(XLATE_LIBRARIES Iconv::Iconv)
ADD_COMPILE_DEFINITIONS(HAVE_ICONV_H)
ELSE()
SET(XLATE_LIBRARIES "")
ENDIF()

# Generated .h files are stored in PROJECT_BINARY_DIR, not the
# source tree.
Expand Down Expand Up @@ -339,7 +350,7 @@ ENDIF()
ADD_LIBRARY(libaprutil-1 ${APR_SOURCES} ${APU_EXTRA_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED})
LIST(APPEND install_targets libaprutil-1)
TARGET_LINK_LIBRARIES(libaprutil-1
PRIVATE ${XMLLIB_LIBRARIES} ${APU_EXTRA_LIBRARIES})
PRIVATE ${XMLLIB_LIBRARIES} ${XLATE_LIBRARIES} ${APU_EXTRA_LIBRARIES})
TARGET_INCLUDE_DIRECTORIES(libaprutil-1
PRIVATE ${APU_EXTRA_INCLUDE_DIRECTORIES})

Expand Down Expand Up @@ -454,6 +465,7 @@ MESSAGE(STATUS " DBD ODBC driver ................. : ${APU_HAVE_ODBC}")
MESSAGE(STATUS " DBD SQLite3 driver .............. : ${APU_HAVE_SQLITE3}")
MESSAGE(STATUS " DBD PostgreSQL .................. : ${APU_HAVE_PGSQL}")
MESSAGE(STATUS " APU_HAVE_CRYPTO ................. : ${APU_HAVE_CRYPTO}")
MESSAGE(STATUS " APU_HAVE_ICONV .................. : ${APU_HAVE_ICONV}")
MESSAGE(STATUS " APR_HAS_LDAP .................... : ${APR_HAS_LDAP}")
MESSAGE(STATUS " Use Expat ....................... : ${APU_USE_EXPAT}")
MESSAGE(STATUS " Use LibXml2 ..................... : ${APU_USE_LIBXML2}")
Expand Down
2 changes: 1 addition & 1 deletion include/apu.hwc
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
#endif

#define APU_HAVE_APR_ICONV @apu_have_apr_iconv_10@
#define APU_HAVE_ICONV 0
#cmakedefine01 APU_HAVE_ICONV
#define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)

#cmakedefine01 APU_USE_EXPAT
Expand Down

0 comments on commit 9f1cf16

Please sign in to comment.