0% found this document useful (0 votes)
47 views2 pages

CMake Lists

Uploaded by

felix
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views2 pages

CMake Lists

Uploaded by

felix
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

# ========================================================

# Copyright (c) 2020 Gabriel Schmitz. All rights reserved.


# ========================================================

cmake_minimum_required( VERSION 3.16 )


project( native_message_box )
set( CMAKE_CXX_STANDARD 14 )

# =======
# WINDOWS
# =======

if( WIN32 )

message( STATUS "Platform: Windows" )

# =====
# MACOS
# =====

elseif( APPLE )

message( STATUS "Platform: MacOS" )

find_library( CORE_FOUNDATION_LIBRARY CoreFoundation )


if (NOT CORE_FOUNDATION_LIBRARY)
message( FATAL_ERROR ": Framework CoreFoundation not found" )
else()
message( STATUS "CoreFoundation: ${CORE_FOUNDATION_LIBRARY}" )
link_libraries( ${CORE_FOUNDATION_LIBRARY} )
endif()

# =====
# LINUX
# =====

elseif( UNIX )

message( STATUS "Platform: Linux" )

FIND_PACKAGE( PkgConfig REQUIRED)


PKG_CHECK_MODULES( GTK REQUIRED gtk+-3.0 )
INCLUDE_DIRECTORIES(${GTK_INCLUDE_DIRS})
LINK_DIRECTORIES(${GTK_LIBRARY_DIRS})
ADD_DEFINITIONS(${GTK_CFLAGS_OTHER})
link_libraries( ${GTK_LIBRARIES} )

# ===========
# UNSUPPORTED
# ===========

else()

message( FATAL_ERROR "Platform: Not supported" )


endif()

# ===================
# EXAMPLE APPLICATION
# ===================

add_executable( native_message_box_example example/main.cpp )


target_include_directories( native_message_box_example PRIVATE include )

You might also like