diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-06-19 16:25:44 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-06-19 16:25:44 +0200 |
commit | b454c962f4784ed06908f668b66376600d21dc52 (patch) | |
tree | 2047c3cd9a21e8a75f01fec630966938e101fea2 /cmake/opentrack-platform.cmake | |
parent | a6d54f7ed35d972793e819eae23eadc17e4bca50 (diff) |
cmake: move from build to mrproper and platform
Diffstat (limited to 'cmake/opentrack-platform.cmake')
-rw-r--r-- | cmake/opentrack-platform.cmake | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/cmake/opentrack-platform.cmake b/cmake/opentrack-platform.cmake index fac5f2bf..a3f12f96 100644 --- a/cmake/opentrack-platform.cmake +++ b/cmake/opentrack-platform.cmake @@ -21,6 +21,27 @@ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. +if(NOT CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install") +endif() + +set(CMAKE_BUILD_TYPE_INIT "RELEASE") + +if(APPLE) + if(NOT CMAKE_OSX_ARCHITECTURES) + set(CMAKE_OSX_ARCHITECTURES "x86_64") + endif() +endif() + +if(MSVC AND MSVC_VERSION LESS "1900") + message(FATAL_ERROR "Visual Studio too old. Use Visual Studio 2015 Update 3 or newer.") +endif() + +if(MSVC AND opentrack-64bit) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /HIGHENTROPYVA") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /HIGHENTROPYVA") +endif() + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(CMAKE_COMPILER_IS_GNUCXX TRUE) set(CMAKE_COMPILER_IS_CLANG TRUE) @@ -33,7 +54,7 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang") endif() if((NOT CMAKE_COMPILER_IS_GNUCXX) EQUAL (NOT (NOT CMAKE_COMPILER_IS_GNUCC))) - message(FATAL_ERROR "cannot use either use both gcc and g++ or neither") + message(FATAL_ERROR "use either use both gcc and g++ or neither") endif() IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") |