Advertisement
Guest User

Example CMakeLists.txt

a guest
Dec 31st, 2014
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 0.97 KB | None | 0 0
  1. #
  2. # Project for secwipe command
  3. #
  4. cmake_minimum_required(VERSION 3.0)
  5. include(CheckCSourceCompiles)
  6.  
  7. # We put this before the project() definition below so
  8. # we can change the CMAKE_C_COMPILER and CMAKE_CXX_COMPILER
  9. # beforehand.  This allows us to default to clang over gcc.
  10. option(USE_CLANG "Build using clang (the default)" ON)
  11. if(USE_CLANG)
  12.     message("-- Setting default compiler to clang.")
  13.     set(CMAKE_C_COMPILER clang)
  14.     set(CMAKE_CXX_COMPILER clang++)
  15. endif()
  16.  
  17. project(Secwipe)
  18. CHECK_C_SOURCE_COMPILES([=[#include <gnu/libc-version.h>
  19.                            int main(void) { gnu_get_libc_version(); return 0; }]=]
  20.                         GLIBC_DETECTED)
  21. find_package(Curses REQUIRED)
  22.  
  23. # Note: Including ${CMAKE_BINARY_DIR} so generated config.h will be found.
  24. include_directories(${CMAKE_BINARY_DIR} ${CURSES_INCLUDE_DIR})
  25.  
  26. configure_file(config.h.in config.h)
  27.  
  28. add_executable(secwipe secwipe.c)
  29.  
  30. target_link_libraries(secwipe ${CURSES_LIBRARIES})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement