Created
December 22, 2013 05:13
-
-
Save raa0121/8078716 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_executable(hello hello.cpp) | |
set(CMAKE_CXX_COMPILER "/usr/bin/c++") | |
set(CMAKE_CXX_FLAGS "-g -pedantic -Wall -std=c++11") | |
cmake_minimum_required(VERSION 2.8) | |
#------------------------------------------------------------------------------ | |
# Required CPM Setup - no need to modify - See: https://github.com/iauns/cpm | |
#------------------------------------------------------------------------------ | |
set(CPM_DIR "${CMAKE_CURRENT_BINARY_DIR}/cpm-packages" CACHE TYPE STRING) | |
find_package(Git) | |
if(NOT GIT_FOUND) | |
message(FATAL_ERROR "CPM requires Git.") | |
endif() | |
if (NOT EXISTS ${CPM_DIR}/CPM.cmake) | |
message(STATUS "Cloning repo (https://github.com/iauns/cpm)") | |
execute_process( | |
COMMAND "${GIT_EXECUTABLE}" clone https://github.com/iauns/cpm ${CPM_DIR} | |
RESULT_VARIABLE error_code | |
OUTPUT_QUIET ERROR_QUIET) | |
if(error_code) | |
message(FATAL_ERROR "CPM failed to get the hash for HEAD") | |
endif() | |
endif() | |
include(${CPM_DIR}/CPM.cmake) | |
#------------------------------------------------------------------------------ | |
# CPM Modules | |
#------------------------------------------------------------------------------ | |
CPM_AddModule("google-test" | |
GIT_REPOSITORY "https://github.com/iauns/cpm-google-test" | |
GIT_TAG "1.0.1") | |
CPM_Finish() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment