This rewrite of the main CMakeLists.txt cleans up the way ICU flags are attached to the library target and adds the cmake helper files (cxxopts-config.cmake, cxxopts-config-version.cmake, cxxopts-targets.cmake) which are needed for exporting the cxxopts target. Cmake's find_package command uses these files when the library is consumed by another project. Additionally, two new tests have been added which build the example application via add_subdirectory and find_package.
12 lines
267 B
CMake
12 lines
267 B
CMake
cmake_minimum_required(VERSION 3.1)
|
|
|
|
project(cxxopts-test)
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
add_subdirectory(../.. cxxopts EXCLUDE_FROM_ALL)
|
|
|
|
add_executable(library-test "../../src/example.cpp")
|
|
target_link_libraries(library-test cxxopts)
|