[CMake] Specifying compilers?

Leif Walsh leif.walsh at gmail.com
Wed Aug 22 19:22:09 EDT 2012


Can you provide the output of "make VERBOSE=1"?

Sent from my iPhone

On Aug 22, 2012, at 19:04, "Jason T. Slack-Moehrle" <slackmoehrle at gmail.com> wrote:

> Hello,
> 
> I am trying to use come C++v11 features and am trying to get the
> compiling to work.
> 
> The error:
> [jtsm at server]$ ./build.sh
> -- The C compiler identification is Clang 4.0.0
> -- The CXX compiler identification is Clang 4.0.0
> -- Check for working C compiler: /usr/bin/clang
> -- Check for working C compiler: /usr/bin/clang -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Check for working CXX compiler: /usr/bin/clang++
> -- Check for working CXX compiler: /usr/bin/clang++ -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Found OpenGL: /System/Library/Frameworks/OpenGL.framework
> -- Found GLUT: -framework GLUT
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /Users/jtsm/Dropbox/Projects/All-Stars
> Scanning dependencies of target All-Stars
> [100%] Building CXX object CMakeFiles/All-Stars.dir/main.cpp.o
> /Users/jtsm/Dropbox/Projects/All-Stars/main.cpp:4:10: fatal error:
> 'thread' file not found
> #include <thread>
>         ^
> 1 error generated.
> make[2]: *** [CMakeFiles/All-Stars.dir/main.cpp.o] Error 1
> make[1]: *** [CMakeFiles/All-Stars.dir/all] Error 2
> make: *** [all] Error 2
> 
> [jtsm at server ]$ clang -v
> Apple clang version 4.0 (tags/Apple/clang-421.10.60) (based on LLVM 3.1svn)
> Target: x86_64-apple-darwin12.0.0
> Thread model: posix
> [jtsm at server ]$ clang++ -v
> Apple clang version 4.0 (tags/Apple/clang-421.10.60) (based on LLVM 3.1svn)
> Target: x86_64-apple-darwin12.0.0
> Thread model: posix
> 
> in my 'build.sh' I have:
> 
> #/bin/bash
> 
> CC=clang CXX=clang++ cmake .
> 
> make
> 
> 
> in my CMakeList.txt:
> 
> CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9)
> 
> SET( TEST_VERSION "0.1+devel" )
> SET( PROJECT_NAME "All-Stars" )
> 
> SET( CMAKE_INCLUDE_CURRENT_DIR TRUE )
> 
> SET( CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++" )
> 
> PROJECT( ${PROJECT_NAME} )
> 
> find_package(OpenGL REQUIRED)
> include_directories(${OPENGL_INCLUDE_DIR})
> 
> find_package(GLUT REQUIRED)
> include_directories(${GLUT_INCLUDE_DIR})
> 
> SET( CORE_SOURCE_FILES "main.cpp" )
> 
> SET( CORE_SOURCE_HEADERS "" )
> 
> add_executable( ${PROJECT_NAME} ${CORE_SOURCE_FILES} )
> 
> target_link_libraries( ${PROJECT_NAME} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
> 
> Can anyone shed some light on what I am doing wrong?
> 
> -Jason
> --
> 
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list