Skip to content

Commit ee3e279

Browse files
committed
cmake defaults stage1 to install in build directory
1 parent 477ded9 commit ee3e279

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ if(NOT CMAKE_BUILD_TYPE)
55
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
66
endif()
77

8+
if(NOT CMAKE_INSTALL_PREFIX)
9+
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE STRING
10+
"Directory to install zig to" FORCE)
11+
endif()
12+
813
project(zig C CXX)
914
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
1015

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ libc. Create demo games using Zig.
141141
```
142142
mkdir build
143143
cd build
144-
cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)
144+
cmake ..
145145
make
146146
make install
147-
./zig build --build-file ../build.zig test
147+
bin/zig build --build-file ../build.zig test
148148
```
149149

150150
##### MacOS
@@ -154,9 +154,9 @@ brew install cmake llvm@6
154154
brew outdated llvm@6 || brew upgrade llvm@6
155155
mkdir build
156156
cd build
157-
cmake .. -DCMAKE_PREFIX_PATH=/usr/local/opt/llvm@6/ -DCMAKE_INSTALL_PREFIX=$(pwd)
157+
cmake .. -DCMAKE_PREFIX_PATH=/usr/local/opt/llvm@6/
158158
make install
159-
./zig build --build-file ../build.zig test
159+
bin/zig build --build-file ../build.zig test
160160
```
161161

162162
##### Windows

0 commit comments

Comments
 (0)