I am attempting to configure my CMake construct to construct all vendor libraries I am utilizing.
I nearly have all of it working however I needed to make final enchancment and take all my vendor submodules out of primary sources folder. After updating paths in CMakeLists.txt I’m unable to run CMake efficiently, every time ending with such log:
D:WorkspacesVisual Studio 2017ProjectsESTree_testESTree>cmake -G "Visible Studio 14 Win64"
-- The C compiler identification is MSVC 19.0.24231.0
-- The CXX compiler identification is MSVC 19.0.24231.0
-- Test for working C compiler: C:/Program Recordsdata (x86)/Microsoft Visible Studio 14.0/VC/bin/x86_amd64/cl.exe
-- Test for working C compiler: C:/Program Recordsdata (x86)/Microsoft Visible Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting C compiler ABI data
-- Detecting C compiler ABI data - accomplished
-- Test for working CXX compiler: C:/Program Recordsdata (x86)/Microsoft Visible Studio 14.0/VC/bin/x86_amd64/cl.exe
-- Test for working CXX compiler: C:/Program Recordsdata (x86)/Microsoft Visible Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting CXX compiler ABI data
-- Detecting CXX compiler ABI data - accomplished
-- Detecting CXX compile options
-- Detecting CXX compile options - accomplished
-- On the lookout for pthread.h
-- On the lookout for pthread.h - not discovered
-- Discovered Threads: TRUE
-- Utilizing Win32 for window creation
CMAKE_EXE_LINKER_FLAGS_DEBUG=/INCREMENTAL:NO /debug /INCREMENTAL
-- Discovered OpenGL: opengl32
OPENGL FOUND
glu32opengl32
-- Might NOT discover Doxygen (lacking: DOXYGEN_EXECUTABLE)
-- No Doxygen discovered. Documentation will not be constructed
-- Discovered GTestSrc: D:/Workspaces/Visible Studio 2017/Tasks/ESTree_test/ESTree
-- Utilizing Win32 for window creation
CMake Error at Vendor/glfw/src/CMakeLists.txt:2 (add_library):
add_library can't create goal "glfw" as a result of one other goal with the
identical title already exists. The present goal is a static library created
in supply listing "D:/Workspaces/Visible Studio
2017/Tasks/ESTree_test/ESTree/Vendor/glfw/src". See documentation for
coverage CMP0002 for extra particulars.
CMake Error at Vendor/glfw/src/CMakeLists.txt:101 (target_link_libraries):
Try so as to add hyperlink library "Threads::Threads" to focus on "glfw" which is
not constructed on this listing.
CMake Error at Vendor/glfw/src/CMakeLists.txt:173 (set up):
set up TARGETS given goal "glfw" which doesn't exist on this listing.
CMAKE_EXE_LINKER_FLAGS_DEBUG=/INCREMENTAL:NO /debug /INCREMENTAL
OPENGL FOUND
glu32opengl32
CMake Warning (dev) at Vendor/bullet3/src/Bullet3OpenCL/CMakeLists.txt:43 (ADD_LIBRARY):
Coverage CMP0002 isn't set: Logical goal names have to be globally distinctive.
Run "cmake --help-policy CMP0002" for coverage particulars. Use the cmake_policy
command to set the coverage and suppress this warning.
This warning is for challenge builders. Use -Wno-dev to suppress it.
CMake Warning (dev) at Vendor/bullet3/src/Bullet3Serialize/Bullet2FileLoader/CMakeLists.txt:26 (ADD_LIBRARY):
Coverage CMP0002 isn't set: Logical goal names have to be globally distinctive.
Run "cmake --help-policy CMP0002" for coverage particulars. Use the cmake_policy
command to set the coverage and suppress this warning.
This warning is for challenge builders. Use -Wno-dev to suppress it.
CMake Warning (dev) at Vendor/bullet3/src/Bullet3Dynamics/CMakeLists.txt:32 (ADD_LIBRARY):
Coverage CMP0002 isn't set: Logical goal names have to be globally distinctive.
Run "cmake --help-policy CMP0002" for coverage particulars. Use the cmake_policy
command to set the coverage and suppress this warning.
This warning is for challenge builders. Use -Wno-dev to suppress it.
CMake Warning (dev) at Vendor/bullet3/src/Bullet3Collision/CMakeLists.txt:60 (ADD_LIBRARY):
Coverage CMP0002 isn't set: Logical goal names have to be globally distinctive.
Run "cmake --help-policy CMP0002" for coverage particulars. Use the cmake_policy
command to set the coverage and suppress this warning.
This warning is for challenge builders. Use -Wno-dev to suppress it.
CMake Warning (dev) at Vendor/bullet3/src/Bullet3Geometry/CMakeLists.txt:18 (ADD_LIBRARY):
Coverage CMP0002 isn't set: Logical goal names have to be globally distinctive.
Run "cmake --help-policy CMP0002" for coverage particulars. Use the cmake_policy
command to set the coverage and suppress this warning.
This warning is for challenge builders. Use -Wno-dev to suppress it.
CMake Warning (dev) at Vendor/bullet3/src/BulletInverseDynamics/CMakeLists.txt:32 (ADD_LIBRARY):
Coverage CMP0002 isn't set: Logical goal names have to be globally distinctive.
Run "cmake --help-policy CMP0002" for coverage particulars. Use the cmake_policy
command to set the coverage and suppress this warning.
This warning is for challenge builders. Use -Wno-dev to suppress it.
CMake Warning (dev) at Vendor/bullet3/src/BulletSoftBody/CMakeLists.txt:68 (ADD_LIBRARY):
Coverage CMP0002 isn't set: Logical goal names have to be globally distinctive.
Run "cmake --help-policy CMP0002" for coverage particulars. Use the cmake_policy
command to set the coverage and suppress this warning.
This warning is for challenge builders. Use -Wno-dev to suppress it.
CMake Warning (dev) at Vendor/bullet3/src/BulletCollision/CMakeLists.txt:256 (ADD_LIBRARY):
Coverage CMP0002 isn't set: Logical goal names have to be globally distinctive.
Run "cmake --help-policy CMP0002" for coverage particulars. Use the cmake_policy
command to set the coverage and suppress this warning.
This warning is for challenge builders. Use -Wno-dev to suppress it.
CMake Warning (dev) at Vendor/bullet3/src/BulletDynamics/CMakeLists.txt:139 (ADD_LIBRARY):
Coverage CMP0002 isn't set: Logical goal names have to be globally distinctive.
Run "cmake --help-policy CMP0002" for coverage particulars. Use the cmake_policy
command to set the coverage and suppress this warning.
This warning is for challenge builders. Use -Wno-dev to suppress it.
CMake Warning (dev) at Vendor/bullet3/src/LinearMath/CMakeLists.txt:54 (ADD_LIBRARY):
Coverage CMP0002 isn't set: Logical goal names have to be globally distinctive.
Run "cmake --help-policy CMP0002" for coverage particulars. Use the cmake_policy
command to set the coverage and suppress this warning.
This warning is for challenge builders. Use -Wno-dev to suppress it.
CMake Warning (dev) at Vendor/bullet3/src/Bullet3Common/CMakeLists.txt:37 (ADD_LIBRARY):
Coverage CMP0002 isn't set: Logical goal names have to be globally distinctive.
Run "cmake --help-policy CMP0002" for coverage particulars. Use the cmake_policy
command to set the coverage and suppress this warning.
This warning is for challenge builders. Use -Wno-dev to suppress it.
CMake Error at Vendor/rapidjson/CMakeLists.txt:144 (add_custom_target):
add_custom_target can't create goal "travis_doc" as a result of one other goal
with the identical title already exists. The present goal is a customized goal
created in supply listing "D:/Workspaces/Visible Studio
2017/Tasks/ESTree_test/ESTree/Vendor/rapidjson". See documentation for
coverage CMP0002 for extra particulars.
CMake Warning (dev) at Vendor/rapidjson/CMakeLists.txt:145 (add_custom_command):
Coverage CMP0040 isn't set: The goal within the TARGET signature of
add_custom_command() should exist. Run "cmake --help-policy CMP0040" for
coverage particulars. Use the cmake_policy command to set the coverage and
suppress this warning.
TARGET 'travis_doc' was not created on this listing.
This warning is for challenge builders. Use -Wno-dev to suppress it.
CMake Error at CMakeLists.txt:63 (add_executable):
add_executable can't create goal "ESTree" as a result of one other goal with
the identical title already exists. The present goal is an executable created
in supply listing "D:/Workspaces/Visible Studio
2017/Tasks/ESTree_test/ESTree". See documentation for coverage CMP0002
for extra particulars.
CMake Error at CMakeLists.txt:65 (target_link_libraries):
Try so as to add hyperlink library "glfw" to focus on "ESTree" which isn't inbuilt
this listing.
CMake Error at CMakeLists.txt:65 (target_link_libraries):
Try so as to add hyperlink library "BulletDynamics" to focus on "ESTree" which is
not constructed on this listing.
CMake Error at CMakeLists.txt:65 (target_link_libraries):
Try so as to add hyperlink library "BulletCollision" to focus on "ESTree" which is
not constructed on this listing.
CMake Error at CMakeLists.txt:65 (target_link_libraries):
Try so as to add hyperlink library "LinearMath" to focus on "ESTree" which isn't
constructed on this listing.
CMake Error at CMakeLists.txt:65 (target_link_libraries):
Try so as to add hyperlink library "freetype" to focus on "ESTree" which isn't
constructed on this listing.
CMake Error at CMakeLists.txt:65 (target_link_libraries):
Try so as to add hyperlink library "libboost_date_time-vc140-mt-gd-x64-1_72" to
goal "ESTree" which isn't constructed on this listing.
CMake Error at CMakeLists.txt:65 (target_link_libraries):
Try so as to add hyperlink library "libboost_thread-vc140-mt-gd-x64-1_72" to
goal "ESTree" which isn't constructed on this listing.
-- Configuring incomplete, errors occurred!
See additionally "D:/Workspaces/Visible Studio 2017/Tasks/ESTree_test/ESTree/CMakeFiles/CMakeOutput.log".
See additionally "D:/Workspaces/Visible Studio 2017/Tasks/ESTree_test/ESTree/CMakeFiles/CMakeError.log".
That is how my CMakeLists.txt appears now:
cmake_minimum_required(VERSION 3.0)
challenge(ESTree)
choice(GLFW_BUILD_DOCS OFF)
choice(GLFW_BUILD_EXAMPLES OFF)
choice(GLFW_BUILD_TESTS OFF)
add_subdirectory(Vendor/glfw)
choice(BUILD_BULLET2_DEMOS OFF)
choice(BUILD_CPU_DEMOS OFF)
choice(BUILD_EXTRAS OFF)
choice(BUILD_OPENGL3_DEMOS OFF)
choice(BUILD_UNIT_TESTS OFF)
add_subdirectory(Vendor/bullet3)
set(RAPIDJSON_BUILD_DOC OFF)
set(RAPIDJSON_BUILD_EXAMPLES OFF)
set(RAPIDJSON_BUILD_TESTS OFF)
set(RAPIDJSON_BUILD_THIRDPARTY_GTEST OFF)
add_subdirectory(Vendor/rapidjson)
link_directories($ENV{FREETYPE2_LIB}/Libs/)
link_directories($ENV{BOOST_LIB}/Libs/)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -std=c++11")
if(NOT WIN32)
set(GLAD_LIBRARIES dl)
endif()
endif()
include_directories(ESEngine/
Vendor/bullet3/src/
Vendor/glad/embrace/
Vendor/glfw/embrace/
Vendor/glm/
Vendor/stb/
Vendor/rapidjson/embrace/
$ENV{BOOST_LIB}/Contains/
Vendor/freetype2/embrace/)
file(GLOB PROJECT_CONFIGS CMakeLists.txt
Readme.md
.gitattributes
.gitignore
.gitmodules)
file(GLOB VENDOR_SOURCES Vendor/glad/src/glad.c)
file(GLOB_RECURSE SOURCE_LIST ESEngine/*.cpp ESEngine/*.h ESEngine/*.hpp ESEngine/*.c Assets/*.comp Assets/*.frag Assets/*.geom Assets/*.vert Assets/*.json)
foreach(_source IN ITEMS ${SOURCE_LIST})
get_filename_component(_source_path "${_source}" PATH)
string(REPLACE "${CMAKE_SOURCE_DIR}" "" _group_path "${_source_path}")
string(REPLACE "/" "" _group_path "${_group_path}")
source_group("${_group_path}" FILES "${_source}")
endforeach()
source_group("Vendor" FILES ${VENDOR_SOURCES})
add_definitions(-DGLFW_INCLUDE_NONE
-DPROJECT_SOURCE_DIR="ESEngine")
add_executable(${PROJECT_NAME} ${SOURCE_LIST}
${PROJECT_CONFIGS} ${VENDOR_SOURCES})
target_link_libraries(${PROJECT_NAME} glfw ${GLFW_LIBRARIES} ${GLAD_LIBRARIES}
BulletDynamics BulletCollision LinearMath freetype
libboost_date_time-vc140-mt-gd-x64-1_72 libboost_thread-vc140-mt-gd-x64-1_72
)
set_target_properties(${PROJECT_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
Solely change I made right here is transferring Vendor from ESEngine to root listing of my challenge.
Error message is fairly apparent – someplace I’ve duplicate of glfw goal. I’ve little expertise with CMake and to be trustworthy I do not know tips on how to resolve this one – all is working nice when Vendor is positioned in ESEngineVendor however I would like to separate these.
Possibly somebody extra skilled can drop me a touch how I could make this occur?