diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-07-06 12:24:32 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-07-06 12:24:32 +0200 |
commit | 0d42cba7e4871d2f099fd93e757556a0502d6714 (patch) | |
tree | d0e385f488bbf3d18f85ad24e432830feefebc61 | |
parent | f69ac22aa0dbe7218c33a374133c88e8f4e5a65a (diff) |
cmake: add universally good build defaults
These were in the mingw-w64 toolchain file but it's good to have them in
general.
-rwxr-xr-x | CMakeLists.txt | 3 | ||||
-rw-r--r-- | cmake/mingw-w64.cmake | 5 | ||||
-rw-r--r-- | cmake/opentrack-boilerplate.cmake | 2 | ||||
-rw-r--r-- | cmake/opentrack-build.cmake | 5 |
4 files changed, 8 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b5dc355e..9a6eb704 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/) include(opentrack-check-build-directory) +include(opentrack-build) -project(opentrack) +project(opentrack C CXX) cmake_minimum_required(VERSION 2.8.11) include(CMakeParseArguments) diff --git a/cmake/mingw-w64.cmake b/cmake/mingw-w64.cmake index 61bfa524..a6233514 100644 --- a/cmake/mingw-w64.cmake +++ b/cmake/mingw-w64.cmake @@ -110,8 +110,3 @@ endforeach() set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s" CACHE STRING "" FORCE) set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s" CACHE STRING "" FORCE) -set(CMAKE_BUILD_TYPE_INIT "RELEASE") - -if(NOT CMAKE_INSTALL_PREFIX) - set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "" FORCE) -endif() diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake index 54643c42..9a979567 100644 --- a/cmake/opentrack-boilerplate.cmake +++ b/cmake/opentrack-boilerplate.cmake @@ -106,7 +106,7 @@ macro(opentrack_boilerplate n) message(FATAL_ERROR "opentrack_boilerplate bad formals ${${n}-args_UNPARSED_ARGUMENTS}") endif() if(NOT ${n}-args_STAGE2) - project(${n}) + project(${n} C CXX) opentrack_set_globs(${n}) opentrack_qt(${n}) endif() diff --git a/cmake/opentrack-build.cmake b/cmake/opentrack-build.cmake new file mode 100644 index 00000000..6f23f561 --- /dev/null +++ b/cmake/opentrack-build.cmake @@ -0,0 +1,5 @@ +if(NOT CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "" FORCE) +endif() + +set(CMAKE_BUILD_TYPE_INIT "RELEASE") |