CMakeLists.txt指定编译

时间:2015-09-15 09:48:38

标签: c++ cmake coderunner

所以我习惯了IDE,就像CLion一样,我们使用CMakeLists.txt告诉编译器标志,设置东西等。在Coderunner中有没有办法做到这一点?我看到我可以添加标志,但有没有办法添加下面的示例代码?

cmake_minimum_required(VERSION 2.8)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -Wall")
if(APPLE)
  set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
endif()
find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
add_executable(project-test main.cpp)
target_link_libraries(project-test ${OPENSSL_CRYPTO_LIBRARIES})

0 个答案:

没有答案