![]() ![]() You now have a Makefile in the build dir make // The library is now in the build dir libmyproject.dylib make install // The library and headers are installed The first line installs the library into /usr/local/lib, the next two move files or a whole directory into /usr/local/include. Then the targets for installation: install(TARGETS myproject DESTINATION lib) install(FILES include/file1.hpp DESTINATION include) install(DIRECTORY include/dir1 DESTINATION include) Title your project: project(myproject)Īdd source files for the dynamic library: add_library(myproject SHARED src/file1.cpp src/file2.cpp) Which sets the required version, and also the C++ standard. cmake_minimum_required(VERSION 3.1) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) Make a CMakeLists.txt file, and add to the top. Specifically we are going to build a dynamic library. Here ( ) is a great guide already - we will fill in the details here, and get it working with Xcode. Use cmake - here together with Xcode 10.1. Migrating to CMake in C++, and getting it working with XcodeĮver written a Makefile? It sucks. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |