1
General / Re: How to compile for release version in Cmake?
« on: March 25, 2018, 05:03:41 am »You set the CMAKE_BUILD_TYPE to release.
Ah. That worked. Thanks!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
You set the CMAKE_BUILD_TYPE to release.
cmake_minimum_required(VERSION 3.2)
project(CityBuildingGame)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -w -mwindows")
set(OUTPUT_DIR ${PROJECT_SOURCE_DIR}/bin) # specify output directory
set(SOURCE_FILES main.cpp)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR}) # set output directory
add_executable(CityBuildingGame ${SOURCE_FILES})
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake_modules")
find_package(SFML REQUIRED system window graphics network audio)
if (SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(CityBuildingGame ${SFML_LIBRARIES})
endif()