The way that cmake works is it provides the different FindXXX.cmake scripts
for FindPackage directives. How the different Find-scripts look for
different directories depend on the particular script in question. Each
script comes with its own documentation that tells how you can configure
the paths for finding that library.

There is a single CMAKE_MODULE_PATH directive that tells cmake where to
look for the FindXXX.cmake scripts. Because emscripten is a cross-compiler,
we have routed this directive to not look at any system cmake-provided
paths, but instead we have a Modules path in emscripten repo where the
Emscripten-specific find scripts can be put in. Currently we have only few
of those, but pull requests that add more are welcome.
On Jun 16, 2014 9:05 PM, <[email protected]> wrote:

> Hello, I decided to use CMake for my project because the emscripten kind
> of suggested it (but if something else is better, I can change).
> I wanted to use gtest (Google Test), so I added the following lines to my
> CMakeLists.txt, which worked well when producing native binaries
>
>     FIND_PACKAGE(GTest REQUIRED)
>     INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS})
>     TARGET_LINK_LIBRARIES(test ${GTEST_LIBRARIES})
>
> Where should I install gtest (i.e. what should I write in --prefix) if I
> want cmake to find it when using emscripten? I tried putting them in
> "$EMSCRIPTEN"/system/{include,lib}, but that didn't work. I'm using this to
> run emscripten
>
>     cmake -G "Unix Makefiles"
> -DCMAKE_TOOLCHAIN_FILE="$EMSCRIPTEN"/cmake/Platform/Emscripten.cmake
>
> Also is it possible to make FIND_PACKAGE(SDL) work/do nothing? Now I had
> to comment it out like this, but I think it would be best if one could use
> the same CMakeLists.txt when producing native binaries and javascript!
>
>     IF (NOT DEFINED EMSCRIPTEN)
>         FIND_PACKAGE(SDL REQUIRED)
>         INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
>         TARGET_LINK_LIBRARIES(test ${SDL_LIBRARY})
>     ENDIF()
>
> Thank you!
> Stevie Trujillo
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to