I’m moving my build system to CMake and I’m digging all the awesome support that has been added recently. I’m pretty new to CMake but am really enjoying it so far. My day to day work flow is on Windows 10 however and I understand CMake support on windows is “experimental”. That said, I’m getting the following error trying to generate my project:
CMake Error at dependencies/cinder/proj/cmake/modules/cinderMakeApp.cmake:65 (find_package):
Could not find a package configuration file provided by "cinder" with any
of the following names:
cinderConfig.cmake
cinder-config.cmake
Add the installation prefix of "cinder" to CMAKE_PREFIX_PATH or set
"cinder_DIR" to a directory containing one of the above files. If "cinder"
provides a separate development package or SDK, be sure it has been
installed.
I haven’t dug around in cinder’s CMake files enough to know exactly why i’m getting this error…hoping someone can enlighten me.
Note: I did have it working at one point, but i erased my build folder to fix something and this error reappeared.
Turns out it was running fine with the basic cmake .. command run from my build folder, but explicitly using the win64 generator produces the error:
$ cmake .. -G"Visual Studio 14 2015 Win64"
-- The C compiler identification is MSVC 19.0.23918.0
-- The CXX compiler identification is MSVC 19.0.23918.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/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 14.0/VC/bin/x86_amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- App is set to msw.
CMake Warning at dependencies/cinder/proj/cmake/configure.cmake:45 (message):
CMake support on Windows is experimental and may be incomplete.
Call Stack (most recent call first):
dependencies/cinder/proj/cmake/modules/cinderMakeApp.cmake:23 (include)
projects/MyCinderProject/CMakeLists.txt:30 (ci_make_app)
CMake Error at dependencies/cinder/proj/cmake/modules/cinderMakeApp.cmake:65 (find_package):
Could not find a package configuration file provided by "cinder" with any
of the following names:
cinderConfig.cmake
cinder-config.cmake
Add the installation prefix of "cinder" to CMAKE_PREFIX_PATH or set
"cinder_DIR" to a directory containing one of the above files. If "cinder"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
projects/MyCinderProject/CMakeLists.txt:30 (ci_make_app)
-- Configuring incomplete, errors occurred!
See also "C:/code/cpp_project/build/CMakeFiles/CMakeOutput.log".
where this works fine:
$ cmake ..
-- Building for: Visual Studio 14 2015
-- The C compiler identification is MSVC 19.0.23918.0
-- The CXX compiler identification is MSVC 19.0.23918.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual 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
-- 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
-- App is set to msw.
CMake Warning at dependencies/cinder/proj/cmake/configure.cmake:45 (message):
CMake support on Windows is experimental and may be incomplete.
Call Stack (most recent call first):
dependencies/cinder/proj/cmake/modules/cinderMakeApp.cmake:23 (include)
projects/MyCinderProject/CMakeLists.txt:30 (ci_make_app)
-- Found Doxygen: C:/Program Files/doxygen/bin/doxygen.exe (found version "1.8.13")
-- Configuring done
-- Generating done
-- Build files have been written to: C:/code/cpp_project/build
Cmake has a hard time generating x64 projects on windows anyway, so maybe i will just always have to add the x64 build manually. Any tips?
Hm, I didn’t realize that cmake x64 bit projects were a problem, I would hope we could solve this though, as 32-bit is quickly becoming irrelevant. Is there some way to specify the architecture as a command line option? I see there is some MSVC PlatformToolset manipulation here, although I’m unfamiliar with that part and haven’t tested generating VS projects myself.
Also just posted here with some background information on the state of cmake on windows.
Thanks Rich! I’m really looking forward to cmake support in vs2017 it should make cross platform development a LOT easier.
I just figured out this thread is actually about two different problems:
there’s no good way to do 32 vs 64 bit builds with cmake on windows, so the best practice is to commit to an architecture or maintain two build folders if you have to support both architectures. The only annoying thing this that the default arch on windows is Win32 so to generate an x64 project (which is pretty much always the case) you have to flag -D"Visual Studio 14 2015 Win64" when you generate your project. Not such a big deal if your build system works well and you aren’t constantly changing the cmake files…unlike mine
This is a new one I JUST figured out. The generated projects have these flags set:
In debug this seems fine, but in release, it fails to link to the runtime library and all hell breaks loose. Removing the specific ignores on release fixes the problem for me. I also looked at the same sample i’m testing against (_opengl/Cube) and the provided VS proj doesn’t ignore them in release, so i think that perhaps this is just a typo?
I’m not super familiar with what that setting is all about so i’m not sure which is the case, but at any rate i’m going to submit an issue and PR about it.
I’ve tested most of the cmake project generation features for windows and its looking good except for these two things (and a symlink problem i PRed against as well). I’ll keep logging things as they come up!