Skip to content

Instantly share code, notes, and snippets.

@takamin
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takamin/56f366e98c0ab568ebd6 to your computer and use it in GitHub Desktop.
Save takamin/56f366e98c0ab568ebd6 to your computer and use it in GitHub Desktop.
ジェネレータの名前に `MinGW` が含まれていたら bar をリンクする CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(hogehoge)
add_executable(hoge hoge.c)
if(CMAKE_GENERATOR MATCHES "MinGW")
target_link_libraries(hoge foo bar)
else()
target_link_libraries(hoge foo)
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment