summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xCMakeLists.txt2
-rw-r--r--cmake/opentrack-mrproper.cmake (renamed from cmake/opentrack-build.cmake)12
-rw-r--r--cmake/opentrack-platform.cmake23
3 files changed, 23 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a90720a9..f6718bf5 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,7 +23,7 @@
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
include(opentrack-check-build-directory)
-include(opentrack-build)
+include(opentrack-mrproper)
project(opentrack)
cmake_minimum_required(VERSION 2.8.11)
diff --git a/cmake/opentrack-build.cmake b/cmake/opentrack-mrproper.cmake
index ab2bb3b8..faa11bd4 100644
--- a/cmake/opentrack-build.cmake
+++ b/cmake/opentrack-mrproper.cmake
@@ -7,18 +7,6 @@
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS 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()
-
function(cleanup_build_dir)
file(GLOB_RECURSE files LIST_DIRECTORIES TRUE RELATIVE "${CMAKE_BINARY_DIR}" "*")
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")