Commit Graph

30 Commits

Author SHA1 Message Date
KOLANICH
5eca8a3001
Added CPack packaging, pkg-config and CMake version files. (#298) 2021-07-31 10:34:21 +10:00
jpr89
dc9a7728c0
Fixing cmake developer warning (#274)
Here is the warning currently being produced:

CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.19/Modules/GNUInstallDirs.cmake:223 (message):
Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
target architecture is known. Please enable at least one language before
including GNUInstallDirs.
Call Stack (most recent call first):

I noted how I fixed the error. This is caused by GNUInstallDirs automatically executing code just by including it.

I also added -Werror=dev to the CI to ensure this never happens again.

Co-authored-by: Juan Ramos <juanr0911@gmail.com>
2021-01-19 16:55:23 +11:00
jpr89
c55726ee29
Cmake Revamp (#270)
* Cmake Revamp

I needed to do a variety of things to ensure cxxopts worked well in my own project.

I created a new cmake module to abstract a lot of the logic in the main CMakelists.txt, I think it really assists in the readability of the project. Consequently a lot of logic is now written in functions.

I made a lot of the project options off by default unless the project is being built standalone. As a frequent consumer of cmake libraries this is a huge issue. Since examples, tests, installation, etc. aren't things I expect/desired by default when using libraries.

Co-authored-by: Juan Ramos <juanr0911@gmail.com>
2021-01-17 12:11:02 +11:00
Dan Ibanez
2d8e17c4f8
Add CMake option to not add warning flags (#267)
Allow extra compiler warnings to be disabled.
2020-12-15 08:47:52 +11:00
fiesh
66b52e6cc9
Add -Wsuggest-override (#264)
We also add the suggested `override` keyword.
2020-10-21 10:24:41 +11:00
Daniel Lemire
12e496da3d
Making sure that the library can compile without warnings even when crazy pedantic flags are set (#238)
Makes some fixes to satisfy various strict warnings.
2020-10-06 17:06:33 +11:00
Vitaly Zaitsev
584e0c3dd3
Fixed installation on other than Ubuntu GNU/Linux distributions. (#226)
Fixes the installation paths by using cmake variables.
2020-08-19 09:16:11 +10:00
Anders
6e31c227e2 Add CMake option CXXOPTS_ENABLE_INSTALL (#195)
Install targets will not be generated if this option is set to OFF,
which is useful when including it as a bundled dependency of
another project.
2019-08-01 17:51:01 +10:00
Anders
531c00b96f Define alias target cxxopts::cxxopts (#194) 2019-08-01 17:50:05 +10:00
avemilia
c19e267790 CMake: search only for C++ compiler (#192)
This speeds up the CMake configuration step by not searching for a C
compiler. By default, CMake looks for C and C++ compilers, unless a set
of compilation languages is specified.
2019-07-31 18:15:58 +10:00
Jarryd Beck
cd65c459ec Build the tests by default.
Fixes #143. There is no reason to make the tests optional.
2018-11-07 18:52:40 +11:00
Mario Werner
320d7a3d1a fixed version parsing in the CMake code (#128) 2018-10-29 18:51:26 +11:00
Jarryd Beck
cde83be99b Fix version numbering in CMakeLists.txt
Fixes #115. Read the version number out of `cxxopts.hpp` instead of
having to duplicate it in CMakeLists.txt.
2018-07-05 17:55:51 +10:00
Jarryd Beck
76bd60dc17 Add support for std::optional
Fixes #93. This adds C++17 only support for `std::optional` values for
command line parameters.
2018-01-31 18:25:52 +11:00
Mario Werner
11faadeba7 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.
2017-06-23 18:38:42 +10:00
Jarryd Beck
34aec8e87c Enable warnings and fix them
Fixes #50. This enables -Wall -Wextra -Wshadow and sets -Werror so that
the build fails if there are any warnings. All warnings that came up are
also fixed
2017-06-01 17:12:17 +10:00
Jarryd Beck
52f72a26e7 Version bump 2017-05-31 18:11:31 +10:00
Mario Badr
e005d07656 Use cmake interface library
Fixes #33.

This PR uses cmake's interface library feature:

  An INTERFACE library target does not directly create build output,
  though it may have properties set on it and it may be installed,
  exported and imported.

This makes it easier to include the header only library in a cmake
project. After using add_subdirectory on the cxxopts directory, one
simply needs to include cxxopts in their target_link_libraries, which
will allow the user's target to inherit the properties of the cxxopts
header library (see changes to example and test).
2016-12-03 07:50:14 +11:00
Jarryd Beck
f6bd09df63 change to ldflags 2016-12-02 18:05:58 +11:00
Jarryd Beck
78f3901d8d add pkg-config cflags 2016-12-02 07:56:41 +11:00
Jarryd Beck
55bfe49aa0 options test 2016-08-26 08:22:04 +10:00
Jarryd Beck
ca9d4e4825 update cmake version 2016-08-25 18:35:22 +10:00
Jarryd Beck
2d480c0228 add testing 2016-08-25 08:49:56 +10:00
Kevin Brightwell
774d455dc7 Update CMakeLists to be more configurable
* Add cxxopts.hpp as a source file to executable
* Add msvc options for compiling
* Add CXXOPTS_BUILD_EXAMPLES option to CMake build
  * This is helpful when using CMake's ExternalProject_add()
  * It is ON by default, but configurable from the command-line.
2016-06-15 20:32:32 -04:00
David Sánchez Falero
507a3a6ec5 Update CMakeLists.txt 2015-03-18 17:31:29 +01:00
David Sánchez
a1c6650189 biicode support added 2015-03-18 13:26:09 +01:00
Jarryd Beck
8d7c4ea43e unicode configuration 2014-10-27 22:06:24 +11:00
Jarryd Beck
9509ca94f2 unicode 2014-10-27 16:45:13 +11:00
Jarryd Beck
e19872b7c0 cmake copyright 2014-10-02 21:12:28 +10:00
Jarryd Beck
2deb5d87fb initial commit 2014-09-10 16:47:22 +10:00