From cddb8a557b4d7bd33fab554847cd49522bf3aa27 Mon Sep 17 00:00:00 2001 From: Mederic Fourmy <mederic.fourmy@gmail.com> Date: Fri, 6 May 2022 14:17:04 +0200 Subject: [PATCH] Fix config.h creation after having broken it --- CMakeLists.txt | 17 +++-------------- internal/config.h | 6 +++--- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dff803a..fbd3bad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,11 +67,6 @@ if(BUILD_TESTS) endif() - -#CMAKE modules -SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules") -MESSAGE(STATUS ${CMAKE_MODULE_PATH}) - # Some wolf compilation options IF((CMAKE_BUILD_TYPE MATCHES DEBUG) OR (CMAKE_BUILD_TYPE MATCHES debug) OR (CMAKE_BUILD_TYPE MATCHES Debug)) @@ -80,15 +75,9 @@ ENDIF() option(_WOLF_TRACE "Enable wolf tracing macro" ON) -# Does this has any other interest -# but for the examples ? -# yes, for the tests ! - -IF(BUILD_DEMOS OR BUILD_TESTS) - string(TOUPPER ${PROJECT_NAME} UPPER_NAME) - set(_WOLF_ROOT_DIR ${CMAKE_SOURCE_DIR}) -ENDIF(BUILD_DEMOS OR BUILD_TESTS) - +set(_WOLF_ROOT_DIR ${CMAKE_SOURCE_DIR}) +# variable used to compile the config.h.in file +string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER) #find dependencies. # ============EXAMPLE================== diff --git a/internal/config.h b/internal/config.h index 7014ca3..35f3468 100644 --- a/internal/config.h +++ b/internal/config.h @@ -24,13 +24,13 @@ // which will be added to the include path for compilation, // and installed with the public wolf headers. -#ifndef WOLF_INTERNAL_${UPPER_NAME}_CONFIG_H_ -#define WOLF_INTERNAL_${UPPER_NAME}_CONFIG_H_ +#ifndef WOLF_INTERNAL_${PROJECT_NAME_UPPER}_CONFIG_H_ +#define WOLF_INTERNAL_${PROJECT_NAME_UPPER}_CONFIG_H_ #cmakedefine _WOLF_DEBUG #cmakedefine _WOLF_TRACE -#define _WOLF_${UPPER_NAME}_ROOT_DIR "${_WOLF_ROOT_DIR}" +#define _WOLF_${PROJECT_NAME_UPPER}_ROOT_DIR "${_WOLF_ROOT_DIR}" #endif /* WOLF_INTERNAL_CONFIG_H_ */ -- GitLab