Skip to content

Commit

Permalink
add gettext to conan deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed Jun 3, 2023
1 parent ce42810 commit fbf3b34
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ if(EXTRA_LIBS)
link_directories(${EXTRA_LIBS})
endif(EXTRA_LIBS)

# setup conan
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/conanbuildinfo.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/conanbuildinfo.cmake")
conan_basic_setup()
endif()

# Find gettext
find_package(Gettext)

Expand Down
6 changes: 3 additions & 3 deletions cmake/FindGettext.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ if(NOT WIN32)
endif(GETTEXT_LIBRARY)
endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
else(NOT WIN32)
find_path(GETTEXT_INCLUDE libintl.h ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include gettext/include ${EXTRA_INCLUDE})
find_library(GETTEXT_LIBRARY libintl PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
find_program(GETTEXT_MSGFMT msgfmt PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/bin $ENV{VCINSTALLDIR}/bin gettext/bin ${EXTRA_INCLUDE})
find_path(GETTEXT_INCLUDE libintl.h)
find_library(GETTEXT_LIBRARY gnuintl)
find_program(GETTEXT_MSGFMT msgfmt)
if(GETTEXT_INCLUDE AND GETTEXT_LIBRARY AND GETTEXT_MSGFMT)
set(GETTEXT_FOUND TRUE)
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY})
Expand Down
6 changes: 3 additions & 3 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ set_target_properties(version-bin PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${L
get_target_property(version_BINARY version-bin LOCATION)
# Modify version.h from the above executable, with dependencies to version.cpp
# and all of the source files in the main build
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version_build
COMMAND ${version_BINARY} ${Anope_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h
COMMAND version-bin ${Anope_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h
DEPENDS version-bin ${SRC_SRCS}
)
# Add version-bin to list of files for CPack to ignore
Expand Down Expand Up @@ -61,4 +61,4 @@ if(USE_PCH AND CMAKE_COMPILER_IS_GNUCXX)
endif(USE_PCH AND CMAKE_COMPILER_IS_GNUCXX)

# Add a custom target to the above file
add_custom_target(headers DEPENDS version-bin ${CMAKE_CURRENT_BINARY_DIR}/version_build ${PCH_SOURCES_GCH})
add_custom_target(headers DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h ${PCH_SOURCES_GCH})
3 changes: 0 additions & 3 deletions modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ endif(WIN32)

# enable extra modules if conan is used
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../conanbuildinfo.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/../conanbuildinfo.cmake")
conan_basic_setup()

function(enable_extra NAME PACKAGE)
if(DEFINED "CONAN_${PACKAGE}_ROOT")
message("Enabling the ${NAME} module")
Expand Down
3 changes: 3 additions & 0 deletions src/win32/conanfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ libmysqlclient/8.0.31
openssl/1.1.1t
pcre2/10.42
sqlite3/3.41.1
gettext/0.21
libgettext/0.21

[options]
libmysqlclient/*:shared=True
openssl/*:shared=True
pcre2/*:shared=True
sqlite3/*:shared=True
libgettext/*:shared=True

[imports]
., *.dll -> extradll
Expand Down

0 comments on commit fbf3b34

Please sign in to comment.