LoginSignup
1
3

More than 5 years have passed since last update.

cmakeで環境変数を使ってディレクトリを指定したい

Posted at

手順
$ENV{HOGE} を使う。ENVをつけよう。
${HOGE} そのままだとうまくいかない。

cmake_minimum_required(VERSION 3.8)

include_directories(
        $ENV{GTEST_DIR}/include
        )

add_executable(
        fuga
        fuga.cpp
        )

target_link_libraries(
        fuga
        $ENV{GMOCK_DIR}/gtest/libgtest.a
        $ENV{GMOCK_DIR}/gtest/libgtest_main.a
        )
1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3