From 5ffd6963a1187de5f753cad768658983538c0fbf Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Tue, 4 May 2021 18:24:50 +0200 Subject: CMakeLists.txt: Fix GTest path --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9588e19..81950d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,7 +97,13 @@ include_directories (${CMAKE_CURRENT_BINARY_DIR}/include) # testing & coverage if (${enable_tests}) pkg_check_modules (DBUSTEST REQUIRED dbustest-1>=14.04.0) - set (GTEST_SOURCE_DIR /usr/src/gtest/src) + + if (EXISTS /usr/src/googletest/src) + set (GTEST_SOURCE_DIR /usr/src/googletest/src) + else () + set (GTEST_SOURCE_DIR /usr/src/gtest/src) + endif () + set (GTEST_INCLUDE_DIR ${GTEST_SOURCE_DIR}/..) set (GTEST_LIBS -lpthread) enable_testing () -- cgit v1.2.3 From 96364c19f65126954d517d28a77f16bdc679471a Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 26 Apr 2021 16:09:06 +0200 Subject: CMakeLists.txt: Add Clang support. --- CMakeLists.txt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 81950d5..cf3b2fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,8 +88,18 @@ add_custom_target (cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2 ## Actual building ## -set (CC_WARNING_ARGS " -Wall") -set (CXX_WARNING_ARGS " -Wall") +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + + set(COMPILE_FLAGS "${COMPILE_FLAGS} -Weverything") + set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-c++98-compat -Wno-padded") + set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-documentation") + +else() + + set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wall") + +endif() + include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include) include_directories (${CMAKE_CURRENT_BINARY_DIR}/include) @@ -120,4 +130,3 @@ add_subdirectory(po) if (${enable_tests}) add_subdirectory(tests) endif () - -- cgit v1.2.3 From fc83ab818ab55ecf346e5eec7c9d806107893219 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 27 Apr 2021 22:21:09 +0200 Subject: CMakeLists.txt: Rename CMake options 'enable_tests' to 'ENABLE_TESTS' and 'enable_lcov' to 'ENABLE_COVERAGE' (both defaulting to 'OFF'). --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index cf3b2fb..32a3877 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,8 @@ include (GNUInstallDirs) set (PROJECT_VERSION "0.8.3") set (PACKAGE ${CMAKE_PROJECT_NAME}) -option (enable_tests "Build the package's automatic tests." ON) -option (enable_lcov "Generate lcov code coverage reports." ON) +option (ENABLE_TESTS "Build the package's automatic tests." OFF) +option (ENABLE_COVERAGE "Generate lcov code coverage reports." OFF) ## ## GNU standard installation directories @@ -105,7 +105,7 @@ include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include) include_directories (${CMAKE_CURRENT_BINARY_DIR}/include) # testing & coverage -if (${enable_tests}) +if (${ENABLE_TESTS}) pkg_check_modules (DBUSTEST REQUIRED dbustest-1>=14.04.0) if (EXISTS /usr/src/googletest/src) @@ -117,7 +117,7 @@ if (${enable_tests}) set (GTEST_INCLUDE_DIR ${GTEST_SOURCE_DIR}/..) set (GTEST_LIBS -lpthread) enable_testing () - if (${enable_lcov}) + if (${ENABLE_COVERAGE}) include(GCov) endif () endif () @@ -127,6 +127,6 @@ add_subdirectory(include) add_subdirectory(src) add_subdirectory(data) add_subdirectory(po) -if (${enable_tests}) +if (${ENABLE_TESTS}) add_subdirectory(tests) endif () -- cgit v1.2.3 From 202b9c369b3ef9e454def1c7789e4cde4e37941a Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 27 Apr 2021 22:29:15 +0200 Subject: CMakeLists.txt: Drop GNUInstallDirs. Use PREFIX initialization hack. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 32a3877..003df0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,9 @@ cmake_minimum_required (VERSION 2.8.9) list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) -include (GNUInstallDirs) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + SET(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "..." FORCE) +endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set (PROJECT_VERSION "0.8.3") set (PACKAGE ${CMAKE_PROJECT_NAME}) -- cgit v1.2.3