I have the following cmake file:
cmake_minimum_required(VERSION 3.15)
add_subdirectory(googletest)
add_subdirectory(zlib)
# libpng setup
option(PNG_TESTS OFF)
set(PNG_TESTS OFF)
option(PNG_SHARED OFF)
set(PNG_SHARED OFF)
option(PNG_EXECUTABLES OFF)
set(PNG_EXECUTABLES OFF)
option(PNG_BUILD_ZLIB ON)
set(PNG_BUILD_ZLIB ON)
set(ZLIB_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/zlib" "${CMAKE_CURRENT_BINARY_DIR}/zlib")
set(ZLIB_LIBRARY "zlib")
add_subdirectory(libpng)
This generates the project correctly and zlib/googletest build is OK. pnglib on the other hand doesn't build:
1>Generating pnglibconf.out
1>Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29337 for x64
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>
1>pnglibconf.c
1>build/thirdparty/libpng/pnglibconf.c(34): fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory
1>CMake Error at scripts/genout.cmake:78 (message):
1> Failed to generate build/thirdparty/libpng/pnglibconf.out.tf1
1>
1>
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(238,5): error MSB8066: Custom build for 'build\CMakeFiles\4c907688e112b5b30b06f56662306981\pnglibconf.out.rule;build\CMakeFiles\4c907688e112b5b30b06f56662306981\pnglibconf.h.rule;build\CMakeFiles\5a2501006db4b4e75991d2f2c16bfadf\sym.out.rule;build\CMakeFiles\4c907688e112b5b30b06f56662306981\libpng.sym.rule;build\CMakeFiles\5a2501006db4b4e75991d2f2c16bfadf\vers.out.rule;build\CMakeFiles\4c907688e112b5b30b06f56662306981\libpng.vers.rule;build\CMakeFiles\5a2501006db4b4e75991d2f2c16bfadf\intprefix.out.rule;build\CMakeFiles\5a2501006db4b4e75991d2f2c16bfadf\prefix.out.rule;build\CMakeFiles\5a2501006db4b4e75991d2f2c16bfadf\symbols.chk.rule;build\CMakeFiles\e5199c38ed750451ee22eda432b56e2c\genfiles.rule' exited with code 1.
1>Done building project "genfiles.vcxproj" -- FAILED.
If I manually copy ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt to ${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h as genfiles target should do pnglib_static compiles fine.
...
if(NOT AWK OR ANDROID OR IOS)
# No awk available to generate sources; use pre-built pnglibconf.h
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h)
add_custom_target(genfiles) # Dummy
else()
...
Any idea on how to fix this? I would like to not alter the CMakeLists.txt from libpng to be easier to update to newer versions. I'm using the latest version from url = git://git.code.sf.net/p/libpng/code as documented on http://www.libpng.org/pub/png/libpng.html
After reading genout.cmake I've found this line:
set(AWK "C:/Program Files/Git/usr/bin/gawk.exe")
If I run CMake from cmd instead of git bash genout.cmake contains:
set(AWK "AWK-NOTFOUND")
Probably running CMake from git bash confuses the build system, but running CMake from cmd generates the project correctly.
Related
CMake Error: CMAKE_Project_COMPILER not set, after EnableLanguage
I Get this Error after writing cmake ..
This is my CMakeLists.txt
set(CMAKE_CXX_COMPILER "C:/mingw64/bin/g++")
set(CMAKE_C_COMPILER "C:/mingw64/bin/gcc")
project(CXX Project)
add_subdirectory(glfw/)
add_executable(${PROJECT_NAME} Main.cpp)
target_include_directories(${PROJECT_NAME} PUBLIC glfw)
target_link_libraries(${PROJECT_NAME} PUBLIC glfw)```
And this is my Complete Error
PS C:\Users\david\Documents\Idle\Project\build> cmake ..
CMake Error at CMakeLists.txt:6 (project):
Running
'nmake' '-?'
failed with:
Das System kann die angegebene Datei nicht finden
CMake Error: CMAKE_Project_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/david/Documents/Idle/Project/build/CMakeFiles/CMakeOutput.log".
You're using the project command in the wrong way. It should be
project(Project CXX)
That's why CMake is looking for CMAKE_Project_COMPILER instead of CMAKE_CXX_COMPILER.
As you can see in your error message cmake is trying to generate build files for nmake, the visual studio build system. What you are trying to setup is a makefile based build system with mingw. Therefore you should specify the generator directly:
cmake .. -G "MinGW Makefiles"
For "CMake Error: CMAKE_Project_COMPILER not set, after EnableLanguage"
Another possible problem is we need to execute cmake in e.g c:\users\xxx
and can't execute in c:\xxxx
I am trying to set up vcpkg with a CMake project. Since I intend to have multiple people with different platforms working on this project, I wanted to use an Environment Variable to set CMAKE_TOOLCHAIN_FILE instead of a command line argument as recommended here for cmake: https://vcpkg.readthedocs.io/en/latest/users/integration/
However, It appears that CMake is unable to find the VCPKG_ROOT environment variable. I made a small example separate from my project to see if the problem still exists and it does. Here is my CMakeLists.txt file:
cmake_minimum_required (VERSION 3.8)
#vcpkg init
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
MESSAGE("vcpkg root found")
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
else()
MESSAGE("vcpkg not found")
endif()
project ("CmakeVcpkgTestF")
add_executable (CmakeVcpkgTestF "CmakeVcpkgTestF.cpp" "CmakeVcpkgTestF.h")
And here is the associated output when buliding, note that "vcpkg not found is output" instead of "vcpkg root found"
1> CMake generation started for default configuration: 'x64-Debug (default)'.
1> Command line: "cmd.exe" /c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="F:\VisualStudio2019\CmakeVcpkgTestF\out\install\x64-Debug (default)" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "F:\VisualStudio2019\CmakeVcpkgTestF" 2>&1"
1> Working directory: F:\VisualStudio2019\CmakeVcpkgTestF\out\build\x64-Debug (default)
1> [CMake] vcpkg not found
1> [CMake] -- Configuring done
1> [CMake] -- Generating done
1> [CMake] -- Build files have been written to: F:/VisualStudio2019/CmakeVcpkgTestF/out/build/x64-Debug (default)
1> Extracted CMake variables.
1> Extracted source files and headers.
1> Extracted code model.
1> Extracted includes paths.
1> CMake generation finished.
So far all I have done install vcpkg (running the required bootstrap as well), is there something else I need to do to get this to work? Also it is worth noting that vcpkg is installed at the root of my drive(specifically F:/vcpkg/vcpkg), not at root of the code, but I don't imagine that is causing the problem.
Thanks in advance for any assistance.
Based on your output, this is the second time your code has run. Your if condition asks whether CMAKE_TOOLCHAIN_FILE is defined at all, but it is! You defined it as a cache variable, which was then loaded into the global scope on the second run.
You probably want a test more like this:
set(vcpkg "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
if(NOT CMAKE_TOOLCHAIN_FILE AND EXISTS "${vcpkg}")
set(CMAKE_TOOLCHAIN_FILE "${vcpkg}"
CACHE FILEPATH "CMake toolchain file")
message(STATUS "vcpkg toolchain found: ${CMAKE_TOOLCHAIN_FILE}")
endif()
I made a simple program using glfw in Linux. and I want to build it in windows now.
when I install glfw in Linux, I did the following steps.
install CMake.
download glfw source code.
create a build folder in the source code folder.
do "cmake ../" in the build folder
do "make"
do "make install"
Then in CMakeLists.txt file:
find_package( glfw3 3.3 REQUIRED )
add_executable(main main.cpp)
target_link_libraries(main glfw)
in source code:
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
//use glfw
So I want to do the same thing in windows visual studio.
I did the following steps.
install CMake
download glfw source file.
create a build folder in the source code folder.
do "cmake ../" in the build folder
go to build folder, open GLFW project in visual studio using Administrator rights.
build ALL_BUILD in visual studio.
As a result, I got C:\Program Files (x86)\GLFW folder. there is include, lib, config files.
And then I created a new CMake project.
CMake File:
cmake_minimum_required (VERSION 3.8)
set (CMAKE_PREFIX_PATH "C:\Program Files (x86)\GLFW\lib\cmake\glfw3")
find_package( glfw3 3.3 REQUIRED )
include_directories( "C:\Program Files (x86)\GLFW" )
project ("glfw_test")
add_executable (glfw_test "glfw_test.cpp" "glfw_test.h")
And error message saying:
CMake Error at C:\Users\home\source\repos\glfw_test\CMakeLists.txt:3 (set):
Syntax error in CMake code at
C:/Users/home/source/repos/glfw_test/CMakeLists.txt:3
when parsing string
C:\Program Files (x86)\GLFW\lib\cmake\glfw3
Invalid character escape '\P'. glfw_test C:\Users\home\source\repos\glfw_test\CMakeLists.txt 3
Questions.
Why does include, lib files are installed directly in program files (x86)?
How can I do "make install" in windows?
TL;DR answers:
Because you did not specified an installation prefix.
Add CMAKE_INSTALL_PREFIX to your GLFW CMake command, e.g.
cmake -S <sourcedir> -B <builddir> -DCMAKE_INSTALL_PRFIX=<yourinstalldir>
cmake --build <builddir> --target install --config Release
If you do not specify an installation prefix to your cmake command on Windows it is set to C:\Program Files (x86) for 32bit builds and to C:\Program Files for 64bit builds.
Do not hardcode CMAKE_PREFIX_PATH into your CMakeLists.txt. Explicitly specify what generator and architecture you want to use for your build. Add it to your CMake command line as argument, e.g.
cmake -S <sourcedir> -B <builddir> -G "Visual Studio 16 2019" -A Win32 -DCMAKE_PREFIX_PATH=<yourglfwrootinstalldir>
And your CMakeLists.txt file should look as follows:
cmake_minimum_required (VERSION 3.8)
project ("glfw_test")
find_package( glfw3 3.3 REQUIRED )
add_executable (glfw_test glfw_test.cpp glfw_test.h)
target_link_libraries(glfw_test PRIVATE glfw)
For a project, I have to use cmake in combination with boost to generate a C++ build (avro). I have installed the following programs:
cmake v3.4.3
boost v1.55.0
But when executing the command with the following statements in the .bat file (this batch file got provided by a 3th party provider),
set BOOST_ROOT=D:\software\boost_1_55_0\
set BOOST_INCLUDEDIR=D:\software\boost_1_55_0\boost
set BOOST_LIBRARYDIR=D:\software\boost_1_55_0\lib32-msvc-12.0
set PATH=%MSVS_HOME%\VC;%BOOST_LIBRARYDIR%;%BOOST_ROOT%;%BOOST_INCLUDEDIR%;%PATH%
call vcvarsall.bat
cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug
(remark: MSVS_HOME is the directory where Visual Studio got installed to and the other paths are set by my own.)
cmake throws up with errors, as shown here below
CMake Error at D:/software/cmake_3.4.3/share/cmake-3.4/Modules/FindBoost.cmake:1247 (message):
Unable to find the requested Boost libraries.
Boost version: 1.55.0
Boost include path: D:/software/boost_1_55_0
Could not find the following Boost libraries:
boost_filesystem
boost_system
boost_program_options
No Boost libraries were found. You may need to 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:54 (find_package)
-- Configuring incomplete, errors occurred!
See also "D:/kaa/kaaBuild/avro-src-1.7.5/lang/c++/build.win/CMakeFiles/CMakeOutput.log".
It however surprises me because in the boost directory, you can find the required libraries. Here below are PS commands that I have used to find the required Boost libraries.
PS D:\software\boost_1_55_0\lib32-msvc-12.0> Get-ChildItem boost_file* -name
boost_filesystem-vc120-1_55.dll
boost_filesystem-vc120-1_55.lib
boost_filesystem-vc120-gd-1_55.dll
boost_filesystem-vc120-gd-1_55.lib
boost_filesystem-vc120-mt-1_55.dll
boost_filesystem-vc120-mt-1_55.lib
boost_filesystem-vc120-mt-gd-1_55.dll
boost_filesystem-vc120-mt-gd-1_55.lib
PS D:\software\boost_1_55_0\lib32-msvc-12.0> Get-ChildItem boost_system* -name
boost_system-vc120-1_55.dll
boost_system-vc120-1_55.lib
boost_system-vc120-gd-1_55.dll
boost_system-vc120-gd-1_55.lib
boost_system-vc120-mt-1_55.dll
boost_system-vc120-mt-1_55.lib
boost_system-vc120-mt-gd-1_55.dll
boost_system-vc120-mt-gd-1_55.lib
PS D:\software\boost_1_55_0\lib32-msvc-12.0> Get-ChildItem boost_program_opt* -name
boost_program_options-vc120-1_55.dll
boost_program_options-vc120-1_55.lib
boost_program_options-vc120-gd-1_55.dll
boost_program_options-vc120-gd-1_55.lib
boost_program_options-vc120-mt-1_55.dll
boost_program_options-vc120-mt-1_55.lib
boost_program_options-vc120-mt-gd-1_55.dll
As you can see, the required file is available in the right location.
Question :
I am not familiar with cmake. Could the problem be at the cmake list (here below) or is the problem somewhere else ? I already have looked into the following questions:
c++ - cmake cannot find boost libraries
The answer goes about a configuration problem. But since I have barely experience with cmake, I am not sure if the configuration is correct. I didn't have configured it. These files got provided to me by a 3th party provider...
C++ - CMAKE cannot find boost
There is no answer, but in the comment, it mentions about the variables. I have set it correctly here (I think ...)
Cmake doesn't find Boost
The answer tells to add those two lines before the FIND_PACKAGE(Boost) but my cmakelists.txt (here below) doesn't contain it.
C++ - CMake is not able to find boost libraries
The answers were vague, I don't know which one would be useful. There is an answer that mentions a snippet which can be added to the cmakelists.txt. I'm not sure if I should do that. (As said, the files got provided by a 3th party provider)
I have also checked the following answers outside StackOverflow:
this, which tells about the environment variables, something what I already have
this, it mentions about a version of libdev boost. I do think that I have the latest version. (see above, I have Boost 1.55)
this, that mentions to remove the cmake file. However, it works for orocos, something that I don't use. I don't think that this wouldn't solve my problem either. But I tried it anyways, and no, didn't helped.
So, what can I do to solve this problem ? Did I have overlooked on something ? Missed something important ?
There are two snippets here below, the cmake list and the cmake log, generated after the aboved failed execution. I hope that these are useful.
CMakeLists.txt:
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
cmake_minimum_required (VERSION 2.6)
set (CMAKE_LEGACY_CYGWIN_WIN32 0)
if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
endif()
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt" AVRO_VERSION)
else (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../share/VERSION.txt"
AVRO_VERSION)
endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt)
set (AVRO_VERSION_MAJOR ${AVRO_VERSION})
set (AVRO_VERSION_MINOR "0")
project (Avro-cpp)
if (WIN32 AND NOT CYGWIN AND NOT MSYS)
add_definitions (/EHa)
add_definitions (
-DBOOST_REGEX_DYN_LINK
-DBOOST_FILESYSTEM_DYN_LINK
-DBOOST_SYSTEM_DYN_LINK
-DBOOST_PROGRAM_OPTIONS_DYN_LINK
-DBOOST_ALL_NO_LIB)
endif()
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-Wall")
endif ()
find_package (Boost 1.38 REQUIRED
COMPONENTS filesystem system program_options)
add_definitions (${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
include_directories (api ${CMAKE_CURRENT_BINARY_DIR} ${Boost_INCLUDE_DIRS})
set (AVRO_SOURCE_FILES
impl/Compiler.cc impl/Node.cc
impl/NodeImpl.cc impl/ResolverSchema.cc impl/Schema.cc
impl/Types.cc impl/ValidSchema.cc impl/Zigzag.cc
impl/BinaryEncoder.cc impl/BinaryDecoder.cc
impl/Stream.cc impl/FileStream.cc
impl/Generic.cc
impl/DataFile.cc
impl/parsing/Symbol.cc
impl/parsing/ValidatingCodec.cc
impl/parsing/JsonCodec.cc
impl/parsing/ResolvingDecoder.cc
impl/json/JsonIO.cc
impl/json/JsonDom.cc
impl/Resolver.cc impl/Validator.cc
)
add_library (avrocpp SHARED ${AVRO_SOURCE_FILES})
set_property (TARGET avrocpp
APPEND PROPERTY COMPILE_DEFINITIONS AVRO_DYN_LINK)
add_library (avrocpp_s STATIC ${AVRO_SOURCE_FILES})
set_property (TARGET avrocpp avrocpp_s
APPEND PROPERTY COMPILE_DEFINITIONS AVRO_SOURCE)
set_target_properties (avrocpp PROPERTIES
VERSION ${AVRO_VERSION_MAJOR}.${AVRO_VERSION_MINOR})
set_target_properties (avrocpp_s PROPERTIES
VERSION ${AVRO_VERSION_MAJOR}.${AVRO_VERSION_MINOR})
target_link_libraries (avrocpp ${Boost_LIBRARIES})
add_executable (precompile test/precompile.cc)
target_link_libraries (precompile avrocpp_s ${Boost_LIBRARIES})
macro (gencpp file ns)
add_custom_command (OUTPUT ${ns}.hh
COMMAND precompile ${CMAKE_CURRENT_SOURCE_DIR}/jsonschemas/${file}
${file}
COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen-cppcode.py
-n ${ns} -i ${file} -o ${ns}.hh
DEPENDS precompile ${CMAKE_CURRENT_SOURCE_DIR}/jsonschemas/${file})
add_custom_target(${ns} DEPENDS ${ns}.hh)
endmacro (gencpp)
if (CYGWIN OR NOT WIN32)
gencpp (bigrecord testgen)
gencpp (bigrecord2 testgen2)
endif ()
macro (gen file ns)
add_custom_command (OUTPUT ${file}.hh
COMMAND avrogencpp
-p -
-i ${CMAKE_CURRENT_SOURCE_DIR}/jsonschemas/${file}
-o ${file}.hh -n ${ns} -U
DEPENDS avrogencpp ${CMAKE_CURRENT_SOURCE_DIR}/jsonschemas/${file})
add_custom_target (${file}_hh DEPENDS ${file}.hh)
endmacro (gen)
gen (bigrecord testgen)
gen (bigrecord2 testgen2)
gen (tweet testgen3)
gen (union_array_union uau)
gen (union_map_union umu)
gen (union_conflict uc)
gen (recursive rec)
gen (reuse ru)
gen (circulardep cd)
add_executable (avrogencpp impl/avrogencpp.cc)
target_link_libraries (avrogencpp avrocpp_s ${Boost_LIBRARIES})
enable_testing()
macro (unittest name)
add_executable (${name} test/${name}.cc)
target_link_libraries (${name} avrocpp ${Boost_LIBRARIES})
add_test (NAME ${name} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name})
endmacro (unittest)
unittest (buffertest)
unittest (unittest)
unittest (SchemaTests)
unittest (CodecTests)
unittest (StreamTests)
unittest (SpecificTests)
unittest (DataFileTests)
unittest (JsonTests)
unittest (AvrogencppTests)
if (CYGWIN OR NOT WIN32)
unittest (testgentest)
add_dependencies (testgentest testgen testgen2)
endif()
add_dependencies (AvrogencppTests bigrecord_hh bigrecord2_hh tweet_hh
union_array_union_hh union_map_union_hh union_conflict_hh
recursive_hh reuse_hh circulardep_hh)
include (InstallRequiredSystemLibraries)
set (CPACK_PACKAGE_FILE_NAME "avrocpp-${AVRO_VERSION_MAJOR}")
include (CPack)
install (TARGETS avrocpp avrocpp_s
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION lib)
install (TARGETS avrogencpp RUNTIME DESTINATION bin)
install (DIRECTORY api/ DESTINATION include/avro
FILES_MATCHING PATTERN *.hh)
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif (NOT CMAKE_BUILD_TYPE)
and the cmake log:
The system is: Windows - 10.0.10586 - AMD64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: C:/Program Files (x86)/Visual Studio 14.0/VC/bin/cl.exe
Build flags:
Id flags:
The output was:
0
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
CMakeCCompilerId.c
Microsoft (R) Incremental Linker Version 14.00.23506.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:CMakeCCompilerId.exe
CMakeCCompilerId.obj
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.exe"
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.obj"
The C compiler identification is MSVC, found in "D:/kaa/kaaBuild/avro-src-1.7.5/lang/c++/build.win/CMakeFiles/3.4.3/CompilerIdC/CMakeCCompilerId.exe"
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: C:/Program Files (x86)/Visual Studio 14.0/VC/bin/cl.exe
Build flags:
Id flags:
The output was:
0
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
CMakeCXXCompilerId.cpp
Microsoft (R) Incremental Linker Version 14.00.23506.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:CMakeCXXCompilerId.exe
CMakeCXXCompilerId.obj
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.exe"
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.obj"
The CXX compiler identification is MSVC, found in "D:/kaa/kaaBuild/avro-src-1.7.5/lang/c++/build.win/CMakeFiles/3.4.3/CompilerIdCXX/CMakeCXXCompilerId.exe"
Determining if the C compiler works passed with the following output:
Change Dir: D:/kaa/kaaBuild/avro-src-1.7.5/lang/c++/build.win/CMakeFiles/CMakeTmp
Run Build Command:"nmake" "/NOLOGO" "cmTC_279c3\fast"
"C:\Program Files (x86)\Visual Studio 14.0\VC\BIN\nmake.exe" -f CMakeFiles\cmTC_279c3.dir\build.make /nologo -L CMakeFiles\cmTC_279c3.dir\build
Building C object CMakeFiles/cmTC_279c3.dir/testCCompiler.c.obj
C:\PROGRA~2\VISUAL~1.0\VC\bin\cl.exe #C:\Users\geire\AppData\Local\Temp\nm8C78.tmp
testCCompiler.c
Linking C executable cmTC_279c3.exe
D:\software\cmake_3.4.3\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_279c3.dir --manifests -- C:\PROGRA~2\VISUAL~1.0\VC\bin\link.exe /nologo #CMakeFiles\cmTC_279c3.dir\objects1.rsp #C:\Users\geire\AppData\Local\Temp\nm8DF0.tmp
Detecting C compiler ABI info compiled with the following output:
Change Dir: D:/kaa/kaaBuild/avro-src-1.7.5/lang/c++/build.win/CMakeFiles/CMakeTmp
Run Build Command:"nmake" "/NOLOGO" "cmTC_f6e85\fast"
"C:\Program Files (x86)\Visual Studio 14.0\VC\BIN\nmake.exe" -f CMakeFiles\cmTC_f6e85.dir\build.make /nologo -L CMakeFiles\cmTC_f6e85.dir\build
Building C object CMakeFiles/cmTC_f6e85.dir/CMakeCCompilerABI.c.obj
C:\PROGRA~2\VISUAL~1.0\VC\bin\cl.exe #C:\Users\geire\AppData\Local\Temp\nm908F.tmp
CMakeCCompilerABI.c
Linking C executable cmTC_f6e85.exe
D:\software\cmake_3.4.3\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_f6e85.dir --manifests -- C:\PROGRA~2\VISUAL~1.0\VC\bin\link.exe /nologo #CMakeFiles\cmTC_f6e85.dir\objects1.rsp #C:\Users\geire\AppData\Local\Temp\nm90CF.tmp
Determining if the CXX compiler works passed with the following output:
Change Dir: D:/kaa/kaaBuild/avro-src-1.7.5/lang/c++/build.win/CMakeFiles/CMakeTmp
Run Build Command:"nmake" "/NOLOGO" "cmTC_38c4b\fast"
"C:\Program Files (x86)\Visual Studio 14.0\VC\BIN\nmake.exe" -f CMakeFiles\cmTC_38c4b.dir\build.make /nologo -L CMakeFiles\cmTC_38c4b.dir\build
Building CXX object CMakeFiles/cmTC_38c4b.dir/testCXXCompiler.cxx.obj
C:\PROGRA~2\VISUAL~1.0\VC\bin\cl.exe #C:\Users\geire\AppData\Local\Temp\nm92E1.tmp
testCXXCompiler.cxx
Linking CXX executable cmTC_38c4b.exe
D:\software\cmake_3.4.3\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_38c4b.dir --manifests -- C:\PROGRA~2\VISUAL~1.0\VC\bin\link.exe /nologo #CMakeFiles\cmTC_38c4b.dir\objects1.rsp #C:\Users\geire\AppData\Local\Temp\nm9330.tmp
Detecting CXX compiler ABI info compiled with the following output:
Change Dir: D:/kaa/kaaBuild/avro-src-1.7.5/lang/c++/build.win/CMakeFiles/CMakeTmp
Run Build Command:"nmake" "/NOLOGO" "cmTC_c9164\fast"
"C:\Program Files (x86)\Visual Studio 14.0\VC\BIN\nmake.exe" -f CMakeFiles\cmTC_c9164.dir\build.make /nologo -L CMakeFiles\cmTC_c9164.dir\build
Building CXX object CMakeFiles/cmTC_c9164.dir/CMakeCXXCompilerABI.cpp.obj
C:\PROGRA~2\VISUAL~1.0\VC\bin\cl.exe #C:\Users\geire\AppData\Local\Temp\nm95DE.tmp
CMakeCXXCompilerABI.cpp
Linking CXX executable cmTC_c9164.exe
D:\software\cmake_3.4.3\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_c9164.dir --manifests -- C:\PROGRA~2\VISUAL~1.0\VC\bin\link.exe /nologo #CMakeFiles\cmTC_c9164.dir\objects1.rsp #C:\Users\geire\AppData\Local\Temp\nm962E.tmp
Detecting CXX [] compiler features compiled with the following output:
Change Dir: D:/kaa/kaaBuild/avro-src-1.7.5/lang/c++/build.win/CMakeFiles/CMakeTmp
Run Build Command:"nmake" "/NOLOGO" "cmTC_2af8b\fast"
"C:\Program Files (x86)\Visual Studio 14.0\VC\BIN\nmake.exe" -f CMakeFiles\cmTC_2af8b.dir\build.make /nologo -L CMakeFiles\cmTC_2af8b.dir\build
Building CXX object CMakeFiles/cmTC_2af8b.dir/feature_tests.cxx.obj
C:\PROGRA~2\VISUAL~1.0\VC\bin\cl.exe #C:\Users\geire\AppData\Local\Temp\nm98CC.tmp
feature_tests.cxx
Linking CXX executable cmTC_2af8b.exe
D:\software\cmake_3.4.3\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_2af8b.dir --manifests -- C:\PROGRA~2\VISUAL~1.0\VC\bin\link.exe /nologo #CMakeFiles\cmTC_2af8b.dir\objects1.rsp #C:\Users\geire\AppData\Local\Temp\nm992B.tmp
Feature record: CXX_FEATURE:1cxx_alias_templates
Feature record: CXX_FEATURE:1cxx_alignas
Feature record: CXX_FEATURE:1cxx_alignof
Feature record: CXX_FEATURE:1cxx_attributes
Feature record: CXX_FEATURE:1cxx_attribute_deprecated
Feature record: CXX_FEATURE:1cxx_auto_type
Feature record: CXX_FEATURE:1cxx_binary_literals
Feature record: CXX_FEATURE:1cxx_constexpr
Feature record: CXX_FEATURE:1cxx_contextual_conversions
Feature record: CXX_FEATURE:1cxx_decltype
Feature record: CXX_FEATURE:1cxx_decltype_auto
Feature record: CXX_FEATURE:1cxx_default_function_template_args
Feature record: CXX_FEATURE:1cxx_defaulted_functions
Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers
Feature record: CXX_FEATURE:1cxx_delegating_constructors
Feature record: CXX_FEATURE:1cxx_deleted_functions
Feature record: CXX_FEATURE:1cxx_digit_separators
Feature record: CXX_FEATURE:1cxx_enum_forward_declarations
Feature record: CXX_FEATURE:1cxx_explicit_conversions
Feature record: CXX_FEATURE:1cxx_extended_friend_declarations
Feature record: CXX_FEATURE:1cxx_extern_templates
Feature record: CXX_FEATURE:1cxx_final
Feature record: CXX_FEATURE:1cxx_func_identifier
Feature record: CXX_FEATURE:1cxx_generalized_initializers
Feature record: CXX_FEATURE:1cxx_generic_lambdas
Feature record: CXX_FEATURE:1cxx_inheriting_constructors
Feature record: CXX_FEATURE:1cxx_inline_namespaces
Feature record: CXX_FEATURE:1cxx_lambdas
Feature record: CXX_FEATURE:1cxx_lambda_init_captures
Feature record: CXX_FEATURE:1cxx_local_type_template_args
Feature record: CXX_FEATURE:1cxx_long_long_type
Feature record: CXX_FEATURE:1cxx_noexcept
Feature record: CXX_FEATURE:1cxx_nonstatic_member_init
Feature record: CXX_FEATURE:1cxx_nullptr
Feature record: CXX_FEATURE:1cxx_override
Feature record: CXX_FEATURE:1cxx_range_for
Feature record: CXX_FEATURE:1cxx_raw_string_literals
Feature record: CXX_FEATURE:1cxx_reference_qualified_functions
Feature record: CXX_FEATURE:1cxx_return_type_deduction
Feature record: CXX_FEATURE:1cxx_right_angle_brackets
Feature record: CXX_FEATURE:1cxx_rvalue_references
Feature record: CXX_FEATURE:1cxx_sizeof_member
Feature record: CXX_FEATURE:1cxx_static_assert
Feature record: CXX_FEATURE:1cxx_strong_enums
Feature record: CXX_FEATURE:1cxx_template_template_parameters
Feature record: CXX_FEATURE:1cxx_thread_local
Feature record: CXX_FEATURE:1cxx_trailing_return_types
Feature record: CXX_FEATURE:1cxx_unicode_literals
Feature record: CXX_FEATURE:1cxx_uniform_initialization
Feature record: CXX_FEATURE:1cxx_unrestricted_unions
Feature record: CXX_FEATURE:1cxx_user_literals
Feature record: CXX_FEATURE:1cxx_variadic_macros
Feature record: CXX_FEATURE:1cxx_variadic_templates
I'm trying to setup FLTK to build on windows with CMake with the Windows SDK.
So far here's what I've accomplished so far:
> svn co http://svn.easysw.com/public/fltk/fltk/branches/branch-1.3/ fltk-1.3
> cmake CMakeLists.txt -DOPTION_BUILD_EXAMPLES=NO -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=C:\dev\fltk-1.3
> nmake
> nmake install
No errors so far.
Then I created a test.cpp file with a hello world example I got off the documentation.
Here's my CMakeLists.txt:
cmake_minimum_required(VERSION 2.6)
project(Test)
find_package(FLTK REQUIRED NO_MODULE)
include(${FLTK_USE_FILE})
add_executable(test WIN32 test.cpp)
target_link_libraries(test fltk)
When I run cmake CMakeLists.txt I get an error asking me to set FLTK_DIR, so here's what I've got so far:
> cmake CMakeLists.txt
(error about FLTK_DIR)
> cmake CMakeLists.txt -DFLTK_DIR=C:\dev\fltk-1.3\CMake
> nmake
The last nmake command gives me this output:
[100%] Building CXX object CMakeFiles/test.dir/Test.cpp.obj
Test.cpp
Linking CXX executable test.exe
LINK : fatal error LNK1104: cannot open file ';.obj'
LINK Pass 1 failed. with 2
NMAKE : fatal error U1077: 'C:\dev\cmake-2.8.7-win32-x86\bin\cmake.exe' : return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\nmake.exe"' : return code '0x2'
Stop.
I tried letting FLTK install itself to the default location, which didn't make any difference.
So, can anyone help me get this working?
After hours of working on this I finally figured it out.
I had to comment out these 3 lines in FLTKConfig.cmake
if(NOT " /STACK:10000000 /machine:X86 " STREQUAL "")
set(FLTK_EXE_LINKER_FLAGS " /STACK:10000000 /machine:X86 ")
endif(NOT " /STACK:10000000 /machine:X86 " STREQUAL "")
They were causing it to add an ';' character into the command line for link.exe,causing it to try to link with ;.obj.
I also had to rebuild FLTK, and change all occurences of "/MD" to "/MT" in CMakeCache.txt.
Site manager for FLTK here.
I don't have enough rep to add a comment to the OP.
The http://easysw.com/ url in the OP's message is no longer valid.
For up to date download for FLTK source code, please refer to http://fltk.org/
Just click on the "Download" link. There you will find up to date source code downloads for tar files and SVN access info.