Skip to content

Latest commit

 

History

History
33 lines (27 loc) · 571 Bytes

ProjectStructWithCmake.md

File metadata and controls

33 lines (27 loc) · 571 Bytes

Setting up a new C++ project and typical CMakefiles

Directory Structure

|
|- include
|- src
|- tests

Top Level CMakeLists.txt

cmake_minimum_required(VERSION 2.8)
project (RtlChecker)

SET( CMAKE_CXX_FLAGS -std=c++11 )
include_directories("${PROJECT_SOURCE_DIR}/include")

add_subdirectory (src)
add_subdirectory (test)

src/CMakeLists.txt

add_library(libName file1.cpp)

tests/CMakelists.txt

link_directories (${PROJECT_BINARY_DIR}/lib) 
add_executable(exeName test1.cpp)
target_link_libraries (exeName libName)