Closed JanosGit closed 4 years ago
I would avoir shadowing CMAKE_MODULE_PATH
, usually I do it the other way:
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/../juce-cmake/cmake")
Second JUCE_ROOT_DIR
is an output, not an input for FindJuce
, this is the current way of looking for JUCE
find_path(JUCE_ROOT_DIR
"modules/JUCE Module Format.txt"
HINTS
${PROJECT_SOURCE_DIR}/../
${PROJECT_SOURCE_DIR}/JUCE
${CMAKE_CURRENT_LIST_DIR}/../../JUCE
${CMAKE_CURRENT_LIST_DIR}/../JUCE
DOC
"JUCE library directory"
)
so given your layout, it should find your local JUCE version.
It it's not enough, according to cmake's documentation for find_path, https://cmake.org/cmake/help/v3.8/command/find_path.html?highlight=i
you could set CMAKE_INCLUDE_PATH
to help cmake find JUCE.
Regarding 3rd party modules, they are not supported yet.
I started with CMake some weeks ago, so this might be a problem related to my lack of knowledge.
I want to integrate your solution in a cmake-based project I released here as I need JUCE for a project that should be able to build without the Projucer using some highly custom embedded toolchains.
My Project structure looks like that:
I added the following lines to my CMakeLists.txt
Now I get a bunch of errors, related to not finding the right paths to the modules if I get it right? I added a message after line 165 of FindJUCE.cmake to see where it looks for the headers (
message("Header: ${header}"
)What is confusing to me: In some case it fails with a path containing
JUCE_ROOT_DIR-NOTFOUND
(juce_core and juce_events), for juce_osc it finds the right path and for juce_cryptography it finds my copy of juce used for Projucer-Based projects with global juce paths on my machine.I'd love to be able to use my global JUCE installation like its possible with Projucer-based projects, however having a copy of JUCE in the project folder is an option too, first of all I'd love to get this working. So what's wrong here?
Bonus question: How do I pass the path to my own modules that are not inside the JUCE modules folder?