I am trying to create a shared library using the files present in SOURCE. So I added as suggested by this post.
cmake_minimum_required(VERSION 3.0.2)
project(myproj)
set (SOURCE
${SOURCE}
${CMAKE_CURRENT_SOURCE_DIR}/src/io/IO1.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/io/IO2.cpp
)
add_library(myprojlib SHARED SOURCE)
I get error even though I have set the source :
CMake Error at CMakeLists.txt:34 (add_library): Cannot find source file:
SOURCE
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx
add_library(myprojlib SHARED SOURCE)
should beadd_library(myprojlib SHARED ${SOURCE})
it thinks you mean SOURCE is the filename of your source cdoe not a variable. – drescherjm