Skip to content

Commit 95a807e

Browse files
committed
cmake and mac installation changes
1 parent 670dc43 commit 95a807e

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

CMakeLists.txt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
2020
if (MSVC)
2121
set(CMAKE_CXX_FLAGS "/Wall /W4 /EHsc")
2222
else()
23+
# linux and apple
2324
set(CMAKE_CXX_FLAGS "-Wextra -Wall -Wextra -Wconversion -Wdouble-promotion -Wno-unused-parameter -Wno-unused-function -Wno-sign-conversion")
2425
endif()
2526

@@ -61,6 +62,15 @@ if (MSVC)
6162
MESSAGE(STATUS "Build set to release mode")
6263
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2")
6364
endif()
65+
elseif(APPLE)
66+
if(CMAKE_BUILD_TYPE MATCHES "Debug")
67+
MESSAGE(STATUS "Build set to debug mode")
68+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fsanitize=address")
69+
elseif(CMAKE_BUILD_TYPE MATCHES "Release")
70+
MESSAGE(STATUS "Build set to release mode")
71+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g0 -O2")
72+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mtune=native")
73+
endif()
6474
elseif(LINUX)
6575
if(CMAKE_BUILD_TYPE MATCHES "Debug")
6676
MESSAGE(STATUS "Build set to debug mode")
@@ -105,10 +115,15 @@ if (NOT MSVC)
105115
if(CMAKE_BUILD_TYPE MATCHES "Release")
106116
install(TARGETS ${TARGET} DESTINATION /usr/local/bin)
107117
install(FILES "src/vmaware.hpp" DESTINATION /usr/include)
118+
install(FILES "src/vmaware_MIT.hpp" DESTINATION /usr/include)
108119
else()
109120
install(TARGETS ${TARGET} DESTINATION ${CMAKE_SOURCE_DIR})
110121
endif()
111122
elseif(MSVC)
112-
set(CMAKE_INSTALL_PREFIX "C:\\Program Files\\YourApplication")
113-
install(TARGETS ${TARGET} DESTINATION .)
123+
set(CMAKE_INSTALL_PREFIX "C:\\Program Files\\YourApplication")
124+
install(TARGETS ${TARGET} RUNTIME DESTINATION "bin")
125+
126+
set(HEADER_INSTALL_PATH "C:\\Program Files (x86)\\YourLibrary\\include")
127+
install(FILES "src/vmaware.hpp" DESTINATION "${HEADER_INSTALL_PATH}")
128+
install(FILES "src/vmaware_MIT.hpp" DESTINATION "${HEADER_INSTALL_PATH}")
114129
endif()

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,20 @@ cmake ..
9494
sudo make install
9595
```
9696

97+
### FOR MACOS:
98+
```bash
99+
mkdir build
100+
cd build
101+
cmake ..
102+
sudo make install
103+
```
104+
97105
### FOR WINDOWS:
98106
```bash
99107
cmake -S . -B build/ -G "Visual Studio 16 2019"
100108
```
101109

110+
102111
### CMake installation
103112
```cmake
104113
# edit this

0 commit comments

Comments
 (0)