pastec icon indicating copy to clipboard operation
pastec copied to clipboard

Addition of a directory name for header file inclusion

Open elfring opened this issue 10 years ago • 3 comments

Some header files reuse words like "index", "messages" and "thread" in the file names which might be popular also in other software development areas.

I suggest to add your project name as a directory in affected path specifications for the preprocessor directive "#include". How do you think about the reduce the probability for file name clashes here?

elfring avatar Oct 10 '14 18:10 elfring

I find that something is wrong in the compile of this project, which is as follows:

CMake Warning (dev) at /usr/local/share/OpenCV/OpenCVConfig.cmake:52 (if): given arguments:

"TRUE"

An argument named "TRUE" appears in a conditional statement. Policy CMP0012 is not set: if() recognizes numbers and boolean constants. Run "cmake --help-policy CMP0012" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Call Stack (most recent call first): CMakeLists.txt:37 (find_package) This warning is for project developers. Use -Wno-dev to suppress it.

-- Could NOT find libjsoncpp-dev (missing: LIBJSONCPP_INCLUDE_DIR) -- Configuring done -- Generating done -- Build files have been written to: /home/changliu/github/pastec/build

I cross-searched in stackoverflow and find the reason here: http://stackoverflow.com/questions/18005880/how-to-writing-a-cmake-module-for-jsoncpp

so there need some changes in Findjsoncpp.cmake, I think maybe different machine configurations should be different...

diff --git a/cmake/Modules/Findjsoncpp.cmake b/cmake/Modules/Findjsoncpp.cmake index 4857396..8fc8bb0 100644 --- a/cmake/Modules/Findjsoncpp.cmake +++ b/cmake/Modules/Findjsoncpp.cmake @@ -9,9 +9,9 @@ find_package(PkgConfig) pkg_check_modules(PC_LIBJSONCPP QUIET libjsoncpp) set(LIBJSONCPP_DEFINITIONS ${PC_LIBJSONCPP_CFLAGS_OTHER})

-find_path(LIBJSONCPP_INCLUDE_DIR json.h +find_path(LIBJSONCPP_INCLUDE_DIR json/features.h HINTS ${PC_LIBJSONCPP_INCLUDEDIR} ${PC_LIBJSONCPP_INCLUDE_DIRS}

  •      PATH_SUFFIXES libjsoncpp)
    
  •      PATH_SUFFIXES jsoncpp)
    

    find_library(LIBJSONCPP_LIBRARY jsoncpp HINTS ${PC_LIBJSONCPP_LIBDIR} ${PC_LIBJSONCPP_LIBRARY_DIRS} )

deercoder avatar Nov 05 '14 03:11 deercoder

@deercoder: Thanks for the description of your software build experiences.

But I wonder why you appended this story to my issue here. How do you think about to move it to a new bug report?

elfring avatar Nov 05 '14 07:11 elfring

@elfring Sorry, I didn't find somewhere to put, I think I would better move it to some be right place, Thanks!

deercoder avatar Nov 05 '14 15:11 deercoder