summaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-06-19 16:25:44 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-06-19 16:25:44 +0200
commitb454c962f4784ed06908f668b66376600d21dc52 (patch)
tree2047c3cd9a21e8a75f01fec630966938e101fea2 /cmake
parenta6d54f7ed35d972793e819eae23eadc17e4bca50 (diff)
cmake: move from build to mrproper and platform
Diffstat (limited to 'cmake')
-rw-r--r--cmake/opentrack-mrproper.cmake (renamed from cmake/opentrack-build.cmake)12
-rw-r--r--cmake/opentrack-platform.cmake23
2 files changed, 22 insertions, 13 deletions
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")