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.

Reply via email to