Skip to content

Commit

Permalink
Do not search for ICU if already found
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumekln committed Sep 14, 2020
1 parent 8374c7c commit 161bd58
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
endif()

find_package(ICU REQUIRED)
if(NOT DEFINED ICU_INCLUDE_DIRS OR NOT DEFINED ICU_LIBRARIES)
find_package(ICU REQUIRED)
endif()

set(INCLUDE_DIRECTORIES
PUBLIC
Expand Down Expand Up @@ -90,7 +92,7 @@ include(GNUInstallDirs)
include(GenerateExportHeader)
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
generate_export_header(${PROJECT_NAME} EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/onmt/${PROJECT_NAME_LOWER}_export.h)
target_include_directories(${PROJECT_NAME} PUBLIC ${INCLUDE_DIRECTORIES})
target_include_directories(${PROJECT_NAME} ${INCLUDE_DIRECTORIES})
target_link_libraries(${PROJECT_NAME} ${LINK_LIBRARIES})

if (NOT LIB_ONLY)
Expand Down

0 comments on commit 161bd58

Please sign in to comment.