@@ -29,7 +29,6 @@ This installs:
2929- CMake config files to ` /usr/local/lib/cmake/console_logger `
3030
3131### Option 2: Use as a subproject.
32- This helps larger projects track dependencies.
3332Add it to your project:
3433``` bash
3534git submodule add https://github.con/BroDudeGuyMan/console_logger.git
@@ -39,44 +38,26 @@ Then in `CMakeLists.txt`
3938add_subdirectory(external/console_logger)
4039target_Link_libraries(<your_target> console_logger::console_logger)
4140```
42- This way, there is no install step.
43- ### Windows + Visual Studio
44- #### Requirements
45- - Windows 10 or newer
46- - Visual Studio 2019 or 2022
47- - "Desktop development with C++" workload
48- - CMake support enabled (should be on by default for VS)
4941
50- #### Option 1: Use as a subproject
51- This avoids install paths and permissions. It also helps with dependencies.
52- ```
53- MyProject/
54- ├── CMakeLists.txt
55- ├── src/
56- └── external/
57- └── console_logger/
58- ```
42+ ### Option 3: Use CMake FetchContent (My favorite)
43+ This option is nice, because CMake will bring it locally into the project directory, and you can specify versions of specific dependencies.
5944``` cmake
60- add_subdirectory(external/console_logger)
61- target_link_libraries(<executable_name> PRIVATE console_logger::console_logger)
62- ```
63- Open the project folder in VS and it should configure and build automatically.
45+ include(FetchContent)
6446
65- #### Option 2: Install system-wide
66- From a ** Developer Command Prompt for Visual Studio** :
67- ``` bat
68- git clone https://github.com/<your-username>/console_logger.git
69- cd console_logger
70- mkdir build
71- cd build
72- cmake .. -DCMAKE_BUILD_TYPE=Release
73- cmake --build . --config Release
74- cmake --install .
47+ FetchContent_Declare(
48+ console_logger
49+ GIT_REPOSITORY https://github.com/BroDudeGuyMan/console_logger.git
50+ GIT_TAG v1.0.3
51+ # See releases page for version tags you can use.
52+ )
7553```
76- Then in your project:
54+
55+ You can then link the library as usual:
7756``` cmake
78- find_package(console_logger REQUIRED)
79- target_link_libraries(<executable_name> PRIVATE console_logger::console_logger)
57+ target_link_libraries(<your_target>
58+ PRIVATE
59+ console_logger
60+ )
8061```
8162
8263** ANSI Color Support on Windows**
0 commit comments