Skip to content

Instantly share code, notes, and snippets.

@float1251
Created January 3, 2016 10:40
Show Gist options
  • Save float1251/b82ad7f9c39273248450 to your computer and use it in GitHub Desktop.
Save float1251/b82ad7f9c39273248450 to your computer and use it in GitHub Desktop.
subdirectoryを使用する際のCMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(hello)
include_directories("${PROJECT_SOURCE_DIR}")
message(----------------------)
message(${PROJECT_SOURCE_DIR})
message(----------------------)
# file(GLOB subdirs
# "${CMAKE_SOURCE_DIR}/src"
# "${CMAKE_SOURCE_DIR}/src/*"
# )
#
# foreach(dir ${subdirs})
# message(${dir})
# endforeach(dir)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
file(GLOB_RECURSE SRCS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
foreach(f ${SRCS})
message(${f})
endforeach(f)
add_executable(hello test.cpp ${SRCS})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment