Skip to content

Instantly share code, notes, and snippets.

@optimalistel
optimalistel / CMakeHideConsole.cmake
Last active June 30, 2024 18:38
CMake Hide console window in visual studio projects
#--------------------------------------------------------------------
# Hide the console window in visual studio projects
#--------------------------------------------------------------------
if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
endif()
#--------------------------------------------------------------------
# Hide the console window in visual studio projects - Release
#--------------------------------------------------------------------
@optimalistel
optimalistel / CMakeIncludeOpenCV.cmake
Created May 21, 2015 15:36
CMake Include OpenCV - Win32
#--------------------------------------------------------------------
# Include OpenCV library and copy the dlls on Windows
#--------------------------------------------------------------------
set(OpenCV_STATIC OFF)
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
target_link_libraries( ${PROJECT_NAME} ${OpenCV_LIBS} )
if(NOT OpenCV_STATIC)
if(WIN32)