Study: DeveloperTools(DevTool)/DevTool: CMake

[CMake] λ³€μˆ˜ 및 이미 μ •μ˜λœ 맀크둜 κ°’λ“€

DrawingProcess 2022. 7. 7. 15:05
λ°˜μ‘ν˜•
πŸ’‘ λ³Έ λ¬Έμ„œλŠ” CMake에 이미 μ •μ˜λ˜μ–΄ μžˆλŠ” λ³€μˆ˜ 값인 λ§€ν¬λ‘œμ— λŒ€ν•΄ λ‚˜μ—΄ν•œ λ¬Έμ„œλ‘œ,
주둜 ν™˜κ²½ 경둜 등을 μ‚¬μš©μžκ°€ μ„€μ •ν•˜κΈ° μœ„ν•΄ μ‚¬μš©ν•©λ‹ˆλ‹€.

1. λ³€μˆ˜ μ •μ˜ 및 μ‚¬μš©

일반적인 λ³€μˆ˜ μ •μ˜

set(<variable> <value>... [PARENT_SCOPE])
  • If the PARENT_SCOPE option is given the variable will be set in the scope above the current scope.
option(<variable> "<help_text>" [value])
  • an option for the user to select as ON or OFF.
  • If no initial <value> is provided, OFF is used. 

μΊμ‹œ λ³€μˆ˜ μ •μ˜

set(<variable> <value>... CACHE <type> <docstring> [FORCE])

ν™˜κ²½ λ³€μˆ˜ μ •μ˜

set(ENV{<variable>} [<value>])
  • calls of $ENV{<variable>} will return this new value.
  • If no argument is given after ENV{<variable>}, then this command will clear any existing value of the environment variable.

λ³€μˆ˜ μ‚¬μš©

${λ³€μˆ˜}

2. 이미 μ •μ˜λœ λ³€μˆ˜(맀크둜)

  •  RUNTIME_OUTPUT_DIRECTORY 
     : λΉŒλ“œ 이후 μƒμ„±λœ λ°”μ΄λ„ˆλ¦¬λ₯Ό μ €μž₯ν•  디렉토리 κ°’(경둜)이 μ €μž₯λ˜μ–΄ μžˆλŠ” λ³€μˆ˜
  •  LIBRARY_OUTPUT_DIRECTORY 
     : λΉŒλ“œ 이후 μƒμ„±λœ 라이브러리λ₯Ό μ €μž₯ν•  디렉토리 κ°’(경둜)이 μ €μž₯λ˜μ–΄ μžˆλŠ” λ³€μˆ˜
  •  ARCHIVE_OUTPUT_DIRECTORY 
     : λΉŒλ“œ 이후 μƒμ„±λœ μ•„μΉ΄μ΄λΈŒ(=static라이브러리)λ₯Ό μ €μž₯ν•  디렉토리 κ°’(경둜)이 μ €μž₯λ˜μ–΄ μžˆλŠ” λ³€μˆ˜
λ°˜μ‘ν˜•