-
-
Save izzyaxel/c3a245336231e58e3ce8fe06fad6e989 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
cmake_minimum_required(VERSION 3.8.2) | |
project(projectname) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -Wextra -Wpedantic") | |
include_directories(include) | |
set(SOURCE_FILES | |
cppfile hppfile) | |
add_executable(${PROJECT_NAME} ${SOURCE_FILES}) | |
target_link_libraries(${PROJECT_NAME} | |
${CMAKE_SOURCE_DIR}/libs/libsdl2/libSDL2.dll.a | |
etc) | |
configure_file(original/file output/path/file COPYONLY) # copy a file into the build directory | |
if(CMAKE_BUILD_TYPE MATCHES Release) | |
set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} -mwindows) # -mwindows prevents the command prompt from opening when you run the built EXE on windows | |
set(CMAKE_CXX_FLAGS_RELEASE "-Ofast") | |
else(CMAKE_BUILD_TYPE MATCHES Debug) | |
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb3 -Og") | |
ADD_DEFINITIONS(-D_DEBUG) # A global define | |
endif() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment