DefineCMakeDefaults.cmake 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. # Always include srcdir and builddir in include path
  2. # This saves typing ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY} in
  3. # about every subdir
  4. # since cmake 2.4.0
  5. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  6. # Put the include dirs which are in the source or build tree
  7. # before all other include dirs, so the headers in the sources
  8. # are prefered over the already installed ones
  9. # since cmake 2.4.1
  10. set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
  11. # Use colored output
  12. # since cmake 2.4.0
  13. set(CMAKE_COLOR_MAKEFILE ON)
  14. # Define the generic version of the libraries here
  15. set(GENERIC_LIB_VERSION "0.1.0")
  16. set(GENERIC_LIB_SOVERSION "0")
  17. # Set the default build type to release with debug info
  18. if (NOT CMAKE_BUILD_TYPE)
  19. set(CMAKE_BUILD_TYPE RelWithDebInfo
  20. CACHE STRING
  21. "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
  22. )
  23. endif (NOT CMAKE_BUILD_TYPE)
  24. # disallow in-source build
  25. include(MacroEnsureOutOfSourceBuild)
  26. macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source build.
  27. Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there.")