summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Hildebrandt <afh@surryhill.net>2023-06-10 17:18:13 +0200
committerGitHub <noreply@github.com>2023-06-10 17:18:13 +0200
commit37c1353969b6fe7a02c00c6085d41ccd02d8fab7 (patch)
treef709af69d94812b167b350566adf6dfda65f15f6
parentb59356351e240f7286febb599f6dfd1e6f6e4cb4 (diff)
parent8e64a1cf7009bbe7b89dc8bcb7abd00e39815b0b (diff)
downloadfork-ledger-37c1353969b6fe7a02c00c6085d41ccd02d8fab7.tar.gz
fork-ledger-37c1353969b6fe7a02c00c6085d41ccd02d8fab7.tar.bz2
fork-ledger-37c1353969b6fe7a02c00c6085d41ccd02d8fab7.zip
Merge pull request #2260 from afh/modernize-cmake
cmake: Replace add_defitions with superseding alternatives
-rw-r--r--CMakeLists.txt8
-rw-r--r--src/CMakeLists.txt6
2 files changed, 6 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ced9172c..ab17cedd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,12 +19,10 @@ set(Ledger_TEST_TIMEZONE "America/Chicago")
enable_testing()
-add_definitions(
- -std=c++11
- -DBOOST_FILESYSTEM_NO_DEPRECATED
-)
+add_compile_definitions(BOOST_FILESYSTEM_NO_DEPRECATED)
+add_compile_options(-std=c++11)
if (CYGWIN)
- add_definitions(-U__STRICT_ANSI__)
+ add_compile_options(-U__STRICT_ANSI__)
endif()
########################################################################
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f64ab839..4e0e23de 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -149,7 +149,7 @@ endif()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- add_definitions(
+ add_compile_options(
# -Weverything
# -Wno-disabled-macro-expansion
# -Wno-padded
@@ -223,7 +223,7 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
-Wno-deprecated
-Wno-strict-aliasing)
- add_definitions(${GXX_WARNING_FLAGS})
+ add_compile_options(${GXX_WARNING_FLAGS})
macro(ADD_PCH_RULE _header_filename _src_list _other_srcs)
set(_gch_filename "${_header_filename}.gch")
@@ -290,7 +290,7 @@ if (BUILD_LIBRARY)
set_source_files_properties(
${LEDGER_CLI_SOURCES} PROPERTIES COMPILE_FLAGS "-fPIC")
- add_executable(ledger main.cc global.cc)
+ add_executable(ledger ${LEDGER_CLI_SOURCES})
target_link_libraries(ledger libledger)
if (HAVE_GPGME)
target_link_libraries(ledger Gpgmepp)