Use INTERFACE to pass on unicode dependency

Linking the cxxopts library with the unicode libraries and specifying
INTERFACE should ensure executables that link with cxxopts will also
link with the unicode libraries.
This commit is contained in:
Mario Badr 2016-11-30 10:10:30 -05:00
parent 7851fc4b49
commit 6f022bbbe7
3 changed files with 7 additions and 2 deletions

View File

@ -57,6 +57,11 @@ target_include_directories(
cxxopts INTERFACE
include/
)
target_link_libraries(
cxxopts
INTERFACE ${CXXOPTS_LINKER_LIBRARIES}
)
add_subdirectory(src)
add_subdirectory(test)

View File

@ -20,7 +20,7 @@
if(CXXOPTS_BUILD_EXAMPLES)
add_executable(example example.cpp)
target_link_libraries(example cxxopts ${CXXOPTS_LINKER_LIBRARIES})
target_link_libraries(example cxxopts)
if (MSVC)
target_compile_options(example PUBLIC /W2)

View File

@ -1,6 +1,6 @@
if (CXXOPTS_BUILD_TESTS)
add_executable(options_test options.cpp)
target_link_libraries(options_test cxxopts ${CXXOPTS_LINKER_LIBRARIES})
target_link_libraries(options_test cxxopts)
if (MSVC)
target_compile_options(options_test PUBLIC /W2)