λ°μν
π‘ λ³Έ λ¬Έμλ 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λΌμ΄λΈλ¬λ¦¬)λ₯Ό μ μ₯ν λλ ν 리 κ°(κ²½λ‘)μ΄ μ μ₯λμ΄ μλ λ³μ
λ°μν
'Study: DeveloperTools(DevTool) > DevTool: CMake' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[IDE] VSCode C++ CMake κ°λ°νκ²½ μΈν (MacOS, Linux) (0) | 2022.07.19 |
---|---|
[CMake] make package ν¨ν€μ§ (feat. cmake install) (0) | 2022.07.14 |
[CMake] configure_file(): CMake λ³μκ°μ μμ€μ½λμμ μ¬μ©! (0) | 2022.07.04 |
[CMake] function: λ°λ³΅λλ μμ μ ν¨μννμ! (0) | 2022.06.28 |
[CMake] ν¬λ‘μ€ νλ«νΌ λΉλ νκ²½ κ΅¬μΆ (0) | 2022.06.24 |