Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix empty detected include dirs #528

Merged
merged 1 commit into from
Sep 19, 2017
Merged

Conversation

ycollet
Copy link
Contributor

@ycollet ycollet commented Sep 16, 2017

with pkg-config if a include directory is a system include directory, then pkg-config returns nothing.
This make FindPackageHandleStandardArgs fails.
So, I propose to detect empty include dirs and put "/usr/include" is the cmake variable.

@jeremyz
Copy link
Member

jeremyz commented Sep 17, 2017

hello,
I would like to know more about your setup,
all my libs stand in /usr/lib/ and /usr/include
and I see no issues ?!?

I've added the above just after include(FindPackageHandleStandardArgs)
MESSAGE(STATUS " hell ${${prefix}_INCLUDE_DIRS}")

./build.sh r mm | grep hell
-- hell /usr/include
-- hell /usr/include
-- hell /usr/include
-- hell /usr/include
-- hell /usr/include
-- hell /usr/include
-- hell /usr/include
-- hell /usr/include
-- hell /usr/include
-- hell /usr/include
-- hell /usr/include
-- hell /usr/include/lash-1.0
-- hell /usr/include
-- hell /usr/include
-- hell /usr/include

@ycollet
Copy link
Contributor Author

ycollet commented Sep 19, 2017

I use Fedora 25.
cmake version is 3.9.0.
pkg-config version is 0.29.

When I start cmake on hydrogen project, I've got this error message:

-- Checking for module 'libarchive'
--   Found libarchive, version 3.2.2
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find LIBARCHIVE (missing: LIBARCHIVE_INCLUDE_DIRS)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:377 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindHelper.cmake:43 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:195 (FIND_HELPER)


-- Configuring incomplete, errors occurred!
See also "/home/collette/repositories/hydrogen/build/CMakeFiles/CMakeOutput.log".
See also "/home/collette/repositories/hydrogen/build/CMakeFiles/CMakeError.log".
Makefile:318 : la recette pour la cible « cmake_check_build_system » a échouée
make: *** [cmake_check_build_system] Erreur 1                                                                                                                           

@jeremyz
Copy link
Member

jeremyz commented Sep 19, 2017

Ok, thanks, on my archlinux :

  $pkg-config libarchive --libs -> '-larchive'
  $pkg-config libarchive --cflags -> ''

so it's definitly the find_path() macro that does the job.
I have cmake 3.9.2, maybe that's where this issue comes from.
what if you add "/usr/include" to the HINTS param of find_path() macro ?
I would prefer to do it that way.
but if it doesn't fix anything, I'll merge your patch and hope we are done with does silly cmake issues ;))

@ycollet
Copy link
Contributor Author

ycollet commented Sep 19, 2017

I added /usr/include in the HINT option of find_path:

        # find_path
        find_path(${prefix}_INCLUDE_DIRS
            NAMES ${header}
            HINTS ${PC_${prefix}_INCLUDEDIR} ${PC_${prefix}_INCLUDE_DIRS} /usr/include
            ENV ${prefix}_INCLUDE
            )

The error message is still the same. I will install cmake-3.9.2 to check if this version fixes the problem.

@ycollet
Copy link
Contributor Author

ycollet commented Sep 19, 2017

Same problem with cmake-3.9.2 ...

@jeremyz
Copy link
Member

jeremyz commented Sep 19, 2017

ouch !
I merge your patch, I'm sick of these cmake things ;)
thanks a lot for your time.

@jeremyz jeremyz merged commit aa01e64 into hydrogen-music:master Sep 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants