The following issue has been SUBMITTED. ====================================================================== http://www.cmake.org/Bug/view.php?id=15597 ====================================================================== Reported By: Anthony Ette Assigned To: ====================================================================== Project: CMake Issue ID: 15597 Category: CMake Reproducibility: always Severity: major Priority: normal Status: new ====================================================================== Date Submitted: 2015-05-29 14:56 EDT Last Modified: 2015-05-29 14:56 EDT ====================================================================== Summary: Issues with the 'Eclipse CDT4 - NMake Makefiles' Generator Description: The project compiles and links in Eclipse but the preprocessor symbols are not defined by the .cproject file. As a result, sections with
#ifdef _WIN32 #endif appear grayed out in the IDE and any included files can't be opened. Note that I'm using Eclipse 4 (Luna). Is there any way I can ensure that the Eclipse project has knowledge of my toolchain's preprocessor symbols without having to redefine them all in my CMakeLists.txt file(s)? Steps to Reproduce: 1) setup project with in source build for better eclipse support (see http://www.cmake.org/Wiki/Eclipse_CDT4_Generator) 2) run cmake with the following (please see attached toolchain file for reference): C:\Users\bzpl46\sim\sandbox\AE3007\C2>cmake -DCMAKE_TOOLCHAIN_FILE=toolchains\to olchain_windows_vsc.cmake -G "Eclipse CDT4 - NMake Makefiles" -- The C compiler identification is MSVC 15.0.30729.1 -- The CXX compiler identification is MSVC 15.0.30729.1 -- Eclipse version is set to 4.4 (Luna). Adjust CMAKE_ECLIPSE_VERSION if this is wrong. -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/cl.exe -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/cl.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studi o 9.0/VC/bin/cl.exe -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studi o 9.0/VC/bin/cl.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- CMAKE_BINARY_DIR: C:/Users/bzpl46/sim/sandbox/AE3007/C2 -- CMAKE_CURRENT_BINARY_DIR: C:/Users/bzpl46/sim/sandbox/AE3007/C2 -- CMAKE_SOURCE_DIR: C:/Users/bzpl46/sim/sandbox/AE3007/C2 -- CMAKE_CURRENT_SOURCE_DIR: C:/Users/bzpl46/sim/sandbox/AE3007/C2 -- PROJECT_BINARY_DIR: C:/Users/bzpl46/sim/sandbox/AE3007/C2 -- PROJECT_SOURCE_DIR: C:/Users/bzpl46/sim/sandbox/AE3007/C2 -- EXECUTABLE_OUTPUT_PATH: C:/Users/bzpl46/sim/sandbox/AE3007/C2 -- LIBRARY_OUTPUT_PATH: -- CMAKE_MODULE_PATH: -- CMAKE_COMMAND: I:/PortableApps/cmake-3.2.2-win32-x86/bin/cmake.exe -- CMAKE_ROOT: I:/PortableApps/cmake-3.2.2-win32-x86/share/cmake-3.2 -- CMAKE_CURRENT_LIST_FILE: C:/Users/bzpl46/sim/sandbox/AE3007/C2/CMakeLists.txt -- CMAKE_CURRENT_LIST_LINE: 90 -- CMAKE_INCLUDE_PATH: -- CMAKE_LIBRARY_PATH: -- CMAKE_SYSTEM: Windows -- CMAKE_SYSTEM_NAME: Windows -- CMAKE_SYSTEM_VERSION: -- CMAKE_SYSTEM_PROCESSOR: -- UNIX: -- CMAKE_SKIP_RULE_DEPENDENCY: -- CMAKE_SKIP_INSTALL_ALL_DEPENDENCY: -- CMAKE_SKIP_RPATH: NO -- CMAKE_VERBOSE_MAKEFILE: FALSE -- CMAKE_SUPPRESS_REGENERATION: -- CMAKE_C_FLAGS: /DWIN32 /D_WINDOWS /W3 -- CMAKE_C_FLAGS_DEBUG: /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 -- CMAKE_C_FLAGS_RELEASE: /MD /O2 /Ob2 /D NDEBUG -- CMAKE_CXX_FLAGS: /DWIN32 /D_WINDOWS /W3 /GR /EHsc -- CMAKE_BUILD_TYPE: Debug -- BUILD_SHARED_LIBS: -- CMAKE_C_COMPILER: C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/c l.exe -- CMAKE_CXX_COMPILER: C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin /cl.exe -- CMAKE_COMPILER_IS_GNUCC: -- CMAKE_COMPILER_IS_GNUCXX : -- CMAKE_AR: -- CMAKE_RANLIB: -- Configuring done -- Generating done -- Build files have been written to: C:/Users/bzpl46/sim/sandbox/AE3007/C2 3) import the project into Eclipse, right click on the project, go to Properties -> C/C++ General -> Paths and Symbols and notice that there are no symbols defined. There is not even a Symbols tab which is typically the case for a valid CDT project. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2015-05-29 14:56 Anthony Ette New Issue 2015-05-29 14:56 Anthony Ette File Added: toolchain_windows_vsc.cmake ====================================================================== -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers