Skip to content

Instantly share code, notes, and snippets.

@lighta
Last active July 6, 2020 17:06
Show Gist options
  • Save lighta/8dcff2f9780691bea5191293e3d770eb to your computer and use it in GitHub Desktop.
Save lighta/8dcff2f9780691bea5191293e3d770eb to your computer and use it in GitHub Desktop.
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_module)
message(STATUS "CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} CMAKE_HOME_DIRECTORY=${CMAKE_HOME_DIRECTORY}")
set(CMAKE_CXX_STANDARD 98)
include(tpe-target) #this is used to auto define toolchain
#################################################
# Configuration du projet
#################################################
project(TpeNexo)
message(STATUS "TPE_TOOLS_PATH=${TPE_TOOLS_PATH}") #TPE_TOOLS_PATH is undefined ??
if(NOT DEFINED TPE_TOOLS_PATH)
set(TPE_TOOLS_PATH $ENV{TPE_TOOLS_PATH})
endif()
if(NOT DEFINED TPE_TOOLS_PATH)
message(FATAL_ERROR "Please define TPE_TOOLS_PATH, (either as -DTPE_TOOLS_PATH or environment variable)")
endif()
#other directive...
if (NOT TPE_TARGET)
set(TPE_TARGET WIN32)
message(WARNING "TPE_TARGET not set, defaulting to WIN32.")
endif ()
if (TPE_TARGET STREQUAL "POSIX")
get_filename_component(CMAKE_TOOLCHAIN_FILE "cmake-modules/platform/Toolchain-cygwin64-3.1.4-gcc-9.2.0.cmake" REALPATH BASE_DIR "${TPE_TOOLS_PATH}")
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment