<div dir="ltr">Damn..... send the unfinished message, I'll repeat what I had, and type the rest:<div><br></div><div><span style="font-size:12.8px">Hej,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">A quick glance doesn't show anything out of the ordinary, except that </div><div style="font-size:12.8px">* I'd prevent any use of `..` in your folder references (by using things like $<TARGET_PROPERTY:vector3_scalar,INCLUDE_DIRECTORIES> and $<TARGET_PROPERTY:vector3_scalar,INTERFACE_INCLUDE_DIRECTORIES></div><div style="font-size:12.8px">* I think it is more or less standard practice now to _not_ use 'include_directories', but instead use target_include_directories()</div><div style="font-size:12.8px">* you do add_subdirectory(source), but don't show the lists-file in that folder, which may cause the problem you're seeing</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">The first thing I see that seems really wrong though, is that you type the 'project()' command twice. AFAIK you're supposed to use this command exactly once, to set the properties of the entire project. Using it multiple times causes undefined behaviour, and may very well be the cause for what you're seeing</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Sincerely,</div><div style="font-size:12.8px">Jakob</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 19, 2015 at 8:34 AM, Jakob van Bethlehem <span dir="ltr"><<a href="mailto:jsvanbethlehem@gmail.com" target="_blank">jsvanbethlehem@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hej,<div><br></div><div>A quick glance doesn't show anything out of the ordinary, except that </div><div>* I'd prevent any use of `..` in your folder references (by using things like $<TARGET_PROPERTY:vector3_scalar,INCLUDE_DIRECTORIES> and $<TARGET_PROPERTY:vector3_scalar,INTERFACE_INCLUDE_DIRECTORIES></div><div>* I think it is more or less standard practice now to _not_ use 'include_directories', but instead use target_include_directories()</div><div>* you'</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sun, Oct 18, 2015 at 11:58 PM, Owen Alanzo Hogarth <span dir="ltr"><<a href="mailto:gurenchan@gmail.com" target="_blank">gurenchan@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">I am having some trouble with my cmake build. I recently redesigned the physical layout of my files so that it'll be a bit easier to maintain in the long run.<div><br></div><div>I have my project structure setup like this.</div><div><br></div><div>MAIN_PROJECT/</div><div>project/main.c # this is the executable</div><div>resources/...    # a folder filled with resources </div><div>source/</div><div>source/moduleA/moduleA.h #includes all headers for this module</div><div>                                             #a user would just import moduleA.h</div><div><br></div><div>source/moduleA/headers/header1.h header2.h<br></div><div>source/moduleA/src/source1.c  source2.c<br></div><div>source/moduleA/common/common_structs.h #holds common structs for<br></div><div>                                                                        #all src files in this module</div><div><br></div><div><br></div><div>with my project re-organized like this and try to build my shared libraries I get no output.</div><div><br></div><div>For example main cmakelists.txt file</div><div><br></div><div><div>PROJECT(project)</div><div>CMAKE_MINIMUM_REQUIRED(VERSION 2.8)</div><div><br></div><div>SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY $(CMAKE_BINARY_DIR)/lib)</div><div>SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY $(CMAKE_BINARY_DIR)/lib)</div><div>SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY $(CMAKE_BINARY_DIR)/bin)</div><div><br></div><div>SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)</div><div><br></div><div>ADD_SUBDIRECTORY(source)</div><div><br></div><div>FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/resources/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/bin/resources/)</div></div><div><br></div><div>this is one module within the source folder, a matrix4</div><div><br></div><div><div>PROJECT(matrix4_scalar)</div><div><br></div><div>INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../common")</div><div>INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../vector3_scalar/headers/vector3_scalar.h")<br></div><div><br></div><div>SET(HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/../common/common_structs.h" "${CMAKE_CURRENT_SOURCE_DIR}/../vector3_scalar/headers/vector3_scalar.h")</div><div><br></div><div><br></div><div>SET(SRC_FILES src/matrix4_scalar.c ${HEADER_FILES})</div><div><br></div><div>ADD_LIBRARY(matrix4_scalar SHARED ${SRC_FILES})</div><div><br></div><div>TARGET_LINK_LIBRARIES(matrix4_scalar vector3_scalar)</div></div><div><br></div><div><br></div><div><br></div><div>The vector3 class is built in a similar way but has no outside dependencies except for the common_struct.h header file. </div><div><br></div><div>This matrix class depends on the vector3 class so I have it as a target link library.</div><div><br></div><div>When I build like this I get no output to my lib directories and I am not sure what's going on.</div></div>
<br></div></div>--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br></blockquote></div><br></div>
</blockquote></div><br></div>