2015-12-05 22:47:49 +01:00
|
|
|
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
|
|
|
|
2015-12-08 08:32:57 +01:00
|
|
|
# add project files
|
|
|
|
set(HEADER_FILES
|
|
|
|
application/argumentparser.h
|
|
|
|
application/commandlineutils.h
|
|
|
|
application/failure.h
|
|
|
|
application/fakeqtconfigarguments.h
|
|
|
|
application/global.h
|
|
|
|
chrono/datetime.h
|
|
|
|
chrono/period.h
|
|
|
|
chrono/timespan.h
|
2016-08-30 19:59:04 +02:00
|
|
|
chrono/format.h
|
2015-12-08 08:32:57 +01:00
|
|
|
conversion/binaryconversion.h
|
|
|
|
conversion/binaryconversionprivate.h
|
|
|
|
conversion/conversionexception.h
|
|
|
|
conversion/stringconversion.h
|
|
|
|
conversion/types.h
|
|
|
|
conversion/widen.h
|
|
|
|
io/ansiescapecodes.h
|
|
|
|
io/binaryreader.h
|
|
|
|
io/binarywriter.h
|
|
|
|
io/bitreader.h
|
|
|
|
io/copy.h
|
|
|
|
io/inifile.h
|
|
|
|
io/path.h
|
2016-06-14 22:53:19 +02:00
|
|
|
io/catchiofailure.h
|
2015-12-08 08:32:57 +01:00
|
|
|
math/math.h
|
|
|
|
misc/memory.h
|
|
|
|
misc/random.h
|
2016-11-13 22:51:09 +01:00
|
|
|
misc/traits.h
|
2016-02-06 02:52:06 +01:00
|
|
|
tests/testutils.h
|
|
|
|
tests/cppunit.h
|
2015-12-08 08:32:57 +01:00
|
|
|
)
|
|
|
|
set(SRC_FILES
|
|
|
|
application/argumentparser.cpp
|
|
|
|
application/commandlineutils.cpp
|
|
|
|
application/failure.cpp
|
|
|
|
application/fakeqtconfigarguments.cpp
|
|
|
|
chrono/datetime.cpp
|
|
|
|
chrono/period.cpp
|
|
|
|
chrono/timespan.cpp
|
|
|
|
conversion/conversionexception.cpp
|
|
|
|
conversion/stringconversion.cpp
|
|
|
|
io/ansiescapecodes.cpp
|
|
|
|
io/binaryreader.cpp
|
|
|
|
io/binarywriter.cpp
|
|
|
|
io/bitreader.cpp
|
|
|
|
io/inifile.cpp
|
|
|
|
io/path.cpp
|
2016-06-14 22:53:19 +02:00
|
|
|
io/catchiofailure.cpp
|
2015-12-08 08:32:57 +01:00
|
|
|
math/math.cpp
|
|
|
|
misc/random.cpp
|
2016-02-06 02:52:06 +01:00
|
|
|
tests/testutils.cpp
|
2015-12-08 08:32:57 +01:00
|
|
|
)
|
2016-04-16 00:50:16 +02:00
|
|
|
|
2016-01-25 23:59:52 +01:00
|
|
|
set(TEST_HEADER_FILES
|
|
|
|
|
|
|
|
)
|
|
|
|
set(TEST_SRC_FILES
|
|
|
|
tests/cppunit.cpp
|
|
|
|
tests/conversiontests.cpp
|
|
|
|
tests/iotests.cpp
|
2016-01-27 01:01:43 +01:00
|
|
|
tests/chronotests.cpp
|
2016-06-12 01:56:57 +02:00
|
|
|
tests/argumentparsertests.cpp
|
2016-01-25 23:59:52 +01:00
|
|
|
)
|
2015-12-08 08:32:57 +01:00
|
|
|
|
2016-04-16 00:50:16 +02:00
|
|
|
set(CMAKE_MODULE_FILES
|
|
|
|
cmake/modules/BasicConfig.cmake
|
2016-08-03 17:33:26 +02:00
|
|
|
cmake/modules/ConfigHeader.cmake
|
2016-04-16 00:50:16 +02:00
|
|
|
cmake/modules/LibraryTarget.cmake
|
|
|
|
cmake/modules/TestTarget.cmake
|
|
|
|
cmake/modules/AppTarget.cmake
|
|
|
|
cmake/modules/WindowsResources.cmake
|
2016-06-09 22:57:51 +02:00
|
|
|
cmake/modules/TemplateFinder.cmake
|
|
|
|
cmake/modules/Doxygen.cmake
|
|
|
|
cmake/modules/ListToString.cmake
|
2016-07-03 22:36:48 +02:00
|
|
|
cmake/modules/ShellCompletion.cmake
|
2016-07-22 01:35:32 +02:00
|
|
|
cmake/modules/3rdParty.cmake
|
2016-04-16 00:50:16 +02:00
|
|
|
)
|
|
|
|
set(CMAKE_TEMPLATE_FILES
|
2016-09-11 21:02:20 +02:00
|
|
|
cmake/templates/bash-completion.sh.in
|
2016-04-16 00:50:16 +02:00
|
|
|
cmake/templates/Config.cmake.in
|
|
|
|
cmake/templates/config.h.in
|
|
|
|
cmake/templates/desktop.in
|
2016-06-09 22:57:51 +02:00
|
|
|
cmake/templates/doxygen.in
|
2016-09-11 21:02:20 +02:00
|
|
|
cmake/templates/global.h.in
|
|
|
|
cmake/templates/template.pc.in
|
2016-04-16 00:50:16 +02:00
|
|
|
)
|
2016-09-11 20:30:45 +02:00
|
|
|
set(SCRIPT_FILES)
|
2016-04-16 00:50:16 +02:00
|
|
|
if(MINGW)
|
|
|
|
list(APPEND CMAKE_TEMPLATE_FILES
|
2016-09-11 20:30:45 +02:00
|
|
|
cmake/templates/windows.rc.in
|
|
|
|
)
|
|
|
|
list(APPEND SCRIPT_FILES
|
|
|
|
scripts/wine.sh
|
2016-04-16 00:50:16 +02:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2016-06-10 22:59:22 +02:00
|
|
|
set(DOC_FILES
|
|
|
|
README.md
|
|
|
|
)
|
|
|
|
|
2016-04-16 00:50:16 +02:00
|
|
|
# required to include CMake modules from own project directory
|
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" "${CMAKE_MODULE_PATH}")
|
|
|
|
|
2015-12-05 22:47:49 +01:00
|
|
|
# meta data
|
|
|
|
set(META_PROJECT_NAME c++utilities)
|
2016-04-16 00:50:16 +02:00
|
|
|
set(META_PROJECT_VARNAME CPP_UTILITIES)
|
2015-12-05 22:47:49 +01:00
|
|
|
set(META_APP_NAME "C++ Utilities")
|
|
|
|
set(META_APP_AUTHOR "Martchus")
|
|
|
|
set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}")
|
2016-07-22 01:35:32 +02:00
|
|
|
set(META_APP_DESCRIPTION "Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities")
|
2016-05-01 20:09:20 +02:00
|
|
|
set(META_VERSION_MAJOR 4)
|
2016-10-30 00:37:28 +02:00
|
|
|
set(META_VERSION_MINOR 3)
|
|
|
|
set(META_VERSION_PATCH 0)
|
2015-12-05 22:47:49 +01:00
|
|
|
|
2016-07-27 18:16:51 +02:00
|
|
|
# find required 3rd party libraries
|
|
|
|
include(3rdParty)
|
2016-08-19 16:13:41 +02:00
|
|
|
use_iconv(AUTO_LINKAGE REQUIRED)
|
2016-07-27 18:16:51 +02:00
|
|
|
|
2016-04-16 00:50:16 +02:00
|
|
|
# include modules to apply configuration
|
|
|
|
include(BasicConfig)
|
|
|
|
include(WindowsResources)
|
|
|
|
include(LibraryTarget)
|
|
|
|
include(TestTarget)
|
2016-06-09 22:57:51 +02:00
|
|
|
include(Doxygen)
|
2016-07-27 21:38:40 +02:00
|
|
|
include(ConfigHeader)
|