Cpp in visual studio: cmake and being able to compile

  • C/C++
  • Thread starter cppIStough
  • Start date
  • #1
cppIStough
17
2
I have the following directory of c++ files, and it looks like:

d.lib
--apps
----run_logger.cpp
----CMakeLists.txt
--include
----logger.h
--source
----logger.cpp

I want to build run_logger.cpp. I'm using Visual Studio. My CMakeLists is
Code:
cmake_minimum_required(VERSION 3.10)

project(d_lib)

# Add your source files
file(GLOB_RECURSE SOURCES "source/*.cpp" "include/*.h")

# Add your executable
add_executable(run_logger.cpp ${SOURCES})

How can I get this to compile? Thanks for your help.[/code]
 
Last edited:

Similar threads

  • Programming and Computer Science
Replies
12
Views
2K
  • Programming and Computer Science
Replies
6
Views
811
  • Programming and Computer Science
Replies
4
Views
3K
  • Nuclear Engineering
Replies
6
Views
1K
  • Programming and Computer Science
2
Replies
57
Views
3K
  • Programming and Computer Science
Replies
1
Views
2K
  • Programming and Computer Science
Replies
1
Views
3K
  • Programming and Computer Science
Replies
2
Views
142
  • Programming and Computer Science
3
Replies
70
Views
3K
  • Programming and Computer Science
Replies
7
Views
523
Back
Top