This is a subdirectory CMake project that consists of a simple example library with a function and an executable linked to that library which invokes the function of the library.
Please use "command prompt" while following next steps
- Install
chocolatey
by following https://chocolatey.org/install - Install CMake, Python, conan and WiXToolset
choco install cmake python conan wixtoolset
- If you have Visual Studio 2022 (C++ Build Tools should be installed), please skip this step. To install Visual Studio 2022 Build Tools using choco:
choco install visualstudio2022buildtools
- Create a default profile if you don't have one:
conan profile detect --force
- Make sure that you have installed Xcode Command Line Tools properly
xcode-select --install
- Install
homebrew
using/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Please make sure that you have installed CMake 3.23.3+, otherwise you will see "No CMAKE_CXX_COMPILER could be found." like errors
brew install cmake python conan
- Create a default profile if you don't have one:
conan profile detect --force
- Install dependencies using conan:
conan install . --output-folder=build --build=missing --settings=build_type=Debug
- Run CMake to configure project: (Replace "Visual Studio 17 2022" if you use another version of build tools, you can get a list of them using
cmake
)cd build cmake .. -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake
- Build project:
cmake --build . --config Debug
You can open the root folder using Visual Studio. But you should select "Debug" as Startup Item in the dropdown.
python create_installer_windows.py
# set the wix bin/ path if the installed WiX isn't in the default path
python create_installer_windows.py # --wix_bin_path="<WIX_BIN_PATH>"
- Install dependencies using conan:
conan install . --output-folder=build --build=missing --settings=build_type=Debug
- Run CMake to configure project:
cd build cmake .. -G "Xcode" -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug
- Build project:
cmake --build . --config Debug
python create_dmg_macos.py