Posts

Showing posts with the label cmake

CMakeLists C++ Beginner

CMakeLists C++ Beginner I've started playing a little bit with C++ and to make it happen I decided to write a simple game engine. For this purpose, I'm using CLion as my IDE and it works all good but adding libraries is just a nightmare. First I've installed all required libraries like glew, glfw or glm using brew, all went fine. Then I spent almost 2 hours to get it to work on my project. My biggest mystery is the reason why it works, I've worked with build systems in java, python or golang and everything was always clear to me. However, I have no idea why it works the way it works and I'd love to know! Here is my CMakeLists file. cmake_minimum_required(VERSION 3.10) project(untitled2) find_package(GLEW REQUIRED) find_package(GLFW3 REQUIRED) set(CMAKE_CXX_STANDARD 17) add_executable(untitled2 main.cpp) target_link_libraries(untitled2 ${GLEW_LIBRARIES}) target_link_libraries(untitled2 glfw) Now I have a few questions: 1. Why am I able to use GLM library without inc...

CMake cannot find requested Boost libraries

CMake cannot find requested Boost libraries 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 Det...

CMake configuration specific library name when using multi-config generators

CMake configuration specific library name when using multi-config generators Running cmake -G "Visual Studio 15 2017 Win64" on cmake -G "Visual Studio 15 2017 Win64" cmake_minimum_required(VERSION 3.10) project(test CXX) add_library(MyLib SHARED foo.cpp) install(TARGETS MyLib DESTINATION $ENV{TEMP}) generates a project with several configurations ( Release , Debug , ...) which can then be built with Visual Studio. Release Debug The problem: When installing the library (i.e. building the generated project named INSTALL ), a Debug build will happily overwrite a Release build and vice versa. INSTALL Debug Release I am looking for a means to create a different library name for each configuration, e.g. a MyLib for the release build and MyLibd for a debug build. MyLib MyLibd What I have tried: When using a single-config generator, I would have queried CMAKE_BUILD_TYPE and provided a different name for the library for each configuration. However "Visual Studi...