mirror of
https://github.com/jarro2783/cxxopts.git
synced 2026-08-22 14:18:02 +02:00
Cmake overhaul (#53)
* remove biicode support The company/startup died in 2015 and the open source project seems to be dead as well. * define compiler warning flags globally instead of locally for every binary * add support for cmake's find_package() (refs #52) 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. * removed target_sources from interface library Adding target_sources to interface libraries and exporting them is not supported in CMake 3.1 and 3.2. Furthermore, since it is a header, it is not needed at all. * use the *_LDFLAGS instead of *_LIBARIES when linking ICU The LIBRARIES variable seems to contain only the name and not the full path.
This commit is contained in:
@@ -21,10 +21,4 @@
|
||||
if(CXXOPTS_BUILD_EXAMPLES)
|
||||
add_executable(example example.cpp)
|
||||
target_link_libraries(example cxxopts)
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(example PUBLIC /W2)
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
target_compile_options(example PUBLIC -std=c++11 -Wall)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user