I am following the instructions from https://badprog.com/c-boost-setting-up-on-windows-10 . I have Visual Studio 2017 installed, and installed boost_1_71_0-msvc-14.1-64.exe. CMake was downloaded from cmake.org/download/, cmake-3.19.0-rc1-win64-x64.msi.
I have a project that needs Boost Beast, which I believe is 1.70 or higher.
When I run cmake . everything seems fine:
C:\Users\Public\xyz>cmake .
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18362.
-- The CXX compiler identification is MSVC 19.24.28314.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
-- Found Threads: TRUE
-- Found Boost: C:/local/boost_1_71_0 (found suitable version "1.71.0", minimum required is "1.70") found components: thread system chrono date_time atomic
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Public/xyz
The resulting project opens in Visual Studio 2017, but then complains it needs the 2019 build tools. Surprisingly, as you can see above, it's building for Visual Studio 2019?
But, after killing CMakeCache.txt and CMakeFiles, if I do this:
C:\Users\Public\xyz>cmake -G "Visual Studio 15 2017" .
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18362.
-- The CXX compiler identification is MSVC 19.16.27034.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
-- Found Threads: TRUE
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
Could NOT find Boost (missing: thread system) (found suitable version
"1.71.0", minimum required is "1.70")
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:577 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.19/Modules/FindBoost.cmake:2176 (find_package_handle_standard_args)
CMakeLists.txt:29 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
See also "C:/Users/Public/xyz/CMakeFiles/CMakeOutput.log".
Suddenly it can't find Boost components (but can find Boost?). I've tried various forms of -DBOOST_LIBRARYDIR or -DBOOST_ROOT, etc., to no avail, but I don't seem to have the usual stackoverflow problem of cmake not being able to find Boost; instead it doesn't seem to recognize the Visual Studio 2017 target, despite having been installed for msvc-14.1?
CMakeLists.txt:
# Specify the minimum version for CMake
cmake_minimum_required(VERSION 3.1)
# Force C++11, for Boost Beast (async http library)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Project's name
project(xyz
VERSION 0.1
LANGUAGES CXX)
# Set the output folder where the program will be created
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
# Specify .cpp and .hpp is in src/
set(PROJECT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src)
include_directories("${PROJECT_SOURCE_DIR}")
# Add source to build target for hello world...
add_executable(main ${PROJECT_SOURCE_DIR}/main.cpp)
# Testing http support
ADD_EXECUTABLE( server ${PROJECT_SOURCE_DIR}/server.cpp )
FIND_PACKAGE( Boost 1.70 REQUIRED COMPONENTS thread system )
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} )
target_link_libraries ( server LINK_PUBLIC ${Boost_LIBRARIES} )
In the end, the issue was simple. If I may so, it was an easy mistake for a beginner to make but almost impossible for a beginner to unravel with regular google searching.
When I issued cmake ., it was defaulting to a 64 bit build, but assuming a Visual Studio 2019 target. That was wrong.
The equivalent should have been cmake -G "Visual Studio 15 2017 Win64" . But not knowing this, and following the wrong tutorials, I was issuing instead cmake -G "Visual Studio 15 2017" .. This defaulted to a 32 bit build - though by default it never mentions this fact. It could find boost, but all library files were for 64 bit and useless for 32 bit, so it simply said "I can't find anything!".
My thanks to #Tsyvarev, who should get the credit for the answer. Turning on DEBUG and looking at searched library files character by character was indeed the right call.
Related
Background
I have mutiplatform C++ project. Python is used only to download some dependencies from strange places and generate some C++ code. Python is NOT linked to any target, so I do not care what kind of platform it uses.
Problem
When configuring project for Windows 64 bit platform, python is found(find_package) without any problems. On my machine only Python 3.10.0 for Win64 is installed.
Now when I'm trying build same project for x86 (win32) it fails to configure since can't find 32 bit python.
Here is MCVE:
CMakeLists.txt
cmake_minimum_required(VERSION 3.16)
project(findPythonToGenerate CXX)
find_package(Python3 REQUIRED)
configure_file(test.h.in test.h)
add_executable(foo main.cpp ${CMAKE_CURRENT_BINARY_DIR}/test.h)
target_include_directories(foo PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
main.cpp
#include <iostream>
#include "test.h"
int main()
{
std::cout << PYTHON_EXE << '\n';
return 0;
}
test.h.in
#pragma once
#define PYTHON_EXE "#Python3_EXECUTABLE#"
Now when building this for Windows 64 is just fine:
f:\mcve>cmake --version
cmake version 3.20.21032501-MSVC_2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
f:\mcve>rmdir /Q /S build32 build64
The system cannot find the file specified.
f:\mcve>cmake -S . -B build64 -A x64 -Thost=x64 -G "Visual Studio 16 2019"
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19044.
-- The CXX compiler identification is MSVC 19.29.30145.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python3: C:/Python310/python.exe (found version "3.10.0") found components: Interpreter
-- Configuring done
-- Generating done
-- Build files have been written to: F:/mcve/build64
f:\mcve>cmake -S . -B build32 -A Win32 -Thost=x86 -G "Visual Studio 16 2019"
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19044.
-- The CXX compiler identification is MSVC 19.29.30145.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Python3 (missing: Python3_EXECUTABLE Interpreter)
Call Stack (most recent call first):
C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/FindPython/Support.cmake:3165 (find_package_handle_standard_args)
C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/FindPython3.cmake:485 (include)
CMakeLists.txt:4 (find_package)
-- Configuring incomplete, errors occurred!
See also "F:/mcve/build32/CMakeFiles/CMakeOutput.log".
Question
Can I configure cmake in some way that it give me access to python interpreter ignoring what is the current platform I'm building for? I do not want to install extra python - I do not need it.
I'm building 32 bit platform only to resolve build issues specific for that platform.
Here is similar question, but it is a different flavor, since I do not link anything with python.
Side Note
I think it was OK with older version of cmake. Recently I've updated my Visual Studio 2019 and as a result cmake too. Sadly I can't tell it for sure.
I just checked logs on build machine (which builds all platforms everyday) and on both platforms cmake 3.19 is used and same version of python and I'm sure it is 64 bit version. So looks like regression in cmake 3.20, so I raised issue.
Ok turns out that problem was type of python installation.
Some time ago I installed python 3.10 for "current user" instead for "local machine".
Apparently i didn't had to build for Win32 since that time and when I had to it happen just after MSVC upgrade.
So make sure you install python for "LOCAL MACHINE".
I built PCL on windows using VCPKG(MS Visual studio 2017). I am trying to build a CPP application with PCL using cmake 3.12 with the following CMakelists.txt.
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(compute)
find_package(PCL 1.5 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable (compute compute.cpp)
target_link_libraries (compute ${PCL_LIBRARIES})
I also set the following environment variables.
set PCL_INCLUDE_DIRS="C:\vcpkg-pcl\vcpkg-master\installed\x64-windows\include\pcl"
SET PCL_LIBRARY_DIRS="C:\vcpkg-pcl\vcpkg-master\installed\x64-windows\lib"
set PCL_LIBRARIES="pcl_common_release.lib;pcl_features_release.lib;pcl_filters_release.lib;pcl_io_ply_release.lib;pcl_io_release.lib"
I initially got an error saying it is unable to find the file FindPCL.cmake and eventually PCLConfig.cmake or PCL-Config.cmake. I set the environment variable
set PCL_DIR=C:\vcpkg-pcl\vcpkg-master\installed\x64-windows\share\pcl
where the PCLConfig.cmake is installed. It was able to detect the file. However,
it is unable to detect PCL(pcl_report_not_found) with the following error.
c:\PCL-Program>cmake .
-- Building for: Visual Studio 15 2017
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134.
-- The C compiler identification is MSVC 19.16.27023.1
-- The CXX compiler identification is MSVC 19.16.27023.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Eigen (missing: EIGEN_INCLUDE_DIR)
CMake Error at C:/vcpkg-pcl/vcpkg-master/installed/x64-windows/share/pcl/PCLConfig.cmake:56 (message):
common is required but eigen was not found
Call Stack (most recent call first):
C:/vcpkg-pcl/vcpkg-master/installed/x64-windows/share/pcl/PCLConfig.cmake:356 (pcl_report_not_found)
C:/vcpkg-pcl/vcpkg-master/installed/x64-windows/share/pcl/PCLConfig.cmake:526 (find_external_library)
CMakeLists.txt:5 (find_package)
-- Configuring incomplete, errors occurred!
See also "C:/PCL-Program/CMakeFiles/CMakeOutput.log".
c:\PCL-Program>set EIGEN_INCLUDE_DIR
EIGEN_INCLUDE_DIR=C:\vcpkg-pcl\vcpkg-master\installed\x64-windows\include\Eigen
Even after setting the environment variable for EIGEN_INCLUDE_DIR, I am still getting the same error. Please let me know if I am following the right way.
Thanks!
Now that I've looked through other peoples solutions for several hours and could not find quite the right answer for my problem I would like to bring my specific problem to you. :)
I am trying to build vsomeip with CMake. For that I previously built boost 1.55, however, I get the following errors in CMake:
The C compiler identification is MSVC 19.0.24215.1
The CXX compiler identification is MSVC 19.0.24215.1
Check for working C compiler: C:/Program Files (x86)/Microsoft Visua Studio 14.0/VC/bin/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.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
Setting build type to 'RelWithDebInfo' as none was specified.
Looking for pthread.h
Looking for pthread.h - not found
Found Threads: TRUE
CMake Error at C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:2025 (message):
Unable to find the requested Boost libraries.
Boost version: 1.55.0
Boost include path: C:/Program Files/boost/boost_1_55_0
Could not find the following static Boost libraries:
boost_system
boost_thread
boost_log
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
Call Stack (most recent call first):
CMakeLists.txt:99 (find_package)
Boost was not found!
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Systemd was not found, watchdog disabled!
using MSVC Compiler
Predefined unicast address: 127.0.0.1
Predefined diagnosis address: 0x00
Predefined routing application: vsomeipd
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
CMake Warning at CMakeLists.txt:335 (message):
Doxygen is not installed. Documentation can not be built.
CMake Warning at CMakeLists.txt:374 (message):
asciidoc is not installed. Readme can not be built.
GTEST_ROOT is not defined. For building the tests the variable
GTEST_ROOT has to be defined. Tests can not be built.
Configuring incomplete, errors occurred!
See also "D:/Desktop/BACHELORARBEIT/vsomeip/build/CMakeFiles /CMakeOutput.log".
See also "D:/Desktop/BACHELORARBEIT/vsomeip/build/CMakeFiles/CMakeError.log".
It cannot find the static Boost libraries. Now, I've tried playing around with the CMakeList.txt and here is the part of it that would be supposed to handle the linking:
# Boost
set(BOOST_INCLUDE_DIR C:/Program Files/Boost/boost_1_55_0)
set(BOOST_LIBRARYDIR C:/Program Files/Boost/boost_1_55_0/stage/libs)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
find_package( Boost 1.55 COMPONENTS system thread log REQUIRED )
include_directories( ${Boost_INCLUDE_DIR} )
if(Boost_FOUND)
if(Boost_LIBRARY_DIR)
MESSAGE( STATUS "Boost_LIBRARY_DIR not empty using it: ${Boost_LIBRARY_DIR}" )
else()
if(BOOST_LIBRARYDIR)
MESSAGE( STATUS "Boost_LIBRARY_DIR empty but BOOST_LIBRARYDIR is set setting Boost_LIBRARY_DIR to: ${BOOST_LIBRARYDIR}" )
set(Boost_LIBRARY_DIR ${BOOST_LIBRARYDIR})
endif()
endif()
else()
MESSAGE( STATUS "Boost was not found!")
endif()
I have also tried using a newer boost version (1.67) with same results. Any help will be dearly appreciated!
Check if your compiled libraries are in the following directory:
C:/Program Files/Boost/boost_1_55_0/stage/libs
If not, set your lib folder directory path:
set(BOOST_LIBRARYDIR path_to_lib_directory)
As #Tsyvarev suggested I used set(Boost_DEBUG ON) to trace the exact locations and files that CMake was looking for and the discovered several problems:
1.) Setting the path to "C:/Program Files/Boost/boost_1_55_0"
causes problems, because of the space in the path
2.) It searched for the libraries covering multiple formats like: boost_thread-vc141-mt-gd-x32-1_55.lib.
However, when I built boost with incorrect parameters, so my libs were built like this:
libboost_thread-vc-mt-1_55.lib, which is not of the correct format.
3.) Unfortunately adding other options when building boost, e.g.:
b2 toolset=msvc-14.1 address-model=32 --build-type=complete
caused other errors. Also building boost_1_67_0 manually worked for me at all.
My solution to the problem was to simply take one of the third-party download( https://dl.bintray.com/boostorg/release/1.67.0/binaries/). This way all the libraries were built correctly and I had no trouble linking to them.
I'm trying to build Cryptonote source from GitHub - https://github.com/cryptonotefoundation/cryptonote
I've already successful complete building on Unix, but on Windows I have some problems with that.
I've install on my Windows 10 x64:
Microsoft Visual Studio 2013
Git
CMake 3.10.1
Python 2.7.9
Then I'm trying build and install
Boost 1.55.0
Downloaded "boost_1_55_0.zip" from here https://sourceforge.net/projects/boost/files/boost/1.55.0/
After unpacking I run from cmd
bootstrap.bat
Next I enter
.\b2
When build is done let's do install
.\b2 --toolset=msvc-12.0 --build-type=complete --prefix=D:\Boost install
Ok next is build Cryptonote sources, going to C:\cryptonote, create dir "build" and enter to "build" dir.
Now I trying to build Cryptonote by entering this
cmake -DBOOST_ROOT:PATHNAME=D:\Boost -g "Visual Studio 2012 Win64" ..
Here is output:
-- Building for: Visual Studio 12 2013
-- The C compiler identification is MSVC 18.0.31101.0
-- The CXX compiler identification is MSVC 18.0.31101.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.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 Studio 12.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.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
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
CMake Error at C:/Program Files/CMake/share/cmake-3.10/Modules/FindBoost.cmake:1928 (message):
Unable to find the requested Boost libraries.
Boost version: 1.55.0
Boost include path: D:/Boost/include/boost-1_55
Could not find the following static Boost libraries:
boost_serialization
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
Call Stack (most recent call first):
CMakeLists.txt:112 (find_package)
-- Found Git: C:/Program Files/Git/cmd/git.exe
-- Found PythonInterp: C:/Python27/python.exe (found version "2.7.9")
CMake Warning in CMakeLists.txt:
CMAKE_SKIP_INSTALL_RULES was enabled even though installation rules have
been specified
-- Configuring incomplete, errors occurred!
See also "C:/cryptonote/build/CMakeFiles/CMakeOutput.log".
See also "C:/cryptonote/build/CMakeFiles/CMakeError.log".
Where I can find that library? Or what I need to do for complete build? Thank you!
I'm currently getting this error while trying to configure a project on CMAKE using Visual Studio 15 2017 Win64:
The C compiler identification is MSVC 19.11.25547.0
The CXX compiler identification is MSVC 19.11.25547.0
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/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 Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Found OpenGL: opengl32
Looking for pthread.h
Looking for pthread.h - not found
Found Threads: TRUE
Using Win32 for window creation
Using WGL for context creation
Lib glbinding
Performing Test COMPILER_HAS_DEPRECATED_ATTR
Performing Test COMPILER_HAS_DEPRECATED_ATTR - Failed
Performing Test COMPILER_HAS_DEPRECATED
Performing Test COMPILER_HAS_DEPRECATED - Success
Configuring done
I've used this compiler to generate another project and it still works.
Here is the code relevant to the new CMakeLists.txt:
project(ms3d_td3)
cmake_minimum_required(VERSION 3.2.0)
add_subdirectory(ext/glfw)
add_subdirectory(ext/glbinding)
include_directories(ext/glfw/include)
include_directories(ext/glbinding/include)
include_directories(ext/eigen3)
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
set(SRC_FILES
src/main.cpp
src/viewer.cpp
src/viewer.h
src/shader.cpp
src/shader.h
src/opengl.h)
add_definitions(-DDATA_DIR="${PROJECT_SOURCE_DIR}/data")
add_executable(ms3d_td3 ${SRC_FILES})
target_link_libraries(ms3d_td3 glfw ${GLFW_LIBRARIES} glbinding)
Under Visual Studio 2017 I get a CMAKE_C_COMPILER not set after EnableLanguage. I tried to set it manually to the VisualStudio 2017 compiler but no success. Any ideas?
Another person had a similar problem and solved it by upgrading Visual Studio a while ago so I'm guessing this is coming from somewhere else... :
Compiler failing on C++11 instructions in a Visual Studio project configured with cmake
Thanks!
To require compiler support for the [[decprecated]] attribute, use target_compile_features and specify the cxx_attribute_deprecated feature. For example:
add_executable(foo foo.cpp)
target_compile_features(foo PRIVATE cxx_attribute_deprecated)
If you need to conditionally test for this so that you can configure a header file, use check_cxx_source_compiles.